Skip to content

chmod -R -L: the path is lost for a dangling symlink below the operand #16152

Open

Description

@eylulseyit

With -R -L, a dangling symlink inside the tree is reported without its name:

$ mkdir d; ln -s missing d/dang
$ chmod -R -L 755 d

GNU (9.10):

chmod: cannot operate on dangling symlink 'd/dang'

uutils (main):

chmod: No such file or directory

With -v, GNU also prints 'd/dang' could not be accessed after the error; uutils prints nothing.

In safe_traverse_dir (src/uu/chmod/src/chmod.rs), when metadata_at fails, only the PermissionDenied case gets the entry path; other errors go through err.into() without it.

For a dangling symlink given as the operand itself, chmod already prints the GNU error; its -v line is covered by #15883.

Found by @fixfon while reviewing #15935.

Activity

  1. a7604 commented on Nov 3, 2026

    @a7604
    Contributor

    hi i would like to work on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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