diff options
| -rw-r--r-- | src/config/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index 19f21a0..376f923 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -538,6 +538,12 @@ fn create_config_file(config_path: &Path) -> Result<()> { } ensure_parent_exists(config_path)?; std::fs::write(config_path, raw_config).with_context(|| "Failed to write to config file")?; + #[cfg(unix)] + { + use std::os::unix::prelude::PermissionsExt; + let perms = std::fs::Permissions::from_mode(0o600); + std::fs::set_permissions(config_path, perms)?; + } Ok(()) } |
