Skip to content

chmod: -L option fails to traverse symlinks #7023

@jfinkels

Description

@jfinkels

Environment: uutils main branch (git commit dddbc17), gnu coreutils version 9.5.218-7e5b6

Steps to reproduce:

# Create a file at `a/b/file` and a link to it at `a/c/link`.
mkdir -p a/b a/c
touch a/b/file
ln -s ../b/file a/c/link

# Explicitly set the permissions to start from.
chmod =777 a/b a/c a/b/file

# Set the new permissions.
chmod 755 -L -R a/c

What happens now: with uutils chmod, the permissions of the target of the symbolic link have not been changed:

$ ls -ld a/b/file
-rwxrwxrwx 1 jeffrey jeffrey 0 Dec 29 14:32 a/b/file

What I expected to happen: in GNU chmod, the permissions of the target are changed:

$ ls -ld a/b/file
-rwxr-xr-x 1 jeffrey jeffrey 0 Dec 29 14:32 a/b/file

Notes: this is causing a failure in the tests/chmod/symlinks.sh file in the GNU test suite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions