]> git.ipfire.org Git - thirdparty/coreutils.git/log
thirdparty/coreutils.git
3 months agotests: env.sh: avoid multi-call binary considerations
oech3 [Sun, 18 Jan 2026 20:38:15 +0000 (05:38 +0900)] 
tests: env.sh: avoid multi-call binary considerations

A simpler fix than commit v9.9-4-g3b6efd555
which is less dependent on the exact behavior
of a multi-call binary.

* tests/env/env.sh: Use a local script rather than 'true'.
which may be a symlinked multi-call binary.
https://github.com/coreutils/coreutils/pull/174

3 months agodoc: post process html with non-GNU make programs
Collin Funk [Sun, 18 Jan 2026 05:23:15 +0000 (21:23 -0800)] 
doc: post process html with non-GNU make programs

* .gitignore (/build-aux/makeinfo-wrapper.sh):
* Makefile.am (EXTRA_DIST): Remove build-aux/makeinfo-wrapper.sh.
* build-aux/makeinfo-wrapper.sh.in: New file, renamed from
build-aux/makeinfo-wrapper.sh and modified to use @MAKEINFO@ instead of
makeinfo.
* cfg.mk (MAKEINFO): Remove variable.
* configure.ac: Add build-aux/makeinfo-wrapper.sh as a configure file.
* doc/local.mk (MAKEINFO): Define to
$(abs_top_builddir)/build-aux/makeinfo-wrapper.sh.
(AM_MAKEINFOFLAGS): Move over some values from the previous MAKEINFO
definition.

3 months agotests: strace: consider splice a "read" syscall
Pádraig Brady [Sun, 18 Jan 2026 16:56:24 +0000 (16:56 +0000)] 
tests: strace: consider splice a "read" syscall

* tests/cksum/cksum-c.sh: Add 'splice' to the injection set.
* tests/misc/read-errors.sh: Likewise.
From https://github.com/coreutils/coreutils/pull/167

3 months agomaint: prefer NULL to nullptr
Pádraig Brady [Sun, 18 Jan 2026 15:55:38 +0000 (15:55 +0000)] 
maint: prefer NULL to nullptr

NULL is best for C as discussed at:
https://bugs.gnu.org/66221#53

* bootstrap.conf: Remove dependency on nullptr.
* s/nullptr/NULL/.

3 months agodoc: add more redirections from legacy *sum to cksum
Pádraig Brady [Sun, 18 Jan 2026 13:35:17 +0000 (13:35 +0000)] 
doc: add more redirections from legacy *sum to cksum

*  doc/coreutils.texi (md5sum invocation, sha1sum invocation,
b2sum invocation, sha2 utilities): Mention these are legacy interfaces,
and reference 'cksum invocation'.
*  src/cksum.c (usage): Likewise.
*  man/md5sum.x: Redirect to cksum, rather than individual utils.
*  man/sha1sum.x: Likewise.

3 months agotests: use `command -v` to identify binary
Pádraig Brady [Sun, 18 Jan 2026 12:48:36 +0000 (12:48 +0000)] 
tests: use `command -v` to identify binary

* tests/misc/coreutils.sh: Be more flexibile by using `command -v`
to identify the binary to be executed, rather than linking
directly to the built binary.

3 months agobuild: fix error building html documentation from tarball
Collin Funk [Sun, 18 Jan 2026 04:09:52 +0000 (20:09 -0800)] 
build: fix error building html documentation from tarball

Reported by Egmont Koblinger <egmont@gmail.com> in
<https://lists.gnu.org/r/coreutils/2026-01/msg00111.html>.

* Makefile.am (EXTRA_DIST): Add build-aux/makeinfo-wrapper.sh.

3 months agotests: avoid a test hang on AIX
Collin Funk [Sat, 17 Jan 2026 22:26:26 +0000 (14:26 -0800)] 
tests: avoid a test hang on AIX

* init.cfg (uses_strace_): New function.
(require_strace_): Use it.
tests/cksum/cksum-c.sh: Likewise.
tests/misc/read-errors.sh: Likewise.

3 months agobuild: update gnulib submodule to latest
Collin Funk [Sat, 17 Jan 2026 22:12:27 +0000 (14:12 -0800)] 
build: update gnulib submodule to latest

3 months agomaint: remove sc_prohibit_NULL syntax check
Pádraig Brady [Sat, 17 Jan 2026 12:45:42 +0000 (12:45 +0000)] 
maint: remove sc_prohibit_NULL syntax check

* cfg.mk: NULL is fine and good in C as per:
https://bugs.gnu.org/66221#53

3 months agobuild: update gnulib submodule to latest
Pádraig Brady [Sat, 17 Jan 2026 12:45:08 +0000 (12:45 +0000)] 
build: update gnulib submodule to latest

3 months agomaint: pacify another gcc -Wzero-as-null-pointer-constant warning
Collin Funk [Sat, 17 Jan 2026 06:56:15 +0000 (22:56 -0800)] 
maint: pacify another gcc -Wzero-as-null-pointer-constant warning

* src/uptime.c (print_uptime): Add a timezone_t cast to zero. Don't use
nullptr since timezone_t is not a standardized and may be defined to
something other than a pointer.

3 months agomaint: spelling fixes
Paul Eggert [Fri, 16 Jan 2026 21:22:28 +0000 (13:22 -0800)] 
maint: spelling fixes

3 months agobuild: update gnulib submodule to latest
Paul Eggert [Fri, 16 Jan 2026 20:49:14 +0000 (12:49 -0800)] 
build: update gnulib submodule to latest

3 months agomaint: pacify gcc -Wzero-as-null-pointer-constant
Paul Eggert [Fri, 16 Jan 2026 06:34:27 +0000 (22:34 -0800)] 
maint: pacify gcc -Wzero-as-null-pointer-constant

* src/basenc.c (long_options):
* src/chcon.c (change_file_context):
* src/copy.c (is_ancestor):
* src/env.c (build_argv):
* src/expr.c (nomoreargs):
* src/factor.c (mp_no_factors):
* src/ls.c (long_options, main):
* src/selinux.c (defaultcon, restorecon_private):
* src/shred.c (dopass):
* src/shuf.c (long_opts):
* src/tac.c (output):
* src/test.c (term):
* src/uniq.c (check_file): Do not use ‘0’ as a null pointer
constant.  Although it is typically valid C, there are exceptions
(e.g., stdarg) and it a bit cleaner to be consistent.  This patch
uses NULL, not nullptr, as I have second thoughts about nullptr;
see <https://bugs.gnu.org/66221#53>.

3 months agobuild: fix link errors with multi-call binary and 'cksum' excluded
Collin Funk [Thu, 15 Jan 2026 01:18:11 +0000 (17:18 -0800)] 
build: fix link errors with multi-call binary and 'cksum' excluded

* src/local.mk (src_ls_LDADD, src_seq_LDADD, src_md5sum_LDADD)
(src_sha1sum_LDADD, src_sha224sum_LDADD, src_sha256sum_LDADD)
(src_sha384sum_LDADD, src_sha512sum_LDADD): Set to
$(src_cksum_LDADD).
Reported at https://github.com/coreutils/coreutils/issues/172

3 months agoall: with multi-call binary, only process options for known names
Pádraig Brady [Thu, 15 Jan 2026 14:56:26 +0000 (14:56 +0000)] 
all: with multi-call binary, only process options for known names

Setup
  $ ln -nsf src/coreutils foo

Before
  $ ./foo; echo $?
  foo: unknown program ‘foo’
  Try './foo --help' for more information.
  1
  ./foo --version; echo $?
  coreutils (GNU coreutils) 9.9.172-01993
  0

After
  $ ./foo; echo $?
  coreutils: unknown program 'foo'
  1
  $ ./foo --version; echo $?
  coreutils: unknown program 'foo'
  1

* src/coreutils.c (main): Don't process options if
we don't know they're intended for the multi-call binary.
Otherwise `foo --version` would return true, even though
foo was symlinked to the multi-call binary, but not supported.
* tests/misc/coreutils.sh: Add test cases.
* NEWS: Mention the change in behavior.

3 months agodoc: paste: give a CSV generation example
Pádraig Brady [Thu, 15 Jan 2026 15:22:49 +0000 (15:22 +0000)] 
doc: paste: give a CSV generation example

* doc/coreutils.texi (paste invocation): Provide an example
to comma separate data.

3 months agobuild: paste: fix build failure with C99
Pádraig Brady [Wed, 14 Jan 2026 11:38:59 +0000 (11:38 +0000)] 
build: paste: fix build failure with C99

GCC 10.2 gave the following error:
"error: a label can only be part of a statement
 and a declaration is not a statement"

* src/fold.c (fold_file): Add a ";" to avoid C2X specific syntax.

3 months agomaint: avoid syntax-check failure from previous commit
Collin Funk [Wed, 14 Jan 2026 04:45:32 +0000 (20:45 -0800)] 
maint: avoid syntax-check failure from previous commit

* src/copy-file-data.c (sparse_copy): Use nullptr instead of NULL.

3 months agocat: don’t treat copy_file_range EFBIG as fatal
Paul Eggert [Tue, 13 Jan 2026 17:35:12 +0000 (09:35 -0800)] 
cat: don’t treat copy_file_range EFBIG as fatal

* src/cat.c (copy_cat):
* src/copy-file-data.c (sparse_copy):
Don’t treat EFBIG as a reportable error from copy_file_range.
If the input is at EOF and the output position is 2**63 - 1,
copy_file_range (ifd, NULL, ofd, NULL, 2146435072, 0)
incorrectly fails with EFBIG.  Problem observed on Ubuntu 25.10
x86-64 with Linux kernel 6.17.0-8-generic #8-Ubuntu.
I am too lazy to report this kernel bug or add a coreutils test case.

3 months agobuild: update gnulib submodule to latest
Paul Eggert [Tue, 13 Jan 2026 16:13:30 +0000 (08:13 -0800)] 
build: update gnulib submodule to latest

3 months agocp: copy-file-data.c commentary fixes
Paul Eggert [Tue, 13 Jan 2026 15:27:31 +0000 (07:27 -0800)] 
cp: copy-file-data.c commentary fixes

* src/copy-file-data.c: Update commentary to match code better.

3 months agotests: ensure utilities correctly diagnose read errors
Pádraig Brady [Tue, 13 Jan 2026 02:04:11 +0000 (02:04 +0000)] 
tests: ensure utilities correctly diagnose read errors

* tests/misc/read-errors.sh: Ensure each utility calls a
read system call as requested.  Not doing so (say by avoiding
reading from a directory) is a layering violation.
Also ensure we diagnose the particular error encountered.

3 months agofmt: correctly diagnose read errors
Pádraig Brady [Tue, 13 Jan 2026 02:01:11 +0000 (02:01 +0000)] 
fmt: correctly diagnose read errors

* src/fmt.c (fmt): Pass errno to error() so that
the particular error is diagnosed.
* NEWS: Mention the improvement.

3 months agopaste: support multi-byte delimiters
Pádraig Brady [Mon, 12 Jan 2026 23:41:29 +0000 (23:41 +0000)] 
paste: support multi-byte delimiters

* src/paste.c (collapse_escapes): This is the central --delimiters
parsing function, so adjust to handle multi-byte chars with
mcel_scanz().  Populate a delimiters length array to support
characters of differing lengths.
(paste_serial): Use the delimiters length array to output
the appropriate delimiter.
(paste_parallel): Likewise.
* tests/paste/multi-byte.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the improvement.

3 months agotests: nice: ensure large values are clamped
oech3 [Tue, 13 Jan 2026 14:10:23 +0000 (14:10 +0000)] 
tests: nice: ensure large values are clamped

* tests/nice/nice.sh: Ensure integers > UINTMAX_MAX are supported.
From https://github.com/coreutils/coreutils/pull/170

3 months agomaint: ptx: place long options without short options after CHAR_MAX
Collin Funk [Mon, 12 Jan 2026 04:43:37 +0000 (20:43 -0800)] 
maint: ptx: place long options without short options after CHAR_MAX

* src/ptx.c (FORMAT_OPTION): New constant.
(long_options): Use FORMAT_OPTION instead of 10.
(main): Likewise.

3 months agotests: cksum: use more general strace syscall injection
Dmitry V. Levin [Mon, 12 Jan 2026 15:11:22 +0000 (15:11 +0000)] 
tests: cksum: use more general strace syscall injection

* tests/cksum/cksum-c.sh: Match "read" with a regex
to match any of the read syscall variants.

3 months agotests: paste -d: test supported escape sequences
Pádraig Brady [Mon, 12 Jan 2026 00:43:35 +0000 (00:43 +0000)] 
tests: paste -d: test supported escape sequences

* tests/misc/paste.pl: Test all supported POSIX and GNU
backslash escape sequences.

3 months agodoc: paste: add more detail on operation and options
Pádraig Brady [Mon, 12 Jan 2026 00:12:35 +0000 (00:12 +0000)] 
doc: paste: add more detail on operation and options

* src/paste.c (usage): Mention how lines are processed
with and without the -s option.  Also mention that -d
supports backslash escapes.
* doc/coreutils.texi (paste invocation): Likewise.
Also detail the backslash escapes, noting which are non-POSIX.

3 months agomaint: ptx: reuse octhexdigits macros instead of redefining them
Collin Funk [Mon, 12 Jan 2026 04:22:52 +0000 (20:22 -0800)] 
maint: ptx: reuse octhexdigits macros instead of redefining them

* src/ptx.c: Include octhexdigits.h.
(HEXTOBIN, ISODIGIT, OCTTOBIN): Remove macros.
(unescape_string): Use the macros from octhexdigits.h instead of the
removed macros.

3 months agotests: date: test nested parenthesis comment handling
Pádraig Brady [Sun, 11 Jan 2026 18:51:19 +0000 (18:51 +0000)] 
tests: date: test nested parenthesis comment handling

* tests/date/date.pl: Add test cases.
Suggested by Sylvestre Ledru.

3 months agodoc: runcon: use more accurate synopsis format
Pádraig Brady [Sun, 11 Jan 2026 18:37:33 +0000 (18:37 +0000)] 
doc: runcon: use more accurate synopsis format

* src/runcon.c (usage): Align synopsis with format
used in other commands.
* doc/coreutils.texi (runcon invocation): Likewise.

3 months agotests: cksum: ensure --check handles I/O errors
oech3 [Sun, 11 Jan 2026 18:14:44 +0000 (18:14 +0000)] 
tests: cksum: ensure --check handles I/O errors

* tests/cksum/cksum-c.sh: Use strace to inject EIO upon read(),
and verify it's handled appropriately.
From https://github.com/coreutils/coreutils/pull/167

3 months agotests: cksum: ensure --check diagnoses read errors
Pádraig Brady [Sun, 11 Jan 2026 13:40:32 +0000 (13:40 +0000)] 
tests: cksum: ensure --check diagnoses read errors

* tests/misc/read-errors.sh: Add a test case.
Discussed in https://github.com/coreutils/coreutils/pull/167

3 months agobuild: support 'dist' and 'syntax-check' targets without libselinux
Pádraig Brady [Sat, 10 Jan 2026 16:37:13 +0000 (16:37 +0000)] 
build: support 'dist' and 'syntax-check' targets without libselinux

Following on from commit v9.8-60-g8ba47d09a ...
Without libselinux installed, runcon and chcon stub binaries
will not be built by default.  We separate these utilities out
to a separate "not built unless appropriate" class, so that
we can add these to EXTRA_MANS so that the 'check-x-vs-1'
target doesn't fail, and the 'dist' target includes
these man pages.

* build-aux/gen-lists-of-programs.sh: Separate out
build_if_appropriate_progs, and propagate that through
to no_install_progs_default which populates EXTRA_MANS.
* src/local.mk: Separate out build_if_appropriate__progs
for clarity and consistency.

3 months agobuild: update gnulib submodule to latest
Pádraig Brady [Sun, 11 Jan 2026 12:54:17 +0000 (12:54 +0000)] 
build: update gnulib submodule to latest

* gnulib: Update to latest mainly to pull in selinux module fixes.
* NEWS: Mention the build fix to honor --with-selinux building
stub chcon and runcon binaries on systems without libselinux.

3 months agocksum: promptly diagnose write errors
Collin Funk [Sat, 10 Jan 2026 05:17:26 +0000 (21:17 -0800)] 
cksum: promptly diagnose write errors

* src/cksum.c (output_file, digest_check): Check if standard output has
it's error flag set after printing.
* tests/misc/write-errors.sh: Add a test case that would previously run
forever.
* NEWS: Mention the improvement. Reorder alphabetically.

3 months agomaint: remove redundant processing in a test
Pádraig Brady [Fri, 9 Jan 2026 14:25:24 +0000 (14:25 +0000)] 
maint: remove redundant processing in a test

* tests/misc/write-errors.sh: This was a no-op anyway
due to inadequate escaping.  Also document the escaping requirement.

3 months agodu: promptly diagnose write errors
Pádraig Brady [Fri, 9 Jan 2026 14:20:56 +0000 (14:20 +0000)] 
du: promptly diagnose write errors

* src/du.c (print_size): Call write_error() if can't flush.
* tests/misc/write-errors.sh: Add a test case.
* NEWS: Mention the improvement.

3 months agowc: promptly diagnose write errors
Pádraig Brady [Fri, 9 Jan 2026 14:16:04 +0000 (14:16 +0000)] 
wc: promptly diagnose write errors

* src/wc.c (write_counts): Call write_error() if any pending errors.
* tests/misc/write-errors.sh: Add a test case.
* NEWS: Mention the improvement.

3 months agoreadlink,realpath: promptly diagnose write errors
Collin Funk [Fri, 9 Jan 2026 06:52:33 +0000 (22:52 -0800)] 
readlink,realpath: promptly diagnose write errors

The 'readlink' and 'realpath' programs have an uncommon case where they
can run for a very long time. When canonicalizing file names longer than
PATH_MAX, we have to call 'openat' for each directory up the tree until
we reach root which takes a long time. Here is an example of the current
behavior:

    $ mkdir -p $(yes a/ | head -n $((32 * 1024)) | tr -d '\n')
    $ while cd $(yes a/ | head -n 1024 | tr -d '\n'); do :; \
        done 2>/dev/null
    $ pwd | tr '/' '\n' | wc -l
    32771
    $ env time --format=%E readlink -f $(yes . | head -n 5) > /dev/full
    readlink: write error: No space left on device
    Command exited with non-zero status 1
    0:59.72
    $ env time --format=%E realpath $(yes . | head -n 5) > /dev/full
    realpath: write error: No space left on device
    Command exited with non-zero status 1
    1:00.32

It is better to exit as soon as there is an error writing to standard
output:

    $ env time --format=%E readlink -f $(yes . | head -n 5) > /dev/full
    readlink: write error: No space left on device
    Command exited with non-zero status 1
    0:11.88
    $ env time --format=%E realpath $(yes . | head -n 5) > /dev/full
    realpath: write error: No space left on device
    Command exited with non-zero status 1
    0:12.04

* src/readlink.c (main): Check if standard output has it's error flag
set after printing a file name.
* src/realpath.c (process_path): Likewise.
* NEWS: Mention the improvement.

3 months agocksum: validate options more consistently
Pádraig Brady [Thu, 8 Jan 2026 14:07:32 +0000 (14:07 +0000)] 
cksum: validate options more consistently

We disallow `cksum --tag --check` which is fine,
but the error should be consistent with md5sum,
and less confusing, as it currently mentions
"--binary" and "--text" which weren't specified.

We disallow `cksum --tag --text` which is fine,
but we should also disallow `cksum --text --tag`.

We should honor an explicit --binary (output *)
with this combination of options:
cksum --binary --tag --untagged -a md5 /dev/null

Note this also makes both of `cksum -a md5` and
`cksum --tag -a md5` consistently use binary mode
when reading from a tty on systems like MinGW
where O_BINARY is set.

* src/cksum.c (main): Adjust --text,--binary
and --tag,--untagged option processing.
* tests/cksum/cksum-a.sh: Add test cases.
* tests/cksum/cksum-c.sh: Likewise.
* NEWS: Mention the improvement.
Fixes https://github.com/coreutils/coreutils/issues/163

3 months agotests: chmod: fix false failure in recent test
Pádraig Brady [Wed, 7 Jan 2026 22:50:07 +0000 (22:50 +0000)] 
tests: chmod: fix false failure in recent test

* tests/chmod/partial-fail.sh: Test readablility of mode 0 files
independently, to avoid false failure, e.g., when run as root.
Reported by Bruno Haible.

3 months agotests: tail/overlay-headers.sh: fix various issues
Pádraig Brady [Wed, 7 Jan 2026 20:29:54 +0000 (20:29 +0000)] 
tests: tail/overlay-headers.sh: fix various issues

* tests/tail/overlay-headers.sh (cleanup_): Ensure we send SIGCONT
to the tail process, otherwise we would hang if the test is terminated
while the tail process is in stopped state.
(wait4stopped_): A new function to ensure tail is in the stopped state
before we start writing to the monitored files.
Also remove "---disable-inotify" from $fastpoll so we actually
test the inotify code (where supported).
Also remove the timeout(1) wrapper, so we actually suspend tail(1).

Reported by Bruno Haible on macOS 26

3 months agofmt: interpret -w as an inclusive maximum
Pádraig Brady [Wed, 7 Jan 2026 17:15:28 +0000 (17:15 +0000)] 
fmt: interpret -w as an inclusive maximum

This aligns with `fold -w` and BSD `fmt` implementations.

* src/fmt.c (fmt_paragraph): Check len <= max_width.
* tests/fmt/width.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the change in behavior.
Addresses part of https://bugs.gnu.org/79497

3 months agotests: date: test parenthesis comment handling
Sylvestre Ledru [Wed, 7 Jan 2026 22:51:06 +0000 (23:51 +0100)] 
tests: date: test parenthesis comment handling

* tests/date/date.pl: Add the check.

3 months agomaint: organize mktemp tests in a subdirectory
Collin Funk [Wed, 7 Jan 2026 02:47:21 +0000 (18:47 -0800)] 
maint: organize mktemp tests in a subdirectory

* tests/misc/mktemp.pl: Moved to tests/mktemp/mktemp.pl.
* tests/local.mk (all_tests): Adjust the file name.

3 months agotests: mktemp: add tests for invalid Unicode options
Collin Funk [Mon, 5 Jan 2026 00:51:09 +0000 (16:51 -0800)] 
tests: mktemp: add tests for invalid Unicode options

* init.cfg (bad_unicode): New function, copied from
tests/fold/fold-characters.sh with the NUL removed.
* tests/fold/fold-characters.sh (bad_unicode): Rename to
bad_unicode_with_nul. Reformat long line.
* tests/mktemp/bad-unicode.sh: New test.
* tests/local.mk (all_tests): Add the new test.

3 months agocopy: protect against infinite loop due to pathological race
Pádraig Brady [Mon, 5 Jan 2026 14:46:33 +0000 (14:46 +0000)] 
copy: protect against infinite loop due to pathological race

Consider:

1. In infer_scantype():
    - SEEK_DATA returns 0
      - hole punched at 0
    - SEEK_HOLE returns 0 (now a hole)
    - Cache scan_inference->hole_start = 0
2. In lseek_copy():
      - data written at 0
    - ext_start = 0, use cached hole_start = 0
    - ext_len = 0
    - now loop doesn't progress

* src/copy-file-data.c (lseek_copy): Apply a more defensive check
to ensure we only use the cached offsets in SCAN_INFERENCE once.
This protects against an infinite loop where an extent (at SRC_POS)
flip flops between data and hole extent while infer_scantype()
and lseek_copy() are inspecting it.  I.e. ensure we use SEEK_HOLE
to progress the copy.

3 months agotests: cp: fix always skipped nfs-removal-race.sh
Pádraig Brady [Tue, 6 Jan 2026 20:29:45 +0000 (20:29 +0000)] 
tests: cp: fix always skipped nfs-removal-race.sh

* tests/cp/nfs-removal-race.sh: This test was invalid since v8.32
as we now use fstatat() rather than stat().  Also since commit
v9.0-66-ge2daa8f79 we leverage the errno from open(O_DIRECTORY)
to avoid a stat, so pass --no-target-directory to ensure fstatat()
is called.
Discussed in https://github.com/coreutils/coreutils/pull/161

3 months agotests: cp: support glibc 2.33+ in nfs-removal-race test
Christopher Illarionova [Tue, 6 Jan 2026 04:07:49 +0000 (04:07 +0000)] 
tests: cp: support glibc 2.33+ in nfs-removal-race test

glibc 2.33 removed __xstat, making stat() a direct symbol. This test
previously only intercepted __xstat, causing it to skip on modern glibc
with 'LD_PRELOAD was ineffective'.

Changes:
- Intercept both __xstat (glibc < 2.33) and stat (glibc >= 2.33)
- Only mark 'preloaded' when stat is called on destination 'd',
  ensuring the test verifies cp actually stats the destination

3 months agodoc: tr: warn about shell quoting [:classes:]
Pádraig Brady [Tue, 6 Jan 2026 17:24:39 +0000 (17:24 +0000)] 
doc: tr: warn about shell quoting [:classes:]

* src/tr.c (usage): Warn about avoiding shell globbing.
* doc/coreutils.texi (character arrays): Likewise.
Suggested by Daniel Dallos.

3 months agoptx: implement -t to change default width to 100
Pádraig Brady [Mon, 5 Jan 2026 21:56:38 +0000 (21:56 +0000)] 
ptx: implement -t to change default width to 100

Align the -t implementation with the Heirloom project.

* src/ptx.c (usage): Describe -t, and also mention
the default width is 72 when not used.
* doc/coreutils.texi (ptx invocation): Likewise.
(main): Override the default width if -t is specified.
* tests/ptx/ptx.pl: Add test cases.
* NEWS: Mention the change in behavior.

3 months agotests: stty: add require_controlling_input_terminal_ to bad-speed test
Christopher Illarionova [Mon, 5 Jan 2026 16:54:00 +0000 (16:54 +0000)] 
tests: stty: add require_controlling_input_terminal_ to bad-speed test

The bad-speed test runs 'stty ispeed 9600' without a --file argument,
which requires a controlling terminal. Without it, stty fails early with
'Inappropriate ioctl for device' before reaching cfsetispeed, causing
the test to skip with a misleading 'LD_PRELOAD interception failed'
message.

* tests/stty/bad-speed.sh: Add require_controlling_input_terminal_
to match the other stty tests (stty.sh, stty-pairs.sh, stty-row-col.sh,
stty-invalid.sh) which all require a controlling terminal.
From https://github.com/coreutils/coreutils/pull/160

3 months agomaint: mknod: reduce variable scope
Collin Funk [Sun, 4 Jan 2026 21:47:01 +0000 (13:47 -0800)] 
maint: mknod: reduce variable scope

* src/mknod.c (main): Declare variables where they are used instead of
at the start of a block. Prefer signed integers to unsigned integers.

3 months agomaint: mkfifo: reduce variable scope
Collin Funk [Sun, 4 Jan 2026 21:46:41 +0000 (13:46 -0800)] 
maint: mkfifo: reduce variable scope

* src/mkfifo.c (main): Declare variables where they are used instead of
at the start of a block.

3 months agocopy: fix possible infinite loop with SEEK_HOLE
Pádraig Brady [Sun, 4 Jan 2026 12:45:46 +0000 (12:45 +0000)] 
copy: fix possible infinite loop with SEEK_HOLE

Commit v9.8-95-g4c0cf3864 intended to initialize
ext_start to src_pos, as was described at:
https://lists.gnu.org/r/coreutils/2025-11/msg00035.html
However ipos was inadvertently used, which is only
valid the first time through the loop.

* src/copy-file-data.c (lseek_copy): Use scan_inference->hole_start
only with the initial offset passed to lseek_copy().
* NEWS: Mention the bug fix.
Reported at https://github.com/coreutils/coreutils/issues/159

3 months agotests: chmod: ensure failure upon partial success
Pádraig Brady [Sat, 3 Jan 2026 14:45:07 +0000 (14:45 +0000)] 
tests: chmod: ensure failure upon partial success

* tests/chmod/partial-fail.sh: Add new test.
* tests/local.mk: Reference new test.
Discussed at https://github.com/uutils/coreutils/issues/9790

3 months agotests: split: ensure directories not replaced
oech3 [Thu, 1 Jan 2026 16:03:41 +0000 (01:03 +0900)] 
tests: split: ensure directories not replaced

* tests/split/split-io-err.sh: Add a test case.
From https://github.com/coreutils/coreutils/pull/158

3 months agodoc: NEWS: mention du performance improvement on the Lustre file system
Collin Funk [Sat, 3 Jan 2026 03:29:11 +0000 (19:29 -0800)] 
doc: NEWS: mention du performance improvement on the Lustre file system

Reported by Tim Day <timday@amazon.com> in
<https://bugs.gnu.org/80106>.

* NEWS: Mention the improvement after gnulib commit 578b8d7dc5.

3 months agobuild: update gnulib submodule to latest
Collin Funk [Fri, 2 Jan 2026 04:43:17 +0000 (20:43 -0800)] 
build: update gnulib submodule to latest

* bootstrap: Update using './bootstrap --bootstrap-sync'.
* tests/sample-test: Adjust to use the single most recent year.

3 months agomaint: prefer c_isblank to an equivalent macro
Collin Funk [Fri, 2 Jan 2026 01:18:13 +0000 (17:18 -0800)] 
maint: prefer c_isblank to an equivalent macro

* src/cksum.c (ISWHITE): Remove macro.
(bsd_split_3, algorithm_from_tag, split_3): Use c_isblank instead of
ISWHITE.

3 months agotests: df: don't depend on bash
Collin Funk [Thu, 1 Jan 2026 19:15:31 +0000 (11:15 -0800)] 
tests: df: don't depend on bash

* tests/df/no-mtab-status-masked-proc.sh: Invoke $SHELL instead of
'bash'.

3 months agomaint: run 'make update-copyright'
Collin Funk [Thu, 1 Jan 2026 18:56:16 +0000 (10:56 -0800)] 
maint: run 'make update-copyright'

3 months agotests: mv: check broken symlink cross-filesystem move
Sylvestre Ledru [Thu, 1 Jan 2026 12:20:52 +0000 (13:20 +0100)] 
tests: mv: check broken symlink cross-filesystem move

Identified here:
<https://github.com/uutils/coreutils/issues/8586>

* tests/mv/mv-special-2.sh: Add the check.

3 months agotests: df: hide /proc without using LD_PRELOAD
oech3 [Tue, 30 Dec 2025 12:03:11 +0000 (21:03 +0900)] 
tests: df: hide /proc without using LD_PRELOAD

* tests/df/no-mtab-status-masked-proc.sh: A new test similar
to no-mtab-status.sh but should work with static builds.
* tests/local.mk: Reference the new test.
https://github.com/coreutils/coreutils/pull/156

3 months agotests: add LD_PRELOAD free alternative for nproc-quota.sh
oech3 [Tue, 30 Dec 2025 06:53:31 +0000 (15:53 +0900)] 
tests: add LD_PRELOAD free alternative for nproc-quota.sh

* tests/nproc/nproc-quota-systemd.sh: Add a new root test.
* tests/local.mk: Reference the new test.

3 months agotests: extend csplit-io-err.sh for directory
oech3 [Thu, 1 Jan 2026 04:45:30 +0000 (13:45 +0900)] 
tests: extend csplit-io-err.sh for directory

* tests/csplit/csplit-io-err.sh: Add a test case
to ensure a directory is _not_ replaced.

3 months agotests: du: check -l (--count-links) without -a flag
Sylvestre Ledru [Tue, 30 Dec 2025 23:14:59 +0000 (00:14 +0100)] 
tests: du: check -l (--count-links) without -a flag

Identified here:
<https://github.com/uutils/coreutils/issues/9871>

* tests/du/hard-link.sh: Add the check.

3 months agotests: env: check that real-time signals can be ignored
Collin Funk [Mon, 29 Dec 2025 03:48:29 +0000 (19:48 -0800)] 
tests: env: check that real-time signals can be ignored

* tests/env/env-signal-handler.sh: Test that --ignore-signal with no
options also ignores real-time signals. Test that real-time signals can
be ignored by explicitly listing them.

4 months agotests: kill: check that real-time signals are listed
Collin Funk [Sun, 28 Dec 2025 05:48:42 +0000 (21:48 -0800)] 
tests: kill: check that real-time signals are listed

* tests/misc/kill.sh: Call getlimits_. Check for RTMIN and RTMAX in the
output of 'kill -l' if the system defines SIGRTMIN and SIGRTMAX.

4 months agogetlimits: print SIGRTMIN and SIGRTMAX
Collin Funk [Sat, 27 Dec 2025 01:52:58 +0000 (17:52 -0800)] 
getlimits: print SIGRTMIN and SIGRTMAX

* src/getlimits.c (SIGRTMIN): Define to zero if signal.h does not define
this constant.
(SIGRTMAX): Define to SIGRTMIN - 1 if signal.h does not define this
constant.
(main): Print SIGRTMIN and SIGRTMAX.

4 months agomaint: commit-msg: add 'getlimits' as a supported tag
Collin Funk [Sat, 27 Dec 2025 01:49:39 +0000 (17:49 -0800)] 
maint: commit-msg: add 'getlimits' as a supported tag

* scripts/git-hooks/commit-msg (@valid): Add getlimits.

4 months agotests: split: verify operation in the presence of I/O errors
oech3 [Sat, 27 Dec 2025 13:57:30 +0000 (22:57 +0900)] 
tests: split: verify operation in the presence of I/O errors

* tests/split/split-io-err.sh: A new test to verify that with I/O
errors, we leave existing files but don't continue.
* tests/local.mk: Reference the new test.

4 months agotests: check I/O error handling with /dev/full and closed pipes
Pádraig Brady [Sat, 27 Dec 2025 16:28:55 +0000 (16:28 +0000)] 
tests: check I/O error handling with /dev/full and closed pipes

* tests/misc/io-errors.sh: Verify that all commands diagnose write
errors, and handle a closed pipe appropriately.
* tests/local.mk: Reference the new test.

4 months agosort: fix SIGPIPE handling
Pádraig Brady [Sat, 27 Dec 2025 15:48:42 +0000 (15:48 +0000)] 
sort: fix SIGPIPE handling

* src/sort.c (main): Don't override handler for SIGPIPE
(which we did since commit v9.9-34-ge63131b32),
since we've explicit handling for SIGPIPE.
Also move ignoring of SIGPIPE until after
--help and --version are processed.

4 months agotests: consolidate csplit-io-err tests
oech3 [Sat, 27 Dec 2025 12:45:31 +0000 (12:45 +0000)] 
tests: consolidate csplit-io-err tests

* tests/csplit/csplit-io-err.sh: Replace this LD_PRELOAD test with...
* tests/csplit/csplit-io-err-2.sh: This more general test,
that leverages /dev/full.
* tests/local.mk: Remove tests/csplit/csplit-io-err-2.sh.

4 months agotests: csplit: check writing to /dev/full
oech3 [Fri, 26 Dec 2025 12:24:00 +0000 (21:24 +0900)] 
tests: csplit: check writing to /dev/full

* tests/csplit/csplit-io-err-2.sh: Add a new test.
* tests/local.mk: Reference new test.

4 months agodd: don't continue copying when ftruncate fails using seek= and of=
Collin Funk [Wed, 24 Dec 2025 05:45:37 +0000 (21:45 -0800)] 
dd: don't continue copying when ftruncate fails using seek= and of=

* src/dd.c (main): Reduce the scope of exit_status. Exit immediately if
ftruncate fails.
* tests/dd/fail-ftruncate-fstat.sh: New test.
* tests/local.mk (all_tests): Add the new test.
* NEWS: Mention the bug fix.

4 months agodoc: document the date(1) bug with empty format directives
Pádraig Brady [Thu, 25 Dec 2025 14:30:01 +0000 (14:30 +0000)] 
doc: document the date(1) bug with empty format directives

* NEWS: Mention the bug fix.

4 months agobuild: update gnulib to latest
Pádraig Brady [Thu, 25 Dec 2025 14:25:58 +0000 (14:25 +0000)] 
build: update gnulib to latest

4 months agotests: date: improve locale tests
Collin Funk [Wed, 24 Dec 2025 04:03:49 +0000 (20:03 -0800)] 
tests: date: improve locale tests

* tests/date/date-locale-hour.sh: Test that the default format of 10
random supported locales is the same as 'locale date_fmt'.

4 months agotests: avoid false failure due to ulimit on aarch64
Pádraig Brady [Mon, 22 Dec 2025 17:12:48 +0000 (17:12 +0000)] 
tests: avoid false failure due to ulimit on aarch64

* tests/cut/cut-huge-range.sh: Add an extra 1MiB headroom,
which was seen with aarch64.
Reported at https://bugzilla.redhat.com/2424302

4 months agomaint: tests/cut/cut-huge-range.sh: remove stale comment
Pádraig Brady [Mon, 22 Dec 2025 15:24:07 +0000 (15:24 +0000)] 
maint: tests/cut/cut-huge-range.sh: remove stale comment

* tests/cut/cut-huge-range.sh: expr supports bignums,
so remove stale comment relating to previous non expr adjustment.

4 months agonumfmt: fix dropped custom suffix when failing to parse
Pádraig Brady [Mon, 22 Dec 2025 13:14:57 +0000 (13:14 +0000)] 
numfmt: fix dropped custom suffix when failing to parse

* src/numfmt.c (process_suffixed_number): Restore custom suffix
upon failure to parse number.
* tests/numfmt/numfmt.pl: Add test cases.
* NEWS: Mention the bug fix.
Fixes https://bugs.debian.org/1094581

4 months agomaint: prefer enums over macros for sources used for multiple programs
Collin Funk [Sun, 21 Dec 2025 01:24:17 +0000 (17:24 -0800)] 
maint: prefer enums over macros for sources used for multiple programs

* src/chown.h (enum chown_modes): New type.
(CHOWN_CHOWN, CHOWN_CHGRP): Define as an enum instead of a macro.
* src/chown-chgrp.c (chown_mode): Use "enum chown_modes" instead of
"int".
* src/chown-chown.c (chown_mode): Likewise.
* src/ls.h (enum ls_modes): New type.
(LS_LS, LS_MULTI_COL, LS_LONG_FORMAT): Define as an enum instead of a
macro.
* src/ls-dir.c (ls_mode): Use "enum ls_modes" instead of "int".
* src/ls-ls.c (ls_mode): Likewise.
* src/ls-vdir.c (ls_mode): Likewise.
* src/uname.h (enum uname_modes): New type.
(UNAME_UNAME, UNAME_ARCH): Define as an enum instead of a macro.
* src/uname-arch.c (uname_mode): Use "enum uname_modes" instead of
"int".
* src/uname-uname.c (uname_mode): Likewise.

4 months agodoc: prefer UTF-8 characters in texinfo sources
Collin Funk [Sat, 20 Dec 2025 04:38:01 +0000 (20:38 -0800)] 
doc: prefer UTF-8 characters in texinfo sources

* doc/coreutils.texi (Introduction): Use ç instead of @,{c}.
(Character arrays): Use ö instead of @"o. Use Ł instead of @L{}.
(Formatting file timestamps): Use ä instead of @"a.

4 months agodoc: ls: fix recent typo for -F option in texinfo
Pádraig Brady [Sat, 20 Dec 2025 17:26:59 +0000 (17:26 +0000)] 
doc: ls: fix recent typo for -F option in texinfo

* doc/coreutils.texi (ls invocation): Add a missing hyphen
that was inadvertently dropped in the recent adjustments.

4 months agotests: runcon: avoid false success
Pádraig Brady [Sat, 20 Dec 2025 13:16:11 +0000 (13:16 +0000)] 
tests: runcon: avoid false success

* tests/runcon/runcon-compute.sh: Ensure runcon runs,
since the main test is a negative one.

4 months agodoc: split,tac: document $TMPDIR usage
Pádraig Brady [Thu, 18 Dec 2025 23:54:52 +0000 (23:54 +0000)] 
doc: split,tac: document $TMPDIR usage

Following commit v9.3-92-g1b86b70dd
$TMPDIR is part of the interface and an important behavioral
characteristic of a command, which should be documented.

* doc/coreutils.texi (split invocation): Mention $TMPDIR is honored.
(tac invocation): Likewise.
* src/split.c (usage): Likewise.
* src/tac.c (usage): Likewise.

4 months agodoc: tee: prefer cksum in examples
Collin Funk [Wed, 17 Dec 2025 06:15:26 +0000 (22:15 -0800)] 
doc: tee: prefer cksum in examples

* doc/coreutils.texi (tee invocation): Use 'cksum' with '-a sha2' and
'-a sha3' instead of md5sum and sha1sum in examples.

4 months agotests: mv: check moving named sockets is supported
Pádraig Brady [Tue, 16 Dec 2025 11:33:38 +0000 (11:33 +0000)] 
tests: mv: check moving named sockets is supported

* tests/mv/mv-special-2.sh: Use python to create a named socket,
and ensure it's copied across file systems.

4 months agotests: date: add another locale test case
Collin Funk [Sun, 14 Dec 2025 20:37:41 +0000 (12:37 -0800)] 
tests: date: add another locale test case

On a GNU/Linux system, we have the following:

    $ LC_ALL=en_US.UTF-8 date -u -d 1:00
    Sun Dec 14 01:00:00 AM UTC 2025
    $ LC_ALL=en_US.UTF-8 locale date_fmt
    %a %b %e %r %Z %Y
    $ LC_ALL=en_US.UTF-8 locale t_fmt_ampm
    %I:%M:%S %p

    $ LC_ALL=nl_NL.UTF-8 date -u -d 1:00
    zo 14 dec 2025  1:00:00 UTC
    $ LC_ALL=nl_NL.UTF-8 locale date_fmt
    %a %e %b %Y %k:%M:%S %Z

We respect the locales preference for a leading zero or leading space in
single digit hours.

* tests/date/date-locale-hour.sh: Check that the locales preference for
leading zeros or spaces in single digit hours is used.

4 months agotests: mv: check traversed fifos copy correctly
Pádraig Brady [Mon, 15 Dec 2025 15:30:43 +0000 (15:30 +0000)] 
tests: mv: check traversed fifos copy correctly

* tests/mv/mv-special-1.sh: Add a case also for fifos
encountered when traversing.

4 months agotests: mv: add timeout protection when moving fifos
Pádraig Brady [Mon, 15 Dec 2025 13:51:05 +0000 (13:51 +0000)] 
tests: mv: add timeout protection when moving fifos

* tests/mv/mv-special-1.sh: Implementations could potentially hang
interacting with fifos, so wrap with timeout.

4 months agodoc: dd: document the behavior of conv flags on multibyte characters
Collin Funk [Sat, 13 Dec 2025 07:11:09 +0000 (23:11 -0800)] 
doc: dd: document the behavior of conv flags on multibyte characters

* doc/coreutils.texi (dd invocation): Document the behavior of 'dd' on
multibyte characters and some unspecified behavior that will be
documented in a future POSIX release [1].

[1] https://austingroupbugs.net/view.php?id=1959

4 months agotests: ls: use a larger file descriptor limit
Collin Funk [Sat, 13 Dec 2025 05:51:30 +0000 (21:51 -0800)] 
tests: ls: use a larger file descriptor limit

OpenBSD and Alpine Linux /bin/sh cannot handle a file descriptor limit
of 7.

* tests/ls/recursive.sh: Create 30 directories and use a file descriptor
limit of 20. Don't check the output since we have coverage for that
elsewhere.
Reported by Bruno Haible.

4 months agobuild: reduce size of multi-call binary by reusing cksum logic
Pádraig Brady [Sat, 6 Dec 2025 13:47:11 +0000 (13:47 +0000)] 
build: reduce size of multi-call binary by reusing cksum logic

Map md5sum and sha{1,224,256,385,512} to use cksum logic,
which selects appropriate behavior at runtime, rather than
separate binaries for each closely related utility.

$ size src/coreutils  # before
   text    data     bss     dec     hex filename
1349509    6812  619312 1975633  1e2551 src/coreutils
$ size src/coreutils  # after
   text    data     bss     dec     hex filename
1306933    6748  619152 1932833  1d7e21 src/coreutils

* build-aux/gen-single-binary.sh: Map sha*sum to use cksum.c
* src/cksum.c: Adjust to behave more like sha*sum,
when the algorithm to something other than "crc".
* src/cksum.h: Expose the cksum_algorithm global and enum.
* src/coreutils-md5sum.c: Set cksum_algorithm and call cksum logic.
* src/coreutils-sha1sum.c: Likewise.
* src/coreutils-sha224sum.c Likewise.
* src/coreutils-sha256sum.c Likewise.
* src/coreutils-sha384sum.c Likewise.
* src/coreutils-sha512sum.c Likewise.
* NEWS: Mention the improvement.