coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

chmod: Extra verbosity for symlink creation is wrong

Open dmatos2012 opened this issue 2 years ago • 0 comments

MRE

>touch a
>ln -s a b
rm a

Produces different output

uu_chmod u+x b
failed to change mode of 'b' from 0000 (---------) to 0000 (---------)
./target/debug/chmod: cannot operate on dangling symlink 'b'

GNU

chmod u+x b
chmod: cannot operate on dangling symlink 'b'

However, if the --verbose flag is used, then the messages match , but still the uu_chmod is wrong, as :

uu_chmod u+x --verbose b
failed to change mode of 'b' from 0000 (---------) to 0000 (---------)
./target/debug/chmod: cannot operate on dangling symlink 'b'

GNU

chmod u+x --verbose b
chmod: cannot operate on dangling symlink 'b'
failed to change mode of 'b' from 0000 (---------) to 1500 (r-x-----T)

Notice the r-x-----T and the 1500, whereas uu_chmod has a hardcoded failure message(for mode) Introduced in #1967

dmatos2012 avatar Feb 16 '23 22:02 dmatos2012