Skip to content

Commit

Permalink
Disable nonempty fuse option for fuse3
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Bottriell <rbottriell@ilm.com>
  • Loading branch information
rydrman committed Mar 12, 2024
1 parent fa78115 commit 80a4ac4
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions crates/spfs-cli/cmd-fuse/src/cmd_fuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ impl CmdFuse {
let calling_gid = nix::unistd::getegid();

// these will cause conflicts later on if their counterpart is also provided
let required_opts = vec![
MountOption::RO,
MountOption::NoDev,
MountOption::NoSuid,
MountOption::CUSTOM("nonempty".into()),
];
let mut required_opts = vec![MountOption::RO, MountOption::NoDev, MountOption::NoSuid];
if !fuse3_available() {
// the nonempty option became a default and was removed in
// fuse3 but is still needed for fuse2
required_opts.push(MountOption::CUSTOM("nonempty".into()));
}
let mut opts = Config {
root_mode: 0o777,
uid: calling_uid,
Expand Down Expand Up @@ -303,3 +303,8 @@ fn parse_options_from_args(args: &[String]) -> Vec<MountOption> {
})
.collect()
}

/// Checks if fusermount3 is available to be used on this system
fn fuse3_available() -> bool {
spfs::which("fusermount3").is_some()
}

0 comments on commit 80a4ac4

Please sign in to comment.