Skip to content

Commit

Permalink
fix: test check access
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Oct 23, 2024
1 parent 4de5dd2 commit 3f63a67
Show file tree
Hide file tree
Showing 2 changed files with 333 additions and 77 deletions.
3 changes: 2 additions & 1 deletion remotefs-fuse/src/driver/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use super::Driver;

const BLOCK_SIZE: usize = 512;
const FMODE_EXEC: i32 = 0x20;
const ROOT_UID: u32 = 0;

/// Convert a [`remotefs::fs::FileType`] to a [`FileType`] from [`fuser`]
fn convert_remote_filetype(filetype: remotefs::fs::FileType) -> FileType {
Expand Down Expand Up @@ -164,7 +165,7 @@ impl Driver {
debug!("file mode for {}: {file_mode:o}", file.path().display());

// root is allowed to read & write anything
if uid == 0 {
if uid == ROOT_UID {
debug!("Root access to file: {}", file.path().display());
// root only allowed to exec if one of the X bits is set
access_mask &= libc::X_OK;
Expand Down
Loading

0 comments on commit 3f63a67

Please sign in to comment.