diff --git a/Cargo.toml b/Cargo.toml index 0ae7a32..4a47f10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,10 +5,9 @@ edition = "2021" [dependencies] digest = "0.10" -libc = "0.2.146" +libc = "0.2" rustls-pemfile = "1.0" sha2 = "0.10" -time = "0.3" tinyrand = "0.5" x509-parser = "0.15" diff --git a/src/mailstore/filesystem.rs b/src/mailstore/filesystem.rs index 69198da..31d0901 100644 --- a/src/mailstore/filesystem.rs +++ b/src/mailstore/filesystem.rs @@ -535,6 +535,17 @@ fn chown(path: CString, uid: u32, gid: u32) -> Result<(), io::Error> { Ok(()) } +#[cfg(target_os = "freebsd")] +fn chmod(path: CString, mode: u16) -> Result<(), io::Error> { + unsafe { + if libc::chmod(path.as_ptr(), mode) != 0 { + return Err(io::Error::last_os_error()); + } + } + Ok(()) +} + +#[cfg(target_os = "linux")] fn chmod(path: CString, mode: u32) -> Result<(), io::Error> { unsafe { if libc::chmod(path.as_ptr(), mode) != 0 {