Skip to content
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

chmod: errors with -R flag on dangling link but shouldn't #7214

Open
jfinkels opened this issue Jan 26, 2025 · 0 comments
Open

chmod: errors with -R flag on dangling link but shouldn't #7214

jfinkels opened this issue Jan 26, 2025 · 0 comments
Labels

Comments

@jfinkels
Copy link
Collaborator

Environment: Ubuntu 24.04, uutils main branch (git commit 2430e2a), GNU coreutils v9.6.8-fbfd88-dirty

Steps to reproduce: Create a link to a file that doesn't exist and then try to change the link's permissions with the -R flag:

mkdir dir
ln -s target dangling-link  # target doesn't exist
chmod 755 --no-dereference -R -P dangling-link

What happens now: uutils chmod terminates with an error message

chmod: cannot operate on dangling symlink 'dangling-link'

What I expected to happen: GNU chmod succeeds with no output.

Notes: With both uutils and GNU, the permissions of the link itself are not actually changed, but I think that's expected for symbolic links:

$ ls -l dangling-link
lrwxrwxrwx 1 jeffrey jeffrey 6 Jan 26 10:51 dangling-link -> target

Also, the -R flag I think has no other effect in this test case, as there is no directory here to recurse into.

This is causing a failure in the GNU test file tests/chmod/symlinks.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant