Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ut_lind_fs_mkdir_invalid_modebits #43

Merged
merged 34 commits into from
Oct 23, 2024
Merged
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8368098
change to latest fdtables
Yaxuan-w Sep 16, 2024
11ad01e
using newest fdtables
Yaxuan-w Sep 16, 2024
36edba7
mmap debug
Yaxuan-w Sep 16, 2024
5c0279b
mmap debug
Yaxuan-w Sep 16, 2024
5dd1db2
mmap debug
Yaxuan-w Sep 16, 2024
563f581
porting test suite
Yaxuan-w Sep 17, 2024
80d87b8
porting test suite
Yaxuan-w Sep 17, 2024
323c394
Add more detailed comments
Yaxuan-w Sep 19, 2024
255b216
Fix directory cleanup issue in ut_lind_fs_mmap_invalid_flags_both tes…
ChinmayShringi Sep 19, 2024
f80e5b1
fix: test case ut-lind-fs-fchdir-invalid-args
Sep 23, 2024
7da2f39
Merge pull request #23 from Lind-Project/fix-ut-lind-fs-fchdir-invali…
rennergade Sep 23, 2024
adca652
Fix out-of-range file descriptor error in `getdents` syscall (#17)
ChinmayShringi Sep 23, 2024
26e41f0
Fix `getcwd_syscall` to Handle Invalid Arguments and Correctly Set `e…
ChinmayShringi Sep 23, 2024
f284122
Fix mmap test case to handle invalid flags scenario correctly (#18)
ChinmayShringi Sep 23, 2024
e1fde15
Fix Test `ut_lind_fs_pread_from_directory` from Directory to Return C…
ChinmayShringi Sep 26, 2024
c9f0ea0
fix: test case ut-lind-fs-write-to-directory (#19)
ChinmayShringi Sep 27, 2024
16771ea
fix: ut-lind-fs-simple (#21)
ChinmayShringi Sep 27, 2024
395f8c6
Fix `ut_lind_fs_rmdir_nowriteperm_parent_dir` rmdir Nowrite Permissio…
ChinmayShringi Sep 27, 2024
0169e4e
Fix ut lind fs mkdir nonexisting directory (#25)
ChinmayShringi Sep 27, 2024
faeeafb
Fix EISDIR Error in `ut_lind_fs_getdents_bufsize_too_small` Test by A…
ChinmayShringi Sep 27, 2024
197b681
Fix EEXIST Error in `ut_lind_fs_close_directory` Test by Removing Exi…
ChinmayShringi Sep 27, 2024
28a3346
Fix EEXIST Error in `ut_lind_fs_dir_multiple` Test by Removing Existi…
ChinmayShringi Sep 27, 2024
215463e
Fix EEXIST Error in `ut_lind_fs_dir_mode` Test by Removing Existing D…
ChinmayShringi Sep 27, 2024
3cb39be
Fix EEXIST Error in `ut_lind_fs_unlink_directory` (#34)
ChinmayShringi Sep 28, 2024
f408200
fix: test case ut_lind_fs_rmdir_nonexist_dir (#36)
ChinmayShringi Sep 28, 2024
799a8a4
fix: test case ut_lind_fs_rmdir_nonempty_dir (#37)
ChinmayShringi Sep 28, 2024
b3cf1bb
fix: test case ut_lind_fs_link_directory (#38)
ChinmayShringi Sep 28, 2024
71d4129
fix: test case ut_lind_fs_read_from_directory (#39)
ChinmayShringi Sep 28, 2024
c245167
fix: test case ut_lind_fs_rename (#41)
ChinmayShringi Sep 28, 2024
98fedea
Fix in `ut_lind_fs_tmp_file_test` ensure /tmp Directory Is Properly S…
ChinmayShringi Sep 28, 2024
4f91e9b
fix: test case ut_lind_fs_mkdir_invalid_modebits
Sep 28, 2024
265637d
Squashed commit of the following:
ChinmayShringi Oct 8, 2024
0b355f5
Merge branch 'main' into fix-ut-lind-fs-mkdir-invalid-modebits
ChinmayShringi Oct 8, 2024
a0f97d2
feat: updated directory creation with libc::mkdir
Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/safeposix/syscalls/fs_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ impl Cage {
* mkdir() will return 0 when success and -1 when fail
*/
pub fn mkdir_syscall(&self, path: &str, mode: u32) -> i32 {
if (mode & !0o777) != 0 {
return syscall_error(Errno::EPERM, "mkdir", "Invalid mode bits specified");
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is currently rawposix returned in this situation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently it return a -1 value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you test with get_errno() to see the errno returned by libc::mmap?

Sth like:

let ret = libc::mmap(...)
if ret < 0 {
  println!(get_errno());
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case should be handled in rust libc as well... So we don't need those checks

// Convert data type from &str into *const i8
let relpath = normpath(convpath(path), self);
let relative_path = relpath.to_str().unwrap();
Expand Down
Loading