* src/shred.c (wipename): Quote the names of the source and destination
when printing verbose messages for rename. Remove comment about not
needing quoting after the first message, since we still do not control
the contents of any parent directories contained in the source or
destination.
* tests/shred/verbose-quote.sh: New file.
* tests/local.mk (all_tests): Add the new test case.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-3UJ1SMSY.
Similarly to commit v9.10-115-gb3fe24213, which applied
the same quoting mechanism to --check operation,
also quote file names when generating checksums to tty.
This change gives these advantages:
1. Avoids dumping arbitrary data to vulnerable terminals
2. Avoids visual deception with ansi codes with unknown file names
3. More secure if users copy and paste file names from output
* doc/coreutils.texi (sum invocation): Mention the tty quoting
and reference the details from ...
(cksum output modes): Describe the two forms of quoting used.
* tests/misc/tty-quoting.sh: Add test cases.
* NEWS: Mention the improvement.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-Z25BP6MW.
* doc/coreutils.texi (chroot invocation): State that --userspace and
--groups do not provide any real extra protection when working with
untrusted chroots.
* src/chroot.c (main): Copy pwd->pw_name as it can be overwritten.
* NEWS: Mention the fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-C8RRA4R8.
* src/install.c (mkancesdirs_safe_wd): Save the current working
directory when using 'strip' on files.
* tests/install/strip-program.sh: Add two test cases.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-CBHGSM1T.
This fixes the following error message:
$ touch a; mv --exchange a b
mv: cannot exchange 'a' and 'b': Unknown error -1
Here is the error message after this commit:
$ touch a; ./src/mv --exchange a b
mv: cannot exchange 'a' and 'b': No such file or directory
* THANKS.in: Add Igor Giamoniano, who reported the bug.
* src/copy.c (copy_internal): Save the EEXIST errno when stat fails,
since renameat would fail for the same reason.
* tests/mv/mv-exchange.sh: Add a few test cases where the bug could be
seen.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/82186
Some file systems/device combinations reject 512-byte direct writes
with EINVAL but accept 4 KiB writes.
Try 4 KiB blocks before skipping the direct I/O test.
* tests/dd/direct.sh: Probe 512-byte blocks first and fall back to
4 KiB blocks. Use the selected input and output block sizes in each
test case, and size the short input to one byte less than a block.
Link: https://github.com/coreutils/coreutils/pull/406
* tests/shred/chmod-race.sh: Add a new test, which is
the first in the test suite to use strace to STOP a process.
* tests/local.mk: Reference the new test.
Also clarify that -C and -1 only output the file name.
* doc/coreutils.texi (General output formatting): Tweak the -C
description to emphasize that only names are output.
* src/ls.c (usage): Clarify that only names are printed with -1 and -C,
and mention which is the default depending on tty output and
which of ls,dir,vdir is in use.
Link: https://github.com/coreutils/coreutils/issues/405
This was a mistake in my commit 16a673638 (fold: move multi-byte
character reading to a module, 2025-09-28), which added the file. The
correct license is in the module description and the header file, which
contains the module's implementation.
* gl/lib/mbbuf.c: Change license header to LGPLv2+, matching the
associated header and module description.
* src/dircolors.c (syntax): New global variable.
(append_quoted): Escape '!' if we are using 'csh' syntax to prevent
history substitution.
(main): Remove the syntax variable that was made global.
* tests/misc/dircolors.pl (@Tests): Add a test case.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-SFBDLZ6V.
* src/shred.c (wipefile): When --force or --remove are in use, and the
file is in a subdirectory, open a file descriptor to its parent and
perform operations on the basename relative to it.
(wipename): Add a file descriptor argument to the parent directory. Open
a readable file descriptor to the directory if we need to sync it. Use
the file descriptor with renameatu and unlinkat.
* tests/shred/unlink-race.sh: New file.
* tests/local.mk (all_tests): Add the new test case.
* NEWS: Mention the bug fixes.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-O4Q4UVP2.
Given the FROM argument is interpreted as a different base
for --hex-suffixes and --numeric-suffixes, it makes more
sense for a previous start value to be discarded.
* doc/coreutils.texi: Mention this for --hex-suffixes,
and also mention the FROM argument is interpreted as hex.
* src/split.c (main): Just reset numeric_suffix_start,
and avoid reinterpretation validation.
* tests/split/numeric.sh: Adjust accordingly.
* NEWS: Mention the change in behavior.
When FROM contained the digits a-f, next_file_name() derived the
suffix index with c - '0', giving values up to 54 for a 16 character
alphabet. Incrementing the suffix then read past the end of the
alphabet string and used those bytes in the output file names,
e.g., 'split --hex-suffixes=f' created x0f, x0s, x0u.
* src/split.c (next_file_name): Map start value characters through
the suffix alphabet rather than assuming decimal digits.
(main): Reject a start value not valid for the final suffix alphabet,
as can happen with --hex-suffixes=a --numeric-suffixes.
(set_suffix_length): Determine width using base 16 for hex suffixes.
* tests/split/numeric.sh: Add test cases.
* NEWS: Mention the bug fix.
Link: https://github.com/coreutils/coreutils/pull/404
Also discovered by Anthropic's OSS Scanner, as bug ANT-2026-DWADVADP.
* TODO: Mention that the referenced overwriting technique was removed
from NISPOM in 2006, and that it warns against overwriting for some
storage medias.
* src/seq.c (scan_arg): Search for the locale decimal point.
Also handle uppercase 'P' in hex format floats.
(main): Recognize locale decimal point in apparent options.
* tests/seq/seq-locale.sh: Add test cases.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-ERV7HOGN.
* src/seq.c (dump_strings): Rearrange limit checks to
reduce rounding affects. Also add sanity check on
on the iteration number limit.
* tests/seq/seq-no-progress.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-RI0OLUBX.
* gnulib: Update to get commit 19e602707d (findprog-in: Use a default
PATH like POSIX specifies., 2026-11-02).
* tests/sort/sort-compress.sh: Add a test case.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-1R7RAVAG.
A single character --section-delimiter is completed with an implied ':'
by writing through section_del, which is assumed to still point at the
static DEFAULT_SECTION_DELIMITERS buffer. After an earlier -d with zero
or more than one character, section_del points at that argument instead,
so the write goes into the earlier argv string and past its end.
In a UTF-8 locale 'nl -d "" FILE -d x' corrupts the FILE operand,
and in the C locale 'nl -d foo -d x' uses the delimiter "xoo".
* src/nl.c (main): Point section_del at the static buffer before
building the single character delimiter.
* tests/nl/nl.sh, tests/nl/multibyte.sh: Add test cases.
* NEWS: Mention the bug fix.
Bug present since coreutils 9.0.
Link: https://github.com/coreutils/coreutils/pull/403
* 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>
* src/mkfifo.c: Include fcntl--.h.
(main): When a mode is specified, open a file descriptor to its parent
and use it to create the FIFO and set its mode.
* src/mknod.c: Include fcntl--.h.
(main): When a mode is specified, open a file descriptor to its parent
and use it to create the special file and set its mode.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-ACVILIMZ.
* NEWS: Mention the bug fix.
* src/od.c (dump): Don't break the look on read error.
* tests/od/od.pl: Add a test case.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-DYUIRPOE.
Link: https://github.com/coreutils/coreutils/issues/402
* src/tail.c (tail_forever_inotify): Size the buffer based on NAME_MAX
instead of the operands. Reduce the scope of some variables.
* tests/tail/inotify-long-name.sh: New file.
* tests/local.mk (all_tests): Add the new test.
* NEWS: Mention the bug fix. Adjust the reference in a previously fixed
bug to mention it was introduced with inotify support.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-S9L24ERC.
Previously, only the basenames were printed, leading to ambiguity when
multiple directories had a file with the same name. E.g., here is the
old output:
$ mkdir -p a/{b,c}
$ touch a/{b,c}/d
$ strace -o /dev/null -e inject=lsetxattr:error=EIO \
chcon -R -u root a
chcon: failed to change context of 'd' to '...': ...
chcon: failed to change context of 'b' to '...': ...
chcon: failed to change context of 'd' to '...': ...
chcon: failed to change context of 'c' to '...': ...
chcon: failed to change context of 'a' to '...': ...
Here is the new output:
$ strace -o /dev/null -e inject=lsetxattr:error=EIO \
src/chcon -R -u root a
chcon: failed to change context of 'a/b/d' to '...': ...
chcon: failed to change context of 'a/b' to '...': ...
chcon: failed to change context of 'a/c/d' to '...': ...
chcon: failed to change context of 'a/c' to '...': ...
chcon: failed to change context of 'a' to '...': ...
This also aligns the output with other programs, e.g., 'chown':
$ strace -o /dev/null -e inject=chown,fchown,fchownat:error=EIO \
chown -R root a
chown: changing ownership of 'a/b/d': ...
chown: changing ownership of 'a/b': ...
chown: changing ownership of 'a/c/d': ...
chown: changing ownership of 'a/c': ...
chown: changing ownership of 'a': ...
* src/chcon.c (change_file_context): Add an argument for the full file
name. Use it in error messages.
(process_file): Pass the full file name from the FTSENT.
* NEWS: Mention the bug fix.
Add docs and tests for the recent gnulib strftime fixes.
* tests/misc/strftime.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fixes.
Fixes https://bugs.gnu.org/82130
The fix in commit v9.12-166-gb6b06854f was incomplete.
This is now tested to pass with SHELL=/bin/dash on Debian 10
(which otherwise defaults to bash even though /bin/sh is dash).
* tests/timeout/timeout.sh: Ensure the waiting shell's stderr
is not redirected to the full pipe, so any "Killed" message
does not block things.
* src/pr.c (buff_current): Define as an idx_t instead of an int.
(line_vector): Define as an array of idx_t elements instead of int.
(store_colum): Define a variable used to set buff_current as an idx_t.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-C1YW9FO0.
* src/dd.c (main): Also account for seeking bytes in a few conditions.
* tests/dd/bytes.sh: Add a test case.
* tests/dd/fail-ftruncate-fstat.sh (fail_ftruncate_fstat): New function.
Use it to test seeking on bytes, and make sure fstat and ftruncate are
called.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-NLK8TXH1.
The sortlines algorithm note listed the test corpus as "426,4424 lines".
That looks like a mistyped thousands grouping; use 4,264,424 instead
(consistent with ~33b/line for the stated 140,213,394-byte GCC tree).
Link: https://github.com/coreutils/coreutils/pull/401
dash in all modes, or bash when not invoked in posix mode
will issue a "Terminated" message and thus block with our filled pipe,
and not fire the trap. I.e. with sh -> dash this test failed,
and sh -> bash this test passed (as bash is in POSIX mode in that case).
Interestingly this shows the shells have much the same problem
with stderr diagnostic side effects that timeout now avoids.
* tests/timeout/timeout.sh: Redirect the shell's stderr to /dev/null
so we don't care whether it outputs "Terminated" or not. Also change
all "sh -c" to "$SHELL -c" for better consistency across all tests.
* src/copy.c (copy_attr_quote): Return a xstrdup'd copy of the result of
quoteaf, so that slot 0 of quotearg can be overwritten by a subsequent
call without overwriting the previously quoted string.
(copy_attr_free): Free the string. Remove MAYBE_UNUSED from the string.
* tests/cp/xattr.sh: Add a getlimits_ and uses_strace_ invocation.
(block_setxattr): New function. Use it to check the error/warning
message when setting extended attributes on the destination fails.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-BPGHOHDX.
* src/install.c (initial_umask): New variable.
(strip): Set the umask to initial_umask before invoking 'strip' and then
reset it to zero after the child is created.
(main): Save the initial umask when setting it to zero.
* tests/install/strip-program.sh: Add a few invocations to test the
behavior.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-39LQ2UOD.
* src/printf.c (STRTOX): Add a call to quote when printing the ignored
characters.
* tests/printf/printf.sh: Adjust an existing test case. Add another
quoting test case.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-I9I24ON7.
* src/nl.c (check_section): Add a check for a zero section delimiter
length.
* tests/nl/nl.sh: Add a test case.
* NEWS: Mention the bug fix.
Discovered by Anthropic's OSS Scanner, as bug ANT-2026-PDYYNTYZ.
* src/cksum (valid_digits): Use '=' to disambiguate hex and base64.
(split_3): Likewise.
(digest_check): Likewise.
* tests/cksum/cksum-base64-untagged.sh: Add a test case.
* NEWS: Mention the fix.
* src/cksum.c (digest_check): Reset the detection flag per file.
* tests/cksum/cksum-c.sh: Add a test case.
* tests/cksum/md5sum-bsd.sh: Likwise.
* NEWS: Mention the fix.