Files
coreutils/tests/chcon
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
..
2026-01-01 10:56:16 -08:00