Skip to content

chmod_syscall() updates#275

Merged
rennergade merged 14 commits intodevelopfrom
vlad_chmod
Jun 25, 2024
Merged

chmod_syscall() updates#275
rennergade merged 14 commits intodevelopfrom
vlad_chmod

Conversation

@ve1nard
Copy link
Copy Markdown
Contributor

@ve1nard ve1nard commented Jun 22, 2024

Description

Fixes # (issue)

The following changes include more elaborate comments and new unit tests for chmod_syscall and fchmod_syscall.

Type of change

  • More detailed comments for chmod_syscall and fchmod_syscall
  • Shifted checking the validity of mode bits from chmod_syscall() to the _chmod_helper() helper function since it used by both chmod_syscall() and fchmod_syscall()
  • Removed the unnecessary check for file type flags that allowed the file type to be changed
  • New unit tests for chmod_syscall and fchmod_syscall

How Has This Been Tested?

To run the tests, we need to run cargo test --lib command inside the safeposix-rust directory.

All the tests are present under this directory: lind_project/src/safeposix-rust/src/tests/fs_tests.rs

  • Test A - lut_lind_fs_chmod_valid_args()
  • Test B - ut_lind_fs_chmod_invalid_args()
  • Test C - ut_lind_fs_fchmod()

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-glibc, lind-project)

@JustinCappos
Copy link
Copy Markdown
Member

JustinCappos commented Jun 23, 2024 via email

Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
@qianxichen233
Copy link
Copy Markdown
Contributor

qianxichen233 commented Jun 24, 2024 via email

@ve1nard ve1nard requested a review from qianxichen233 June 24, 2024 02:34
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs
@ve1nard ve1nard requested a review from yashaswi2000 June 24, 2024 17:19
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
@ve1nard ve1nard removed the request for review from qianxichen233 June 25, 2024 16:13
@namanlalitnyu
Copy link
Copy Markdown
Contributor

LGTM!

Comment thread src/safeposix/syscalls/fs_calls.rs Outdated
@ve1nard ve1nard requested a review from yashaswi2000 June 25, 2024 17:37
Copy link
Copy Markdown
Contributor

@rennergade rennergade left a comment

Choose a reason for hiding this comment

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

This is a really good PR. All the comments are relevant and informative.

Approved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants