]> git.ipfire.org Git - thirdparty/coreutils.git/commit
chcon,chgrp,chmod,chown,du,ls: ignore missing files while traversing
authorPádraig Brady <P@draigBrady.com>
Wed, 22 Jul 2026 18:23:26 +0000 (19:23 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 24 Jul 2026 12:19:23 +0000 (13:19 +0100)
commit30866b30e2d32b7cc8e2eea3719aae995ffccbd3
tree0fc3512285334abe4c610cf95b3cf8943b03d189
parent6e812858bb8b5cc1a4c91b16502a3092ead1d72f
chcon,chgrp,chmod,chown,du,ls: ignore missing files while traversing

* src/fts-missing.h: Add helper routines to determine
if an FTS entry is skippable.  I.e., that is traversed
and not specified on the command line.
* src/chcon.c (process_file): Setup to ignore skippable files.
(change_file_context): Ignore missing files if appropriate.
* src/chmod.c (process_file): Setup to ignore skippable files.
Ignore missing files if appropriate.
(mode_changed): Ignore missing files if appropriate.
* src/chown-core.c (change_file_owner): Setup to ignore skippable files.
Ignore missing files if appropriate.
* src/du.c (process_file): Likewise.
* src/ls.c (print_dir): Ignore missing files if appropriate.
(get_link_name): Likewise.
(gobble_file): Likewise.  Also handle the dangling symlink case.
* src/system.h (ignorable_traversal_errno): Match ENOENT for missing
files.
* tests/chcon/traversal-missing.sh: A new test.
* tests/misc/traversal-missing.sh: Likewise.
* tests/local.mk: Reference the new tests.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/81444
12 files changed:
NEWS
src/chcon.c
src/chmod.c
src/chown-core.c
src/du.c
src/fts-missing.h [new file with mode: 0644]
src/local.mk
src/ls.c
src/system.h
tests/chcon/traversal-missing.sh [new file with mode: 0755]
tests/local.mk
tests/misc/traversal-missing.sh [new file with mode: 0755]