feat(tvix/castore/fs): make allow_other configurable

Also add a cli argument to the `tvix-store` binary.

Change-Id: Id07d7fedb60d6060543b195f3a810a46137f9ad5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10945
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
Florian Klink 2024-02-17 13:18:10 +07:00 committed by clbot
parent 58f474041e
commit 34a1ff291a
3 changed files with 16 additions and 4 deletions

View file

@ -53,7 +53,12 @@ pub struct FuseDaemon {
impl FuseDaemon {
#[instrument(skip(fs, mountpoint), fields(mountpoint=?mountpoint), err)]
pub fn new<FS, P>(fs: FS, mountpoint: P, threads: usize) -> Result<Self, io::Error>
pub fn new<FS, P>(
fs: FS,
mountpoint: P,
threads: usize,
allow_other: bool,
) -> Result<Self, io::Error>
where
FS: FileSystem + Sync + Send + 'static,
P: AsRef<Path> + std::fmt::Debug,
@ -64,7 +69,7 @@ impl FuseDaemon {
.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?;
#[cfg(target_os = "linux")]
session.set_allow_other(false);
session.set_allow_other(allow_other);
session
.mount()
.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?;

View file

@ -51,7 +51,7 @@ where
Arc::new(root_nodes),
list_root,
);
FuseDaemon::new(Arc::new(fs), mountpoint.as_ref(), 4)
FuseDaemon::new(Arc::new(fs), mountpoint.as_ref(), 4, false)
}
async fn populate_blob_a(