tools::get_hardware_address - fix FILENAME, use file_get_contents()
This commit is contained in:
		@ -387,12 +387,9 @@ pub fn scandir<P, F>(
 | 
			
		||||
 | 
			
		||||
pub fn get_hardware_address() -> Result<String, Error> {
 | 
			
		||||
 | 
			
		||||
    static FILENAME: &str = "/etc/ssh/assh_host_rsa_key.pub";
 | 
			
		||||
 | 
			
		||||
    let mut file = File::open(FILENAME)?;
 | 
			
		||||
    let mut contents = Vec::new();
 | 
			
		||||
    file.read_to_end(&mut contents)?;
 | 
			
		||||
    static FILENAME: &str = "/etc/ssh/ssh_host_rsa_key.pub";
 | 
			
		||||
 | 
			
		||||
    let contents = file_get_contents(FILENAME)?;
 | 
			
		||||
    let digest = md5::compute(contents);
 | 
			
		||||
 | 
			
		||||
    Ok(format!("{:0x}", digest))
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user