8000 chmod: Fix chmod -c --reference reporting when no change is made by mtimaN · Pull Request #6016 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chmod: Fix chmod -c --reference reporting when no change is made #6016

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

Merged
merged 5 commits into from
Feb 26, 2024

Conversation

mtimaN
Copy link
Contributor
@mtimaN mtimaN commented Feb 25, 2024

Fix for issue #6009.
I changed the code so that the old permission octal is retrieved in "full form" (6 octal digits). It is afterwards set to 4 digits when displayed.

Beforehand, 2 identical permissions were marked as different because of the different formats, resulting in incorrect displays for -c.

@mtimaN mtimaN changed the title Make fperm hold 6 digit octal permission. Set it to 4 digits when displaying. chmod: make fperm hold 6 digit octal permission. Set it to 4 digits when displaying. Feb 25, 2024
@BenWiederhake
Copy link
Collaborator

Is it possible to add a test for this? :)

@mtimaN mtimaN changed the title chmod: make fperm hold 6 digit octal permission. Set it to 4 digits when displaying. chmod: Fix chmod -c --reference reporting when no change is made Feb 25, 2024
@cakebaker cakebaker linked an issue Feb 25, 2024 that may be closed by this pull request
@mtimaN
Copy link
Contributor Author
mtimaN commented Feb 25, 2024

@BenWiederhake yep! It also failed a test beforehand so I kind of flipped the logic: made the reference permission 4 octals long, just as the others.

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker merged commit 095eced into uutils:main Feb 26, 2024
@cakebaker
Copy link
Contributor

Thanks for your PR!

@mtimaN mtimaN deleted the chmod_changes branch February 26, 2024 10:02
ysthakur pushed a commit to ysthakur/coreutils that referenced this pull request Feb 27, 2024
…ils#6016)

* Make fperm hold 6 digit octal permission. Set it to 4 digits when displaying

* Add test

* Make every permission 4 octal digits

* Change test name to be more suggestive

* chmod: merge two args in test

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
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.

chmod: -c reports changes even on no-op
3 participants
0