-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Change default umask
from 777
to 027
#22589
base: main
Are you sure you want to change the base?
Conversation
Thanks @sbc100 for taking a look at the PR 🙇 ! It's my first attempt to add unit tests to the repository, so bear with me for any mistakes 😅 . |
Thanks for your contribution! Much appreciated. |
Btw, I picked the value |
} | ||
|
||
int main() { | ||
signal(SIGABRT, cleanup); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this line, along with the cleanup function?
|
||
int main() { | ||
signal(SIGABRT, cleanup); | ||
test(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I guess you might as well inline the test into main
since that is all it contains now.
@also_with_wasmfs | ||
def test_umask(self): | ||
self.set_setting("FORCE_FILESYSTEM") | ||
self.do_runf('stat/test_umask.c', 'success') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this test into test/other
? And then use do_other_test
to run it? You can run it with --rebase
to generate the expected output.
// Get the default umask | ||
mode_t default_umask = get_umask(); | ||
printf("default umask: %o\n", default_umask); | ||
assert(default_umask == 027); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think making the default 022 makes sense yes.
Addresses #17269.
This PR follows the approach made in #17270, but also includes a unit test to cover
umask
functionality.