Fix updater permissions and refactor existing code.

This commit is contained in:
Gav Wood
2016-12-16 18:17:15 +01:00
parent b89d10239b
commit 14e4fefbcf
4 changed files with 13 additions and 14 deletions

View File

@@ -1168,8 +1168,8 @@ fn save_key(path: &Path, key: &Secret) {
return;
}
};
if let Err(e) = restrict_permissions_owner(path) {
warn!(target: "network", "Failed to modify permissions of the file (chmod: {})", e);
if let Err(e) = restrict_permissions_owner(path, true, false) {
warn!(target: "network", "Failed to modify permissions of the file ({})", e);
}
if let Err(e) = file.write(&key.hex().into_bytes()) {
warn!("Error writing key file: {:?}", e);