Skip to content

Commit

Permalink
fix: test case ut_lind_fs_link_invalid_path_permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
lind committed Oct 23, 2024
1 parent 45f5927 commit 41c2678
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/tests/fs_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,8 @@ pub mod fs_tests {

// Create the directory for the oldpath with the parent not having read
// permission. Currently assigning "Write only" permissions
// Remove the directory if it already exists
let _ = cage.rmdir_syscall("/invalidtestdir");
assert_eq!(cage.mkdir_syscall("/invalidtestdir", 0o200), 0);
assert_eq!(
cage.open_syscall(oldpath, O_CREAT | O_EXCL | O_WRONLY, 0o200),
Expand All @@ -1777,7 +1779,8 @@ pub mod fs_tests {
cage.link_syscall(oldpath, newpath),
-(Errno::EACCES as i32)
);

// Cleanup the directory to ensure clean environment
assert_eq!(cage.rmdir_syscall("/invalidtestdir"), 0);
assert_eq!(cage.exit_syscall(libc::EXIT_SUCCESS), libc::EXIT_SUCCESS);
lindrustfinalize();
}
Expand Down

0 comments on commit 41c2678

Please sign in to comment.