coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

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

Open mtimaN opened this issue 1 year ago • 3 comments

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 avatar Feb 25 '24 16:02 mtimaN

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

BenWiederhake avatar Feb 25 '24 16:02 BenWiederhake

@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.

mtimaN avatar Feb 25 '24 16:02 mtimaN

GNU testsuite comparison:

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

github-actions[bot] avatar Feb 25 '24 17:02 github-actions[bot]

Thanks for your PR!

cakebaker avatar Feb 26 '24 10:02 cakebaker