Correct loading/truncation of secret key files
Dependencies
- [2]
DOEG3V7UOnly re-write identity data when changed - [3]
4KJ45IJLImplement new identity management - [4]
4OJWMSOWFully replace crate::Identity
Change contents
- edit in pijul/src/identity/load.rs at line 8
use std::path::Path; - edit in pijul/src/identity/load.rs at line 104
#[cfg(unix)]pub fn open_secret_file(path: &Path) -> Result<std::fs::File, std::io::Error> {use std::fs::OpenOptions;use std::os::unix::fs::OpenOptionsExt;OpenOptions::new().write(true).create(true).mode(0o600).open(path)}#[cfg(not(unix))]pub fn open_secret_file(path: &Path) -> Result<std::fs::File, std::io::Error> {std::fs::File::create(path)} - replacement in pijul/src/identity/create.rs at line 276
let mut key_file = super::load::open_secret_file(&identity_dir.join("secret_key.json"))?;let mut key_file = std::fs::File::create(&identity_dir.join("secret_key.json"))?;