Skip to content

ls, du, chmod, chown, chgrp: an entry removed during traversal is reported as an error #16644

Open

Description

@sylvestre

When an entry disappears while ls, du, chmod, chown or chgrp walks a directory, uutils reports an error. GNU 9.12 silently skips it (other errors like EIO are still reported by both).

$ mkdir tree && touch tree/gone.txt && cd tree
$ strace -qq -o /dev/null -P gone.txt -e inject=chmod,fchmodat,fchmodat2:error=ENOENT chmod -R 0750 .; echo $?

uutils:

chmod: changing permissions of './gone.txt': No such file or directory
1

GNU 9.12: no output, 0.

Same with ls -l . / du -a . (inject ENOENT on stat,lstat,newfstatat,statx) and chown -R / chgrp -R (inject on chown,lchown,fchownat).

GNU test: bash util/build-gnu.sh && bash util/run-gnu-test.sh tests/misc/traversal-missing.sh

Part of #14705

Activity

  1. lunatic1hero commented on Nov 18, 2026

    @lunatic1hero

    Hi, I'd like to work on this. I'll start with chmod -R (the reproduction in the issue) and , if the fix is clean, follow up with chown/chgrp, then ls/du in separate PRs. Is that okay?

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions