Repository navigation
Conversation
sylvestre
reviewed
Nov 19, 2026
| traverse_symlinks, | ||
| dereference, | ||
| #[cfg(not(target_os = "redox"))] | ||
| dereference_in_tree: dereference |
Contributor
There was a problem hiding this comment.
do we need dereference && here? --dereference already implies it
Author
There was a problem hiding this comment.
You're right, it's not needed. configure_symlink_and_recursion already returns true when --dereference is given. Dropped it.
|
GNU testsuite comparison: |
When --dereference is given, chmod -R also changes the referent of each symlink found while recursing, without descending into it (only -L does that). A link that cannot be followed is reported as "cannot dereference", and a link to / is refused under --preserve-root. This was compared with the GNU chmod binary. Plain -R still leaves such links alone. The ignored test for this created its link with symlink_file(), which prefixes the fixture path to "../target" and leaves the link dangling. Use relative_symlink_file() and enable the test. Closes uutils#16505
aozmekik
force-pushed
the
chmod-dereference-in-tree
branch
from
November 20, 2026 07:12
abb99f2 to
02e459a
Compare
Contributor
|
a bunch of jobs are failing |
Author
|
I looked at them, they don't seem related to chmod. The two Build jobs fail in test_tail ( |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
--dereference,chmod -Rnow changes the referent of each symlink it meets while recursing, without descending into it (that is still-L). A link that can't be followed is reported ascannot dereference 'x': ...and chmod exits 1, and under--preserve-roota link to/is refused instead of skipped silently. Plain-R,-H,-hand-Pbehave as before.I compared this with the GNU chmod 9.12 binary on trees with links to files and directories inside and outside the tree, a dangling link, a loop and a link to
/, under-R,--dereference,-h,-H,-L,-Pand--preserve-root. The--dereferencecases now match. One difference is left on purpose: after refusing a link to/, GNU also skips the next entry in that directory, which looks like a bug there.The ignored test from #16493 made its link with
symlink_file, which prefixes the fixture path to../targetand leaves the link dangling. It now usesrelative_symlink_fileand runs.Closes #16505