]> git.ipfire.org Git - thirdparty/coreutils.git/log
thirdparty/coreutils.git
2 hours agotests: tac-continue.sh: modernise and always execute as root master
Pádraig Brady [Sun, 7 Dec 2025 13:24:00 +0000 (13:24 +0000)] 
tests: tac-continue.sh: modernise and always execute as root

* tests/tac/tac-continue.sh: This test was very awkard to setup,
and thus always skipped.  Instead move to a root only test
that creates an almost full partition itself.
* tests/local.mk: Move test to root only.
Suggested at https://github.com/uutils/coreutils/pull/9590

40 hours agopinky: promptly diagnose write errors
Collin Funk [Fri, 5 Dec 2025 06:14:31 +0000 (22:14 -0800)] 
pinky: promptly diagnose write errors

In some cases 'pinky' could run forever until interrupted:

    $ ln -s /dev/zero ~/.plan
    $ ln -s /dev/zero ~/.project
    $ timeout -v 5 pinky -l collin > /dev/full
    timeout: sending signal TERM to command ‘pinky’

After this change it will exit upon failing to write to standard output:

    $ timeout -v 5 ./src/pinky -l collin > /dev/full
    pinky: write error: No space left on device

* src/pinky.c: Include fadvise.h, filenamecat.h, full-write.h, and
ioblksize.h.
(cat_file): New function.
(print_entry): Check if standard output has it's error flag set after
printing a user entry.
(print_long_entry): Likewise. Use the new cat_file function.
* NEWS: Mention the improvement.

47 hours agodoc: html: reference each command option
Pádraig Brady [Thu, 27 Nov 2025 21:02:45 +0000 (21:02 +0000)] 
doc: html: reference each command option

* doc/coreutils.texi: Add anchors to each command option.
This also has the advantage of removing over 1000 lines,
through the use of macros.

47 hours agodoc: html: support defined anchors for command options
Pádraig Brady [Thu, 27 Nov 2025 20:45:44 +0000 (20:45 +0000)] 
doc: html: support defined anchors for command options

* doc/coreutils.texi (optAnchor): A new macro to output a
referencable anchor, called from ...
(optItem): ... here; a new macro to output all index entries
for each option item.
(optZero,optZeroTerminated): Show an example of the adjustment
done to each option description.
* doc/local.mk (html-local): Post-process the texinfo generated HTML
(`make html`) to remove our "-option" tag, and replace all
escaped _002d with a standard hyphen, which is fine in URLs.

2 days agotests: ls: check that 'ls -R' doesn't run out of file descriptors
Collin Funk [Thu, 4 Dec 2025 04:18:48 +0000 (20:18 -0800)] 
tests: ls: check that 'ls -R' doesn't run out of file descriptors

* tests/ls/recursive.sh: Add a test where the file descriptor limit is
less than the number of directories we visit recursively.

2 days agobuild: update gnulib submodule to latest
Paul Eggert [Thu, 4 Dec 2025 20:39:17 +0000 (12:39 -0800)] 
build: update gnulib submodule to latest

Gnulib issymlinkat change reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2025-12/msg00044.html
* bootstrap: Update from Gnulib.
* src/copy.c: Include issymlinkat.h, not issymlink.h.

4 days agomaint: organize expand and unexpand tests in a subdirectory
Collin Funk [Wed, 3 Dec 2025 05:32:07 +0000 (21:32 -0800)] 
maint: organize expand and unexpand tests in a subdirectory

* tests/misc/expand.pl: Move to tests/expand/expand.pl.
* tests/misc/unexpand.pl: Move to tests/unexpand/unexpand.pl.
* tests/local.mk (all_tests): Adjust file names.

4 days agotests: expand, unexpand: add a test for bounded memory operation
Collin Funk [Wed, 3 Dec 2025 05:19:54 +0000 (21:19 -0800)] 
tests: expand, unexpand: add a test for bounded memory operation

* tests/expand/bounded-memory.sh: New file.
* tests/unexpand/bounded-memory.sh: New file.
* tests/local.mk (all_tests): Add the tests.

4 days agomaint: don't use == on bools
Collin Funk [Wed, 3 Dec 2025 04:24:16 +0000 (20:24 -0800)] 
maint: don't use == on bools

* src/df.c (filter_mount_list): Adjust comment.
* src/sync.c (sync_arg): Don't use == on bools.
* src/pr.c (init_parameters): Likewise.

4 days agotimeout: print the signal number 0 instead of EXIT
Collin Funk [Wed, 3 Dec 2025 03:16:23 +0000 (19:16 -0800)] 
timeout: print the signal number 0 instead of EXIT

POSIX.1-2024 added sig2str but leaves the behavior when called with
signal 0 unspecified. FreeBSD 15.0 does not return the signal name EXIT
like Gnulib's version causing a test failure. This fixes that and
changes the behavior to print 0 instead of EXIT, to avoid confusion when
the program does not exit.

* NEWS: Mention the change.
* src/timeout.c (cleanup): Use snprintf instead of sig2str if the signal
is 0.
* tests/timeout/timeout.sh: Updated the expected output.

4 days agotimeout: prioritize "timed out" exit status
Pádraig Brady [Tue, 2 Dec 2025 17:15:06 +0000 (17:15 +0000)] 
timeout: prioritize "timed out" exit status

* src/timeout.c (cleanup): Reset the default exit status
to EXIT_TIMEDOUT, if we have in fact received an ALARM.
Otherwise we would exit with status EXIT_CANCELED if
there was an issue writing --verbose output for example.
This also ensures a consistent exit status with ASAN enabled,
as with ASAN stderr is not explicitly closed by gnulib's
close_stdout handler.

5 days agotests: ls --hyperlink: add more escaping test cases
Pádraig Brady [Tue, 2 Dec 2025 13:13:54 +0000 (13:13 +0000)] 
tests: ls --hyperlink: add more escaping test cases

* tests/ls/hyperlink.sh: Add tests for anchors, colons,
utf8, and invalid utf8 characters.

5 days agotests: cut: add a test for bounded memory operation
Collin Funk [Mon, 1 Dec 2025 05:13:54 +0000 (21:13 -0800)] 
tests: cut: add a test for bounded memory operation

* tests/cut/bounded-memory.sh: New file.
* tests/local.mk (all_tests): Add the test.

5 days agotests: enable mkdir/writable-under-readonly.sh
Pádraig Brady [Mon, 1 Dec 2025 17:31:53 +0000 (17:31 +0000)] 
tests: enable mkdir/writable-under-readonly.sh

* tests/mkdir/writable-under-readonly.sh: Address FIXMEs and enable.
Addresses https://github.com/coreutils/coreutils/issues/137

6 days agotests: mv: add checks for cross device handling of special files
Pádraig Brady [Mon, 1 Dec 2025 15:03:36 +0000 (15:03 +0000)] 
tests: mv: add checks for cross device handling of special files

* tests/mv/mv-special-2.sh: Add test to ensure we preserve
sparse files, character devices, symlinks, when moving across
file system boundaries.
Addresses https://github.com/coreutils/coreutils/issues/136

6 days agotests: rm: avoid usually skipped non root test
Pádraig Brady [Mon, 1 Dec 2025 13:23:45 +0000 (13:23 +0000)] 
tests: rm: avoid usually skipped non root test

* tests/rm/fail-eperm.xpl: Remove this usually skipped non-root test.
* tests/rm/fail-2eperm.sh: Add the test to this root test instead.
* tests/local.mk: Remove the reference to *.xpl.

6 days agodoc: du: mention the behavior when both --threshold and --total are used
Collin Funk [Sun, 30 Nov 2025 00:17:40 +0000 (16:17 -0800)] 
doc: du: mention the behavior when both --threshold and --total are used

* doc/coreutils.texi (du invocation): Mention that --threshold has no
effect on the grand total calculated when --total is used.
Addresses https://bugs.gnu.org/71309

6 days agotests: copy: reinstate check for symlink xattr copying
Pádraig Brady [Sun, 30 Nov 2025 17:19:34 +0000 (17:19 +0000)] 
tests: copy: reinstate check for symlink xattr copying

* tests/cp/cp-mv-enotsup-xattr.sh: Use two xattr supporting file
systems, to verify the propagation of xattrs.

7 days agotests: avoid skip due to missing nouser_xattr support
Pádraig Brady [Sun, 30 Nov 2025 15:00:23 +0000 (15:00 +0000)] 
tests: avoid skip due to missing nouser_xattr support

* tests/cp/cp-mv-enotsup-xattr.sh: The nouser_xattr option
is not supported by ext2 since about 2022.  Instead use
ramfs to ensure xattrs are not supported.  We also remove
part of the test that relied on partial xattr support.
Fixes https://github.com/coreutils/coreutils/issues/135

7 days agomaint: commit-msg: remove "digest" as a supported tag
Pádraig Brady [Sat, 29 Nov 2025 20:38:12 +0000 (20:38 +0000)] 
maint: commit-msg: remove "digest" as a supported tag

* scripts/git-hooks/commit-msg: We recently renamed the digest module
to cksum, so no longer support "digest" as a commit tag.

7 days agomaint: commit-msg: fix terminal corruption when re-editing
Pádraig Brady [Sat, 29 Nov 2025 20:36:14 +0000 (20:36 +0000)] 
maint: commit-msg: fix terminal corruption when re-editing

* scripts/git-hooks/commit-msg: Explicitly connect the editor to
/dev/tty, so that it can restore terminal settings appropriately.

7 days agomaint: remove note about old NEWS files
Collin Funk [Sat, 29 Nov 2025 07:42:40 +0000 (23:42 -0800)] 
maint: remove note about old NEWS files

* NEWS: Remove mention about old fileutils, textutils, and sh-utils NEWS
files that were removed in commit 2c64bc872 (doc: only distribute 5
years of ChangeLogs, 2017-01-31).
* cfg.mk (old_NEWS_hash): Run 'make update-NEWS-hash'.

8 days agotest: re-enable tests that had a false requirement on coreutils' kill
Pádraig Brady [Fri, 28 Nov 2025 17:39:20 +0000 (17:39 +0000)] 
test: re-enable tests that had a false requirement on coreutils' kill

Recently we've not built our kill command by default,
so reduce test dependence on that.

* tests/sort/sort-compress-proc.sh: `kill -l [exit_status]` is well
supported, and is a POSIX requirement.
* tests/timeout/timeout.sh: There were actually no kill invocations
in this test at all.

8 days agotimeout: ensure we terminate command upon abnormal exit
Pádraig Brady [Fri, 28 Nov 2025 17:34:23 +0000 (17:34 +0000)] 
timeout: ensure we terminate command upon abnormal exit

* src/timeout.c (main): Use PR_SET_PDEATHSIG to ensure the
child is terminated even if the parent terminates abnormally.
* tests/timeout/timeout-group.sh: Add a case to ensure sending
SIGKILL results in the termination of the monitored command.
* NEWS: Mention the improvement.

8 days agotests: tac: test --separator with invalid UTF-8
Collin Funk [Sat, 29 Nov 2025 05:28:21 +0000 (21:28 -0800)] 
tests: tac: test --separator with invalid UTF-8

* tests/tac/tac-locale.sh: Test that a string containing invalid UTF-8
characters can be used for --separator.

8 days agodu: add the short option -A corresponding to --apparent-size
Collin Funk [Fri, 28 Nov 2025 05:33:30 +0000 (21:33 -0800)] 
du: add the short option -A corresponding to --apparent-size

The --apparent-size option to 'du' was added in
coreutils-4.5.8 (2003). FreeBSD 8.0 (2009) added the same functionality
under the short option -A. This long option previously had no short
option, so this patch adds -A to be compatible with FreeBSD.

* NEWS: Mention the new short option.
* doc/coreutils.texi: Document the short option.
* src/du.c (usage): Likewise.
(APPARENT_SIZE_OPTION): Remove definition.
(EXCLUDE_OPTION): Define to CHAR_MAX + 1.
(long_options): Use the -A short option for --apparent-size.
(main): Likewise.
* tests/du/apparent.sh: Test that '-b', '-A -B 1', and
'--apparent-size --block-size 1' function the same.

8 days agotest: tac: test with non-ASCII values for --separator
Collin Funk [Fri, 28 Nov 2025 00:55:18 +0000 (16:55 -0800)] 
test: tac: test with non-ASCII values for --separator

* tests/tac/tac-locale.sh: New test.
* tests/local.mk (all_tests): Add it.

9 days agodoc: touch: man: state in summary that files are created
Pádraig Brady [Fri, 28 Nov 2025 13:37:25 +0000 (13:37 +0000)] 
doc: touch: man: state in summary that files are created

* man/touch.x: Creating files is core functionality of touch(1),
so state this in the summary, so that apropos can be used
to search for file creation functionality.

9 days agotests: prefer ext4 casefold for case insensitive tests
Pádraig Brady [Thu, 27 Nov 2025 21:52:20 +0000 (21:52 +0000)] 
tests: prefer ext4 casefold for case insensitive tests

* tests/mv/hardlink-case.sh: Try both ext4 casefold and hfsplus,
as ext4 has better availability.
Suggested at https://github.com/coreutils/coreutils/issues/133

9 days agomaint: prefer mcel_eq to mcel_cmp
Collin Funk [Thu, 27 Nov 2025 20:14:53 +0000 (12:14 -0800)] 
maint: prefer mcel_eq to mcel_cmp

* gnulib: Update submodule to latest.
* bootstrap: Run ./bootstrap --bootstrap-sync
* src/expr.c (mbs_logical_cspn): Use mcel_eq instead of mcel_cmp.
* src/join.c (eq_tab, main): Likewise.

10 days agodoc: date: mention --file=- reads from standard input
Collin Funk [Thu, 27 Nov 2025 03:27:07 +0000 (19:27 -0800)] 
doc: date: mention --file=- reads from standard input

* src/date.c (usage): Mention that standard input will be read if
DATEFILE is "-".
Reported at https://bugs.debian.org/1100395

10 days agodoc: du, sort, wc: adjust description of --files0-from
Collin Funk [Thu, 27 Nov 2025 03:17:43 +0000 (19:17 -0800)] 
doc: du, sort, wc: adjust description of --files0-from

* src/du.c (usage): Remove an unnecessary "then".
* src/wc.c (usage): Likewise. Add a comma after "-".
* src/sort.c (usage): Likewise. Adjust the indentation to match du and
wc.

11 days agodoc: fold: clarify operation of -s in --help
Pádraig Brady [Tue, 25 Nov 2025 22:48:37 +0000 (22:48 +0000)] 
doc: fold: clarify operation of -s in --help

* src/fold.c (usage): The description of -s was unclear:
- State that we can also break within words.
- State that we split on blanks not spaces.
- State that we split after the blank, not before.

12 days agobuild: kill(1), uptime(1): don't install by default
Pádraig Brady [Mon, 24 Nov 2025 13:17:22 +0000 (13:17 +0000)] 
build: kill(1), uptime(1): don't install by default

* build-aux/gen-lists-of-programs.sh: kill and uptime are not installed
by arch, debian, fedora, suse at least, so add to disabled list.
Fixes https://github.com/coreutils/coreutils/issues/132
* NEWS: Mention the build change.

13 days agodoc: cksum: document secure hash algorithms
Collin Funk [Sun, 23 Nov 2025 20:44:23 +0000 (12:44 -0800)] 
doc: cksum: document secure hash algorithms

* doc/coreutils.texi (cksum general options): Mention hash algorithms
that are currently considered secure against malicious tampering.

13 days agodu,ls: don’t modify getenv strings
Paul Eggert [Sun, 23 Nov 2025 19:42:57 +0000 (11:42 -0800)] 
du,ls: don’t modify getenv strings

Fix du and ls to conform to the POSIX getenv spec,
which says you can’t modify strings returned by getenv
unless you put the string there directly, or used putenv.
This portability bug was found by strict C23 checking
using qualifier-generic functions.
* bootstrap.conf (gnulib_modules): Add xmemdup0.  Sort.
* src/du.c (main):
* src/ls.c (decode_switches):
Don’t modify the string that getenv returns.
Instead, use xmemdup0 if needed, and include xmemdup0.h.

13 days agonumfmt: port to C23 qualifier-generic fns
Paul Eggert [Sun, 23 Nov 2025 18:50:30 +0000 (10:50 -0800)] 
numfmt: port to C23 qualifier-generic fns

* src/numfmt.c (mbsmbchr): Cast results of qualifier-generic functions
to char *, to port to strict C23.

13 days agobuild: update gnulib submodule to latest
Paul Eggert [Sun, 23 Nov 2025 18:03:57 +0000 (10:03 -0800)] 
build: update gnulib submodule to latest

13 days agocat: refactor struct stat usage
Paul Eggert [Sun, 23 Nov 2025 18:01:12 +0000 (10:01 -0800)] 
cat: refactor struct stat usage

* src/cat.c (main): Simplify by keeping input and output
struct stat in separate local vars.

2 weeks agomaint: use cksum specific checksums in release announcement
Pádraig Brady [Sun, 23 Nov 2025 13:23:53 +0000 (13:23 +0000)] 
maint: use cksum specific checksums in release announcement

* cfg.mk: Use --cksum-checksums with announce-gen.

2 weeks agodoc: cat -E: mention ^M$ output possibility
Pádraig Brady [Sun, 23 Nov 2025 12:14:11 +0000 (12:14 +0000)] 
doc: cat -E: mention ^M$ output possibility

* src/cat.c (usage): Document the ^M$ combination
which is output for \r\n line endings.
Fixes https://github.com/coreutils/coreutils/issues/130

2 weeks agodd,ls,sort: prefer sigaction over signal
Pádraig Brady [Sat, 22 Nov 2025 13:56:15 +0000 (13:56 +0000)] 
dd,ls,sort: prefer sigaction over signal

sigaction() is generally available and if not
provided by the sigaction gnulib module.

* src/dd.c [SA_NOCLDSTOP]: Delete workarounds.
* src/ls.c: Likewise.
* src/sort.c: Likewise.
Suggested by Collin Funk.

2 weeks agocsplit,ls,sort: handle a more complete set of signals
Pádraig Brady [Fri, 21 Nov 2025 14:22:22 +0000 (14:22 +0000)] 
csplit,ls,sort: handle a more complete set of signals

* src/term-sig.h: A new file defining a TERM_SIG array signals.
* src/local.mk: Reference the new file.
* src/csplit.c: Likewise.
* src/sort.c: Likewise.
* src/timeout.c: Likewise.
* src/ls.c: Likewise.  Also handle SIGTSTP separately.
* NEWS: Mention the improvement.

2 weeks agotimeout: honor ignored signal dispositions
Pádraig Brady [Fri, 21 Nov 2025 11:43:35 +0000 (11:43 +0000)] 
timeout: honor ignored signal dispositions

This behavior was depended on in our trap_sigpipe_or_skip_ helper,
and now that we're handling all terminating signals, we should
consistently honor their ignored signal dispositions.

* NEWS: Mention the change in behavior, especially in regard
to shell background jobs.
* src/timeout.c (sig_needs_handling): A new helper that return TRUE,
for --signal, SIG_ALRM, or non ignored signals.
(cleanup_install): Filter handled signals with the helper.
(block_cleanup_and_chld): Likewise.
* tests/timeout/timeout-group.sh: Adjust to use the now required
`env --default-signal=...` wrapper to reset (auto) ignored signals.
Also change the termination signal from SIGINT to SIGUSR1
to generalize the test signals not specially handled by the shell,
and newly handled by timeout(1).
* tests/timeout/timeout.sh: Add a test case for SIGPIPE
to ensure the ignored signal disposition is honored.

2 weeks agotimeout: handle all terminating signals
Pádraig Brady [Thu, 20 Nov 2025 16:02:43 +0000 (16:02 +0000)] 
timeout: handle all terminating signals

* src/timeout.c (term_sig): A new global list of all signals
whose default disposition is to terminate the process.
(install_cleanup): Iterate over the TERM_SIG list, rather than
installing the handler for a specific subset.
(block_cleanup_and_chld): Likewise.
* tests/timeout/timeout.sh: Add a test case for SIGPIPE.
* NEWS: Mention the bug fix.

2 weeks agobuild: remove explicit link to CoreFoundation libs on macOS
Pádraig Brady [Thu, 20 Nov 2025 10:43:06 +0000 (10:43 +0000)] 
build: remove explicit link to CoreFoundation libs on macOS

* src/local.mk: No longer explicitly depend on @INTL_MACOS_LIBS@
as they're no longer implicitly referenced (in LIBINTL) without gettext.
The old dependency was through localename-unsafe, specifically
date, du through show-date() (fprintftime), and
ls, pr, stat, uptime through strftime().
gnulib commit v1.0-2439-gff4b084a68 removed the localename-unsafe
dependency on macOS.

2 weeks agobuild: update gnulib submodule to latest
Pádraig Brady [Thu, 20 Nov 2025 10:40:19 +0000 (10:40 +0000)] 
build: update gnulib submodule to latest

2 weeks agomaint: add coreutils_hardlinks to src/.gitignore
Collin Funk [Thu, 20 Nov 2025 03:08:49 +0000 (19:08 -0800)] 
maint: add coreutils_hardlinks to src/.gitignore

* src/.gitignore (coreutils_hardlinks): Ignore this file. It is an empty
file created when --enable-single-binary=hardlinks is used to ensure
hardlinks are created after the multicall binary.

2 weeks agomaint: prefer MAYBE_UNUSED to void casts
Collin Funk [Wed, 19 Nov 2025 03:07:21 +0000 (19:07 -0800)] 
maint: prefer MAYBE_UNUSED to void casts

* src/copy.c (clone_file, set_author): Use MAYBE_UNUSED in the prototype
instead of void casting the arguments.

2 weeks agobuild: support --enable-single-binary=hardlinks
Pádraig Brady [Tue, 18 Nov 2025 15:30:26 +0000 (15:30 +0000)] 
build: support --enable-single-binary=hardlinks

* Makefile.am: Use ln rather than $(LN_S) for hardlinks.
* configure.ac: Accept --enable-single-binary=hardlinks.
* man/local.mk: In hardlink mode, explicitly add the
hardlink creation rule to mandeps.  Given the automake
generated dependency chain, this ensures that the hardlinks
are created _after_ the multicall binary, with `make all`
or `make check` etc.
* src/local.mk: Define the new src/coreutils_hardlinks rule,
and only depend on src/coreutils_{symlinks,shebangs} if
in those modes, so that hardlinks are created _after_
the multicall binary, and other link types before.
* NEWS: Mention the new feature.
Addresses https://github.com/coreutils/coreutils/issues/129

2 weeks agotests: check that mknod, mkfifo, and mkdir handle comma-separated modes
Collin Funk [Mon, 17 Nov 2025 05:23:18 +0000 (21:23 -0800)] 
tests: check that mknod, mkfifo, and mkdir handle comma-separated modes

* tests/misc/mknod.sh: Test that mknod, mkfifo, and mkdir parse
comma-separated mode strings.

2 weeks agotests: install supports comma-separated mode strings
Sylvestre Ledru [Sun, 16 Nov 2025 22:19:14 +0000 (23:19 +0100)] 
tests: install supports comma-separated mode strings

Identified here:
<https://github.com/uutils/coreutils/pull/9298>

* tests/install/basic-1.sh: Add the check.

2 weeks agomaint: use C99 initialization syntax for single-variable 'for' loops
Collin Funk [Mon, 17 Nov 2025 04:23:30 +0000 (20:23 -0800)] 
maint: use C99 initialization syntax for single-variable 'for' loops

* src/chroot.c (parse_additional_groups): Declare variable in the 'for'
clause.
* src/comm.c (compare_files): Likewise.
* src/cp.c (re_protect): Likewise.
* src/csplit.c (save_buffer, find_line, write_to_file)
(split_file, main): Likewise.
* src/dd.c (apply_translations, translate_buffer)
(copy_with_block, main): Likewise.
* src/df.c (selected_fstype, excluded_fstype, filter_mount_list)
(last_device_for_mount, get_device, get_point, get_all_entries)
(main): Likewise.
* src/fmt.c (copy_rest, get_prefix, fmt_paragraph, put_paragraph)
(put_word): Likewise.
* src/fold.c (main): Likewise.
* src/head.c (elide_tail_bytes_pipe, main): Likewise.
* src/install.c (main): Likewise.
* src/join.c (prfields, join, main): Likewise.
* src/kill.c (list_signals): Likewise.
* src/ls.c (main, decode_switches, parse_ls_color, patterns_match):
Likewise.
* src/operand2sig.c (operand2sig): Likewise.
* src/pathchk.c (no_leading_hyphen, validate_file_name): Likewise.
* src/pr.c (char_to_clump): Likewise.
* src/printenv.c (main): Likewise.
* src/ptx.c (initialize_regex, digest_break_file)
(find_occurs_in_text, print_field): Likewise.
* src/remove.c (mark_ancestor_dirs): Likewise.
* src/seq.c (print_numbers): Likewise.
* src/shred.c (do_wipefd, main): Likewise.
* src/sort.c (cleanup, inittables, key_warnings, mergefps)
(check_ordering_compatibility, main): Likewise.
* src/split.c (closeout): Likewise.
* src/stat.c (find_bind_mount, print_it, format_to_mask): Likewise.
* src/stdbuf.c (set_program_path): Likewise.
* src/stty.c (apply_settings, display_changed, display_all)
(recover_mode, sane_mode): Likewise.
* src/system.h (stzncpy): Likewise.
* src/tail.c (pipe_lines): Likewise.
* src/tee.c (tee_files): Likewise.
* src/tr.c (look_up_char_class, get_spec_stats): Likewise.
* src/users.c (list_entries_users): Likewise.

2 weeks agobuild: fix make dist failure
Pádraig Brady [Mon, 17 Nov 2025 19:57:16 +0000 (19:57 +0000)] 
build: fix make dist failure

* src/local.mk: s/crc.h/cksum_crc.h/.
Reported by Bruno Haible.

2 weeks agotests: use tail --debug to determine inotify support
Pádraig Brady [Fri, 14 Nov 2025 17:03:38 +0000 (17:03 +0000)] 
tests: use tail --debug to determine inotify support

* init.cfg (require_inotify_supported_): A new function that
indicates inotify support for a file in the current directory,
using tail --debug, rather than awkward strace checks etc.
* tests/tail/inotify-dir-recreate.sh: Call require_inotify_supported_.
 tests/tail/inotify-only-regular.sh: Likewise.
 tests/tail/inotify-race.sh: Likewise.
 tests/tail/inotify-race2.sh: Likewise.

2 weeks agotail: add --debug to report the --follow implementation
Pádraig Brady [Fri, 14 Nov 2025 16:26:43 +0000 (16:26 +0000)] 
tail: add --debug to report the --follow implementation

* doc/coreutils.texi (tail invocation): Describe --debug.
* src/tail.c (tail_forever, tail_forever_inotify): Output
which --follow implementation is being used.
* tests/tail/debug.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.

2 weeks agomaint: convert remove a K&R declaration
Collin Funk [Mon, 17 Nov 2025 00:59:43 +0000 (16:59 -0800)] 
maint: convert remove a K&R declaration

This function is hidden unless EVAL_TRACE is defined for debugging.

* src/expr.c (trace): Convert to a prototype instead of K&R definition
to avoid -Werror=strict-prototypes. Make the argument const to avoid
-Werror=discarded-qualifiers.

2 weeks agodu: document the TIME_STYLE env variable in usage
Bernhard Voelker [Sun, 16 Nov 2025 17:24:47 +0000 (18:24 +0100)] 
du: document the TIME_STYLE env variable in usage

The impact of the TIME_STYLE environment variable on du(1) was only
documented in the Texinfo manual.  To avoid surprises for users,
also mention TIME_STYLE in the usage text, i.e., for --help and man.
Organize similar as in ls(1), but as du(1) has slightly different
behavior it would be hard to share the translation.

* src/du.c (usage): Shorten the description of --time-style, and refer
to an additional --time-style / TIME_STYLE description below.

2 weeks agotests: verify we document all supported options in --help
Pádraig Brady [Fri, 14 Nov 2025 23:44:30 +0000 (23:44 +0000)] 
tests: verify we document all supported options in --help

* tests/misc/getopt_vs_usage.sh: A new test which checks the
converse of usage_vs_getopt.sh
* tests/local.mk: Reference the new test.

2 weeks agomaint: tag supported options not documented in --help
Pádraig Brady [Sat, 15 Nov 2025 13:42:51 +0000 (13:42 +0000)] 
maint: tag supported options not documented in --help

2 weeks agomaint: rearrange cksum modules so main is in cksum.c
Pádraig Brady [Sat, 15 Nov 2025 13:21:10 +0000 (13:21 +0000)] 
maint: rearrange cksum modules so main is in cksum.c

* src/cksum.c: -> src/cksum_crc.c
* src/cksum.h: -> src/cksum_crc.h
* src/digest.c: -> src/cksum.c
* src/local.mk: Adjust accordingly.
* cfg.mk: Likewise.
* po/POTFILES.in: Likewise.
* src/cksum_avx2.c: Likewise.
* src/cksum_avx512.c: Likewise.
* src/cksum_pclmul.c: Likewise.
* src/cksum_vmull.c: Likewise.

2 weeks agowc: fix missing documentation for the --debug option
Pádraig Brady [Fri, 14 Nov 2025 17:21:00 +0000 (17:21 +0000)] 
wc: fix missing documentation for the --debug option

* doc/coreutils.texi (wc invocation): Desscribe --debug.
* src/wc.c (usage): Likewise.
* NEWS: Mention the bug fix.

3 weeks agotests: install should ignore umask
Sylvestre Ledru [Sat, 15 Nov 2025 21:24:04 +0000 (22:24 +0100)] 
tests: install should ignore umask

Identified here:
<https://github.com/uutils/coreutils/pull/9254>

  * tests/install/basic-1.sh: Add the check.

3 weeks agotests: pr: add a test for bounded memory operation
Collin Funk [Sat, 15 Nov 2025 08:32:48 +0000 (00:32 -0800)] 
tests: pr: add a test for bounded memory operation

* tests/pr/bounded-memory.sh: New file.
* tests/local.mk (all_tests): Add the test.

3 weeks agotests: dd: add tests for conv=lcase and conv=ucase
Collin Funk [Fri, 14 Nov 2025 10:55:44 +0000 (02:55 -0800)] 
tests: dd: add tests for conv=lcase and conv=ucase

* tests/dd/conv-case.sh: New test.
* tests/local.mk (all_tests): Add it.

3 weeks agodoc: shred: clarify what --verbose outputs
Pádraig Brady [Fri, 14 Nov 2025 13:23:09 +0000 (13:23 +0000)] 
doc: shred: clarify what --verbose outputs

* doc/coreutils.texi (shred invocation): Give more details on what
--verbose outputs, to give some indication of its utility.
* src/shred.c (usage): Likewise.  Also since we're changing the string,
split out translations to give translators more granular translations.

3 weeks agotests: test: add test cases for -ef
Collin Funk [Thu, 13 Nov 2025 03:58:52 +0000 (19:58 -0800)] 
tests: test: add test cases for -ef

* tests/test/test-file.sh: Check that -ef works as expected on files,
symbolic links, and hard links.

3 weeks agomaint: fix a typo in comments
Collin Funk [Wed, 12 Nov 2025 18:59:08 +0000 (10:59 -0800)] 
maint: fix a typo in comments

* tests/date/reference.sh: Fix typo; s/modiication/modification.

3 weeks agotests: test: add test cases for -nt and -ot
Collin Funk [Wed, 12 Nov 2025 04:07:52 +0000 (20:07 -0800)] 
tests: test: add test cases for -nt and -ot

* tests/test/test-file.sh: Check that -nt and -ot work properly when
files may or may not exist.

3 weeks agosort: avoid pthread calls with --parallel=1
Pádraig Brady [Mon, 10 Nov 2025 23:17:24 +0000 (23:17 +0000)] 
sort: avoid pthread calls with --parallel=1

Before this change there were the following unneeded pthread calls:

  $ seq 1e6 | ltrace -c -e 'pthread*' sort --parallel=1 | wc -l
  % time     seconds  usecs/call     calls      function
  ------ ----------- ----------- --------- --------------------
   39.13    0.031757          67       468 pthread_mutex_lock
   37.96    0.030811          65       468 pthread_mutex_unlock
   13.17    0.010691          65       162 pthread_cond_signal
    2.15    0.001747          64        27 pthread_mutex_destroy
    2.00    0.001620          60        27 pthread_mutex_init
    0.70    0.000565          62         9 pthread_cond_destroy
    0.64    0.000518          57         9 pthread_cond_init
  ------ ----------- ----------- --------- --------------------
  100.00    0.081159                  1170 total

* src/sort.c (sort): Avoid merge tree overhead when single threaded.

3 weeks agomd5sum: fix --text with the MSYS2 runtime
Pádraig Brady [Fri, 7 Nov 2025 13:55:39 +0000 (13:55 +0000)] 
md5sum: fix --text with the MSYS2 runtime

Note the use of "rt" is non-standard, but we're restricting
its use here to systems that define O_BINARY, which should
invariably support "rt" mode.

* src/digest.c (): Where significant, explicitly use "rt" mode
with --text, as MSYS2 defaults to binary mode for fopen'd files
(though not for standard streams).
* NEWS: Mention the bug fix.
Fixes https://github.com/coreutils/coreutils/issues/123

3 weeks agomaint: fix comment re PRLFS' remoteness
Pádraig Brady [Wed, 12 Nov 2025 14:06:44 +0000 (14:06 +0000)] 
maint: fix comment re PRLFS' remoteness

* src/stat.c (human_fstype): prlfs is used in a context of
separate host and guest OS, so should be treated as remote always.

3 weeks agotests: env --argv0: fix false failure with symlinked single binary
Pádraig Brady [Wed, 12 Nov 2025 13:25:26 +0000 (13:25 +0000)] 
tests: env --argv0: fix false failure with symlinked single binary

* tests/env/env.sh: Always pass --coreutils-prog=true so that the
program to run can be determined with --enable-single-binary=symlinks.
Also actually verify the expected verbose output.
Reported by the Alpine Linux project.

3 weeks agomaint: fix a comment in the generated src/fs-is-local.h file
Collin Funk [Tue, 11 Nov 2025 23:37:44 +0000 (15:37 -0800)] 
maint: fix a comment in the generated src/fs-is-local.h file

Reported by Bruno Haible in
<https://lists.gnu.org/r/coreutils/2025-11/msg00113.html>.

* src/extract-magic ($magic_comment): Mention that the function returns
1 if the file system is local and 0 if it is remote.

3 weeks agotests: add tests for locale ordering
Pádraig Brady [Fri, 7 Nov 2025 20:49:25 +0000 (20:49 +0000)] 
tests: add tests for locale ordering

* tests/sort/sort-locale.sh: Check sort,ls have the same (non C) order.
* tests/local.mk: Reference the new test.

3 weeks agomaint: post-release administrivia
Pádraig Brady [Mon, 10 Nov 2025 13:54:30 +0000 (13:54 +0000)] 
maint: post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

3 weeks agoversion 9.9 v9.9
Pádraig Brady [Mon, 10 Nov 2025 13:21:59 +0000 (13:21 +0000)] 
version 9.9

* NEWS: Record release date.

3 weeks agonice: clamp the niceness correctly on GNU/Hurd
Collin Funk [Sun, 9 Nov 2025 04:30:08 +0000 (20:30 -0800)] 
nice: clamp the niceness correctly on GNU/Hurd

* NEWS: Mention the bug fix.
* src/nice.c (MIN_ADJUSTMENT): Set to 0 on the Hurd with glibc ≤ 2.42.
(MAX_ADJUSTMENT): Set to (2 * NZERO - 2) on the Hurd with glibc ≤ 2.42.
(main): Clamp the niceness to be greater or equal to MIN_ADJUSTMENT and
less than or equal to MAX_ADJUSTMENT.
* tests/nice/nice.sh: Add some tests for the Hurd's ranges.

4 weeks agotests: tail: avoid a test failure on GNU/Hurd
Collin Funk [Sat, 8 Nov 2025 06:15:37 +0000 (22:15 -0800)] 
tests: tail: avoid a test failure on GNU/Hurd

* tests/tail/tail-c.sh: Allow 'tail -c 4096 /dev/urandom' to run forever
on GNU/Hurd since lseek fails with ESPIPE.

4 weeks agochcon: fix memory leak in error path
Pádraig Brady [Sat, 8 Nov 2025 10:32:14 +0000 (10:32 +0000)] 
chcon: fix memory leak in error path

* src/chcon.c (change_file_context): If compute_context_from_mask fails,
free the previously allocated file_context.
Fixes https://bugs.gnu.org/79780

4 weeks agotests: avoid false failure due to small timeout
Pádraig Brady [Sat, 8 Nov 2025 10:14:38 +0000 (10:14 +0000)] 
tests: avoid false failure due to small timeout

* tests/tail/tail-c.sh: Tests that fail after a timeout
should use as least 10s to avoid intermittent failures
on slow/loaded hosts.

4 weeks agobuild: update gnulib submodule to latest
Collin Funk [Sat, 8 Nov 2025 04:25:47 +0000 (20:25 -0800)] 
build: update gnulib submodule to latest

4 weeks agoinstall: fix crash with --strip and large $PATH on ppc and sparc
Pádraig Brady [Fri, 7 Nov 2025 16:14:12 +0000 (16:14 +0000)] 
install: fix crash with --strip and large $PATH on ppc and sparc

* gnulib: Update to the latest gnulib to pull in the fix
(v1.0-2406-g89f63027de) to allocate the $PATH processing memory
before the vfork call, which is required on ppc and sparc.
* tests/install/basic-1.sh: Ensure posix_spawnp() suports a large $PATH,
which needs careful handling with vfork() as detailed in gnulib.

4 weeks agodoc: cksum: clarify support of --text and --binary
Pádraig Brady [Fri, 7 Nov 2025 14:38:51 +0000 (14:38 +0000)] 
doc: cksum: clarify support of --text and --binary

Make the documentation more accurate following v9.3-80-g5e1e0993b

* doc/coreutils.texi (cksum common options): State that --text and
--binary are actually supported, but only to support emulation
of the legacy utils.

4 weeks agotests: wc: protect against a hang on GNU/Hurd
Collin Funk [Fri, 7 Nov 2025 00:52:03 +0000 (16:52 -0800)] 
tests: wc: protect against a hang on GNU/Hurd

Reported by Bruno Haible in
<https://lists.gnu.org/r/coreutils/2025-11/msg00051.html>.

* tests/wc/wc-total.sh: Skip a test that would exhaust memory on
GNU/Hurd.

4 weeks agognulib: update to latest
Pádraig Brady [Wed, 5 Nov 2025 18:39:06 +0000 (18:39 +0000)] 
gnulib: update to latest

* NEWS: Mention the nproc build fix for older Android.

4 weeks agodoc: mention nanosecond decimal points with --iso-8601=ns
Collin Funk [Tue, 4 Nov 2025 03:47:52 +0000 (19:47 -0800)] 
doc: mention nanosecond decimal points with --iso-8601=ns

Many people are used to seeing ISO 8601 dates using a period separating
seconds and nanoseconds. This behavior seems to be worth documenting
given the bug reports:
https://bugs.gnu.org/63119
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1118970

* doc/coreutils.texi (Options for date): Mention that
'date --iso-8601=ns' uses a comma as a separator, following the
preference of ISO 8601. Give an example of how to get an ISO 8601 date
with a period separator.

4 weeks agomaint: adjust lseek_copy to handle non zero offsets
Pádraig Brady [Mon, 3 Nov 2025 22:42:22 +0000 (22:42 +0000)] 
maint: adjust lseek_copy to handle non zero offsets

* src/copy-file-data.c (lseek_copy): hole_start is initialized
only when ext_start == ipos.
(infer_scantype): Update the hole_start initialization to
the more logically correct POS, even though that init
is only needed to suppress a -Wmaybe-uninitialized warning.
Note gcc 15.2 at least doesn't seem to need that suppression.

4 weeks agotests: avoid skipping of LD_PRELOAD based df tests
Bernhard Voelker [Sat, 1 Nov 2025 21:27:59 +0000 (22:27 +0100)] 
tests: avoid skipping of LD_PRELOAD based df tests

It was seen that gnulib's read_file_system_list may use fopen instead
of open.  Adjust the df(1) tests to replace both library functions.

* tests/df/no-mtab-status.sh: Change the shared library code invoked
via LD_PRELOAD to override both fopen and open.  While at it, perform
varargs processing only when path is not "/proc/self/mountinfo".
* tests/df/skip-duplicates.sh: Likewise.

4 weeks agotests: avoid skipping by fixing build of shared libraries
Bernhard Voelker [Sat, 1 Nov 2025 19:32:21 +0000 (20:32 +0100)] 
tests: avoid skipping by fixing build of shared libraries

Two df(1) tests were skipped (since commit ee367bd38dac), because
the build of the shared library in those tests failed.

  + gcc -Wall -shared --std=gnu99 -fPIC -O2 k.c -o k.so -ldl
  k.c: In function 'open':
  k.c:37:7: error: implicit declaration of function 'streq'; did you \
  mean 'strsep'? [-Wimplicit-function-declaration]
     37 |   if (streq (path, "/proc/self/mountinfo"))
        |       ^~~~~
        |       strsep

Gnulib streq is not available in the tests.

* tests/df/no-mtab-status.sh: Replace "streq" by "0==strcmp" in the
shared library source.
* tests/df/skip-duplicates.sh: Likewise.

4 weeks agotests: date: check that write errors are promptly diagnosed
Collin Funk [Mon, 3 Nov 2025 06:36:31 +0000 (22:36 -0800)] 
tests: date: check that write errors are promptly diagnosed

This improvement is due to changes to Gnulib's fprintftime module.

* NEWS: Mention the improvement.
* src/getlimits.c (OFF64_T_MAX, OFF64_T_MIN): New macros.
(main): Print them.
* tests/misc/write-errors.sh: Call getlimits_. Add a date invocation.

4 weeks agodoc: squashfs issue to be squashed in Linux 6.18
Paul Eggert [Mon, 3 Nov 2025 19:33:38 +0000 (11:33 -0800)] 
doc: squashfs issue to be squashed in Linux 6.18

4 weeks agotests: truncate: ensure negative args not parsed as options
Pádraig Brady [Mon, 3 Nov 2025 13:51:14 +0000 (13:51 +0000)] 
tests: truncate: ensure negative args not parsed as options

* tests/truncate/truncate-parameters.sh: Add a test case.

4 weeks agodate: avoid a duplicated write error diagnotic
Pádraig Brady [Mon, 3 Nov 2025 13:00:32 +0000 (13:00 +0000)] 
date: avoid a duplicated write error diagnotic

* src/show-date.c (show_date): Only show the fprintftime() diagnostic
if a further diagnostic will not be shown.

4 weeks agodate: translate/clarify recent error message
Pádraig Brady [Mon, 3 Nov 2025 12:55:35 +0000 (12:55 +0000)] 
date: translate/clarify recent error message

* src/show-date.c (show_date): Flagged by syntax-check.

4 weeks agodate: promptly diagnose write errors with --file
Pádraig Brady [Mon, 3 Nov 2025 12:44:07 +0000 (12:44 +0000)] 
date: promptly diagnose write errors with --file

* src/date.c (batch_convert): Check error state of stdout
after each date is processed.
* tests/misc/write-errors.sh: Add a test case.

4 weeks agotests: stty: filter out ispeed and ospeed from boolean options
Collin Funk [Sun, 2 Nov 2025 18:57:21 +0000 (10:57 -0800)] 
tests: stty: filter out ispeed and ospeed from boolean options

* tests/stty/stty-pairs.sh: Also ignore lines starting with ispeed and
ospeed.
* tests/stty/stty.sh: Likewise.
Reported by Bernhard Voelker.

5 weeks agodate: diagnose fprintftime failure
Paul Eggert [Sat, 1 Nov 2025 23:44:43 +0000 (17:44 -0600)] 
date: diagnose fprintftime failure

* src/show-date.c (show_date): Diagnose fprintftime failure,
as it need not be an output error.

5 weeks agopr: improve nstrftime failure check
Paul Eggert [Sat, 1 Nov 2025 23:42:59 +0000 (17:42 -0600)] 
pr: improve nstrftime failure check

* src/pr.c (init_header): Do not report an nstrftime EOVERFLOW
error as memory exhaustion.  Instead, output the time as an
integer.  Also, work even if nstrftime (nullptr, SIZE_MAX, ...)
would return PTRDIFF_MAX which means adding 1 would overflow..

5 weeks agols: better nstrftime failure check
Paul Eggert [Sat, 1 Nov 2025 23:39:07 +0000 (17:39 -0600)] 
ls: better nstrftime failure check

* src/ls.c (print_long_format): Streamline the checking
for failure of nstrftime.