Skip to content

Commit 7c4d1bc

Browse files
committed
fix: use portable MetadataExt::uid() instead of st_uid()
The st_uid() method is from std::os::linux::fs::MetadataExt while uid() is from std::os::unix::fs::MetadataExt which is portable across all Unix platforms. Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com> Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
1 parent 2a6482d commit 7c4d1bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • crates/openshell-sandbox/src

crates/openshell-sandbox/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@ fn prepare_read_write_path(path: &std::path::Path, uid: Option<nix::unistd::Uid>
18781878
// 0700, which prevents the unprivileged sandbox user from writing.
18791879
if meta.is_dir() {
18801880
let mode = meta.permissions().mode();
1881-
let owned_by_target = uid.is_some_and(|u| u.as_raw() == meta.st_uid());
1881+
let owned_by_target = uid.is_some_and(|u| u.as_raw() == meta.uid());
18821882
let world_writable = mode & 0o002 != 0;
18831883
let user_writable = owned_by_target && (mode & 0o200 != 0);
18841884

0 commit comments

Comments
 (0)