-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
mkfifo: Fix path-based chmod race #10020 #10052
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
base: main
Are you sure you want to change the base?
Conversation
c7f5277 to
003e34e
Compare
|
GNU testsuite comparison: |
f640c78 to
36253b5
Compare
|
GNU testsuite comparison: |
| if let Err(e) = fs::set_permissions(&f, fs::Permissions::from_mode(mode)) { | ||
| return Err(USimpleError::new( | ||
| 1, | ||
| translate!("mkfifo-error-cannot-set-permissions", "path" => f.quote(), "error" => e), |
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 we want to keep the error display here, no ?
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.
Yes you are right, we can check errno to see if we cannot set permissions, since permissions are set by mkfifo now.
36253b5 to
36c1a2f
Compare
|
GNU testsuite comparison: |
36c1a2f to
7845e90
Compare
|
GNU testsuite comparison: |
Fixes #10020
std::fs::set_permissionsmode is passed directly tolibc::mkfifotest_create_fifo_permission_deniedexpecting a "permission denied" error since there is no longer a separate step in setting permissionsumaskwhich is applied automatically withmkfifo, withoutstd::fs::set_permissionswe temporarily setumaskto 0.