Skip to content

Commit

Permalink
addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-bhatt committed Aug 1, 2024
1 parent 01592fb commit 90de503
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/safeposix/syscalls/fs_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2818,7 +2818,7 @@ impl Cage {
/// ### Description
///
/// `access_syscall` checks the accessibility of the file specified by
/// `path` according to the given `amode`. The assmption while running this
/// `path` according to the given `amode`. The assumption while running this
/// command is that the current user owns the file.
///
/// ### Arguments
Expand Down Expand Up @@ -2857,6 +2857,11 @@ impl Cage {

//Walk the file tree to get inode from path
if let Some(inodenum) = metawalk(truepath.as_path()) {
// if we just want to check if the file exists or not (amode = F_OK)
if amode & F_OK == F_OK {
return 0;
}

// will not panic since check for existence in table already happened in
// metawalk
let inodeobj = FS_METADATA.inodetable.get(&inodenum).unwrap();
Expand Down

0 comments on commit 90de503

Please sign in to comment.