Set truncate when creating a new key file

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet committed 2024-03-22 15:13:11 +01:00
1 parent ac5c48a052
commit 82caffeaca
1 file changed
+1
+1
View File
@@ -323,6 +323,7 @@ async fn save_key_file(key: &crypto::SecretKey, path: &Path) -> io::Result<()> {
let mut file = OpenOptions::new()
.create(true)
.truncate(true)
.write(true)
.mode(0o600) // rw by the owner, not readable by group or others
.open(path)