* bootstrap.conf (gnulib_modules): Add execvp which as a different
prototype on Windows along with other issues mentioned in the Gnulib
manual.
* src/nohup.c (main): Check if SIGHUP is defined.
This should not affect programatic parsing, because if you have to parse
the shell style, then the same logic will parse unescaped output.
This is a better default now that --terse uses quoted format by default,
and also the default output format quotes file names by default.
* src/stat.c (getenv_quoting_style): Change the default.
%N also outputs the target of a symlink
so support %Qn to give more control over quoted names.
* src/stat.c (print_it): Validate %Qn.
(print_stat): Output quoted file name with %Qn.
(usage): Add %Qn description.
* doc/coreutils.texi (stat invocation): Likewise.
* tests/stat/stat-fmt.sh: Add a test case.
This is safer to output to terminal with malicious file names,
with multiple lines or control characters etc.
* src/stat.c: Quote the file name in the default output format
in the default quoting style, or as selected with QUOTING_STYLE.
Reported by Michał Majchrowicz and Marcin Wyczechowski.
The previous commit is not sufficient to fix the race,
since I forgot shred now opens with O_NONBLOCK, and so cat may
not be even reading by the time shred's open() returns.
* tests/shred/fifo.sh: Put more robust synchronization in place
along the lines of what we did in commit v9.11-47-ga6ba6a23a,
using a separate fifo_writer_ to ensure the cat is reading,
before shred runs.
A fixed-offset keyword such as 'UTC' must anchor the instant before
relative items are applied, so that '1970-01-01 UTC N seconds' is
exactly N seconds past the epoch even when the local zone observes
DST between the epoch and the result.
* tests/date/date-tz.sh: Add a relative-seconds-across-DST case.
https://github.com/coreutils/coreutils/pull/275
With -L, a recursive chmod/chown follows symlinks while descending;
a symlink pointing back to an ancestor forms a cycle that must be
detected and not descended into forever.
* tests/chmod/symlinks.sh: Add a symlink-cycle case for chmod -RL.
* tests/chown/deref.sh: Likewise for chown -RL.
https://github.com/coreutils/coreutils/pull/274
* tests/chown/basic.sh: Add a case ensuring that "chown
--no-dereference" on a symlink to a directory operates on the link
itself and does not dereference it to change the owner of the target
directory.
https://github.com/coreutils/coreutils/pull/272
We currently prefer the 'tty: link' style for representing URIs
in man pages, as this falls back to _not_ displaying the URI
where not supported, whereas the .UR macro generally does fall back
to showing the URI, which has these disadvantages:
- They're long, redundant, and interfere when reading text
- With wrapping enabled with \: in the URI, it can become unclickable
- Without wrapping enabled it interferes in adjacent text justification
Note with groff >= 1.24 (March 2026), the .UR macro results
in OSC 8 hyperlinks being used, and thus the awkward URI is not
displayed.
* man/viewman: Configure groff 1.23 to display .UR macros
with OSC 8 hyperlinks.
See: https://lists.gnu.org/r/coreutils/2026-05/msg00080.html
* tests/sort/sort-merge.pl: Add 'long-lines' case ensuring that
merging input whose lines exceed the read buffer does not split
lines on buffer boundaries.
https://github.com/coreutils/coreutils/pull/270
The default shell-escape quoting style escapes control characters in
file names (e.g. newlines) as $'...' sequences, but no test exercised
this; only the single-quote character was covered.
referenced here: https://github.com/uutils/coreutils/issues/9925
* tests/stat/stat-fmt.sh: Add a case with a file name containing
contiguous and separated newlines.
https://github.com/coreutils/coreutils/pull/271
This patch only improves some error messages. Here is the behavior
before the patch:
$ printenv -i
Try 'printenv --help' for more information.
$ printenv -u
printenv: option requires an argument -- 'u'
Try 'printenv --help' for more information.
$ printenv -u a
Try 'printenv --help' for more information.
Here is the behavior after:
$ ./src/printenv -i
./src/printenv: invalid option -- 'i'
Try './src/printenv --help' for more information.
$ ./src/printenv -u
./src/printenv: invalid option -- 'u'
Try './src/printenv --help' for more information.
$ ./src/printenv -u a
./src/printenv: invalid option -- 'u'
Try './src/printenv --help' for more information.
* src/printenv.c (main): Remove 'i' and 'u' from the short options given
to getopt_long.
* src/tail.c (write_header): Use quotef() to quote
file names when needed.
* src/head.c (write_header): Likewise.
* tests/head/quote-headers.sh: Add a new test.
* tests/tail/quote-headers.sh: Add a new test.
* tests/local.mk: Reference the new test.
Reported by Michał Majchrowicz.
This fixes an issue in unreleased commit f77f365ef (shred: don't block
when opening FIFOs with no readers, 2026-05-09).
* src/shred.c: Save the errno before calling stat and use it in the
error message.
* tests/shred/fifo.sh: Call getlimits_ and uses_strace_. Add a test
case.
* tests/tee/short-write.sh: Check that all the required strace
options are supported, which is not the case with strace 5.10 at least.
* tests/tee/write-eagain.sh: Likewise.
* NEWS: Mention the bug fixes.
* THANKS.in: Add Bernhard M. Wiedemann for reporting the bugs.
* src/iopoll.c (close_wait): Remove function.
(write_wait): Don't call wait_for_nonblocking_write if write is
successful. Handle errors more robustly.
* src/iopoll.h (close_wait): Remove declaration.
* src/tee.c (tee_files): Use close instead of close_wait.
* tests/tee/short-write.sh: New test for the bug.
* tests/tee/write-eagain.sh: Likewise.
* tests/local.mk (all_tests): Add the new tests.
Fixes https://bugs.gnu.org/81060
This test failure was seen on NetBSD 10.0 machine, where ulimit failed
with EINVAL.
* tests/dd/bytes.sh: Don't fail the test case if ulimit fails.
Reported by Bruno Haible.
The only use of this header was removed in commit d52092958 (chroot:
call chroot() unconditionally to handle bind mounted "/", 2014-10-15).
* src/chroot.c: Don't include root-dev-ino.h.
The only use of this header was removed in commit 97d8dcc5c (basenc:
prefer signed to unsigned integers, 2021-08-27).
* src/basenc.c: Don't include xdectoint.h.
It has not been needed since commit 9fd2c631b (Remove all uses of
signals; modern hosts have /dev/random and don't need this gorp.,
2005-04-09).
* src/shred.c: Don't include setjmp.h.
* src/shred.c (usage): Mention the behavior of 'shred' on FIFOs,
sockets, and terminals.
* doc/coreutils.texi (shred invocation): Likewise.
Addresses https://bugs.gnu.org/30177
This mostly either removes casts if they are always no-ops, or
replaces casts (TYPE)(EXPR) with compound literals (TYPE){EXPR}.
Compound literals are a bit safer anyway, as casts are too
powerful in C.
* src/cksum_avx2.c (cksum_avx2):
* src/cksum_avx512.c (cksum_avx512):
* src/cksum_crc.c (cksum_slice8):
* src/cksum_pclmul.c (cksum_pclmul):
* src/cp-hash.c (remember_copied):
* src/numfmt.c (simple_strtod_float):
* src/system.h (x_timestyle_match):
Omit no-op casts.
* src/cp-hash.c (src_to_dest_hash):
* src/dd.c (dd_copy):
* src/df.c (devlist_hash):
* src/env.c (splitbuf_append_byte):
* src/getlimits.c (print_int, main):
* src/ls.c (dev_ino_hash):
* src/truncate.c (do_ftruncate):
Replace casts with compound literals.
* src/factor.c: Ignore -Wuseless-cast, as we include the imported
longlong.h file, which has many of them.
* src/numfmt.c (powerld): 2nd arg is now ptrdiff_t, not int, so
that integers are not silently mishandled in outlandish cases.