-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
print_numeric: print mode in octal when the mode is too large #10208
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
This was caught when testing chmod inside of Redox OS. Previously, doing `chmod 10777 file` will cause an error stating that "mode is too large (4607 > 7777", which is both incorrect and contains a missing parenthesis. We now print the large octal value in terms of octal.
|
GNU testsuite comparison: |
|
could you please add a test to make sure we don't regress in the future? thanks |
|
Heres an example test for this scenario for chmod that you can use in test_chmod: |
I had something similar, I have just been really busy. I am a university student. |
|
The test case results in this: |
CodSpeed Performance ReportMerging this PR will improve performance by 4.01%Comparing Summary
Performance Changes
Footnotes
|
|
So the OpenBSD CI is failing because 7777 is considered to be in invalid value: Which is This gets triggered because:
They are aware of this, see https://github.com/openbsd/src/blob/8105fbd98be243a48cc198cd0c33d8bce8095608/regress/lib/libc/sys/t_mkfifo.c#L225-L229 |
| // spell-checker:disable-next-line | ||
| "chmod: mode is too large (10000 > 7777)\n", | ||
| ); | ||
| scenario.ucmd().args(&["7777", "file"]).succeeds(); |
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.
My understanding is that the BSD error is only coming from this line, it should be okay to disable this specifically for BSD or do something like this:
// Use a directory for 7777 test since sticky bit (0o1000) on files requires root on BSD systems
at.mkdir("dir");
scenario.ucmd().args(&["7777", "dir"]).succeeds();
No description provided.