diff --git a/src/encryptedfs_fuse3.rs b/src/encryptedfs_fuse3.rs index 6ec4a7b6..4183a520 100644 --- a/src/encryptedfs_fuse3.rs +++ b/src/encryptedfs_fuse3.rs @@ -147,10 +147,10 @@ impl EncryptedFsFuse3 { } fn creation_mode(&self, mode: u32) -> u16 { - if !self.suid_support { - (mode & !(libc::S_ISUID | libc::S_ISGID)) as u16 - } else { + if self.suid_support { mode as u16 + } else { + (mode & !(libc::S_ISUID | libc::S_ISGID)) as u16 } } diff --git a/src/lib.rs b/src/lib.rs index 367ef8c8..39a20d34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,8 +65,8 @@ //! - `cipher`: The encryption algorithm to use. Currently, it supports these ciphers [Cipher](Cipher). //! - `allow_root`: Allow root to access the file system. //! - `allow_other`: Allow other users to access the file system. -//! - `direct_io`: Use direct I/O. -//! - `suid_support`: Enable suid support. +//! - `direct_io`: Use direct I/O (bypass page cache for open files). +//! - `suid_support`: If it should allow setting `SUID` and `SGID` when files are created. On `false` it will unset those flags when creating files. //! //! ## Or directly work with [EncryptedFs](EncryptedFs) //! diff --git a/src/main.rs b/src/main.rs index 354a8935..ea7b9eea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -146,14 +146,14 @@ fn get_cli_args() -> ArgMatches { .short('i') .action(ArgAction::SetTrue) .requires("mount-point") - .help("Mount FUSE with direct IO"), + .help("Use direct I/O (bypass page cache for an open file)"), ) .arg( Arg::new("suid") .long("suid") .short('s') .action(ArgAction::SetTrue) - .help("Enable setuid support when run as root"), + .help("If it should allow setting SUID and SGID when files are created. Default is false and it will unset those flags when creating files"), ) .arg( Arg::new("change-password")