Commit Graph
7 Commits
Author SHA1 Message Date
Collin Funk 2a27d71fc0 tests: make strace also inject openat2
* init.cfg (get_open_syscalls_): New function based on
get_stat_syscalls_.
* tests/chcon/traversal-missing.sh: Use it.
* tests/shred/chmod-race.sh: Use it.
* tests/shred/fifo.sh: Use it.
2026-11-16 15:36:09 -08:00
Collin FunkandPádraig Brady e018661bd9 chcon: avoid a race when partial contexts are specified
* src/chcon.c: Include fcntl--.h.
(change_file_context): Open a file descriptor when only a partial
context is specified. Use it to get and subsequently set the file
context, instead of using getfileconat followed by setfileconat, if
libselinux supports it on a file descriptor opened with O_PATH.
* tests/chcon/traversal-missing.sh: Adjust the test using partial
contexts to also inject open and openat errors. Add a test for complete
contexts.
* NEWS: Mention the bug fix.

Discovered by Anthropic's OSS Scanner, as bug ANT-2026-9PFL6OLT.

Co-authored-by: Pádraig Brady <P@draigBrady.com>
2026-11-01 19:26:16 -08:00
Pádraig Brady 30866b30e2 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
2026-07-24 13:19:23 +01:00
Collin Funk 73d3a49f45 maint: run 'make update-copyright' 2026-01-01 10:56:16 -08:00
Pádraig Brady 28b176085f maint: update all copyright year number ranges
Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...

* gnulib: Update included in this commit as copyright years
are the only change from the previous gnulib commit.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Likewise.
* tests/sample-test: Adjust to use the single most recent year.
2025-01-01 09:33:08 +00:00
Pádraig Brady a966dcdb69 maint: update all copyright year number ranges
Update to latest gnulib with new copyright year.
Run "make update-copyright" and then...

* gnulib: Update included in this commit as copyright years
are the only change from the previous gnulib commit.
* tests/init.sh: Sync with gnulib to pick up copyright year.
* bootstrap: Manually update copyright year,
until we fully sync with gnulib at a later stage.
* tests/sample-test: Adjust to use the single most recent year.
2024-01-01 13:27:23 +00:00
Sylvestre Ledru 15925d0e5b tests: move tests to a directory per utility
* cfg.mk: Adjust syntax check exclusion paths.
* tests/local.mk: Adjust for renamed tests.
2023-06-19 13:12:37 +01:00