coreutils
coreutils copied to clipboard
chmod: -R with dangling symlink does not error
Does not show error when running chmod -R with an empty symlink.
Fixes #7214
GNU testsuite comparison:
Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Thanks for your PR!
I think it is only a partial solution: while uutils chmod no longer shows an error message it still fails whereas GNU chmod doesn't:
$ ln -s non_existing dangling_symlink
$ chmod 755 --no-dereference -R -P dangling_symlink
$ echo $?
0
$ cargo run --features=unix -q chmod 755 --no-dereference -R -P dangling_symlink
$ echo $?
1
Plus the test passes even without applying the changes to chmod.rs.
My suggestion is to start with a failing test and then make it pass with a fix.