Skip to content

Commit

Permalink
added BUG comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-bhatt committed Aug 8, 2024
1 parent 90de503 commit bfa0f9f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/safeposix/syscalls/fs_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2857,10 +2857,8 @@ 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;
}
// BUG: We don't support F_OK as a valid amode flag, which when passed we need
// to check only whether the file exists or not

// will not panic since check for existence in table already happened in
// metawalk
Expand Down Expand Up @@ -4758,6 +4756,10 @@ impl Cage {
// make sure file is not moved to another dir
// get inodenum for parent of new path
let (_, new_par_inodenum) = metawalkandparent(true_newpath.as_path());

// BUG: the rename according to the spec supports moving of files from one
// parent to another, so the below behavior is not as per spec

// check if old and new paths share parent
// if they don't, then that is not allowed
if new_par_inodenum != Some(parent_inodenum) {
Expand Down

0 comments on commit bfa0f9f

Please sign in to comment.