Repository navigation
chmod: fix EROFS showing as Permission denied - #12200
Conversation
|
GNU testsuite comparison: |
|
looks good but could you please add a test to make sure we don't regress |
|
Thanks for the suggestion! Also planning a follow-up PR to fix another problem regarding error reporting, should that include tests as well? |
68eb7ed to
d003ce2
Compare
|
I've rebased the PR and added a regression test using a read-only filesystem. It exercises the recursive The Android CI failure appears unrelated to this PR, as it failed during emulator setup due to a Termux package download error (HTTP 522), before the tests ran. |
d003ce2 to
6845941
Compare
|
Thank you for your PR ! |
|
@gabrielhnf In the future, please rebase to keep the commit history clean, avoiding separate commits for fixes. This helps keep |
|
Ah, got it. My bad, I'll keep that in mind for future PRs. Thanks for pointing it out! |
Fixes #12196
Problem
When running
chmod -Ron a read-only filesystem, uutils was reporting:Instead of the correct:
Cause
safe_chmod_filewas hardcodingChmodError::PermissionDeniedregardless of the actual error returned by the OS, discarding the real error kind.Fix
Map
ErrorKind::ReadOnlyFilesystemto a newChmodError::ReadOnlyFileSystemvariant with the correct message, consistent with GNU coreutils behavior.