]> git.ipfire.org Git - thirdparty/coreutils.git/log
thirdparty/coreutils.git
8 weeks 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

8 weeks 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.

8 weeks 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.

8 weeks 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.

8 weeks 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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.

2 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

2 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.

2 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.

2 months agodoc: expand on shell-escape quoting style
Pádraig Brady [Fri, 12 Dec 2025 16:41:36 +0000 (16:41 +0000)] 
doc: expand on shell-escape quoting style

* doc/coreutils.texi (quotingStyles): Expand on the advantages
of "shell-escape" quoting, and mention it's the default when
outputting to a tty. Also mention how it's also useful with
LC_ALL=C to further disambiguate output.  Also reference the
separate page detailing various considerations and options
for file name quoting.  Also move the mention of the default
quoting style to the top of the page where it's more obvious.

2 months agotests: printf: add case for quoting single quotes
Pádraig Brady [Fri, 12 Dec 2025 14:15:58 +0000 (14:15 +0000)] 
tests: printf: add case for quoting single quotes

* tests/printf/printf-quote.sh: Add a test case for
https://bugs.debian.org/992161 which was fixed with
gnulib commit v0.1-7339-g07b31a9465

2 months agomaint: organize tee tests in a subdirectory
Collin Funk [Thu, 11 Dec 2025 04:08:01 +0000 (20:08 -0800)] 
maint: organize tee tests in a subdirectory

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

2 months agotests: tee: add a test for --append
Collin Funk [Thu, 11 Dec 2025 04:05:58 +0000 (20:05 -0800)] 
tests: tee: add a test for --append

* tests/tee/append.sh: New file.
* tests/local.mk (all_tests): Add the test.

2 months agotests: fix recent portability issue with printf
Pádraig Brady [Thu, 11 Dec 2025 22:02:55 +0000 (22:02 +0000)] 
tests: fix recent portability issue with printf

* tests/sort/sort-locale.sh: Avoid non portable printf \u....
* cfg.mk (sc_env_printf): Add a new syntax check to flag future cases.

2 months agotests: env: ensure non-utf8 name or value is supported
Pádraig Brady [Thu, 11 Dec 2025 21:19:19 +0000 (21:19 +0000)] 
tests: env: ensure non-utf8 name or value is supported

* tests/env/env.sh: Add a test case ensuring non-utf8 characters
in the name or value are supported.

2 months agotests: mv: ensure ownership preserved when copying
Pádraig Brady [Thu, 11 Dec 2025 20:17:20 +0000 (20:17 +0000)] 
tests: mv: ensure ownership preserved when copying

* tests/mv/meta-to-xpart.sh: Add new test.
* tests/local.mk: Reference new test.

2 months agomaint: groups: reduce variable scope
Collin Funk [Wed, 10 Dec 2025 05:48:50 +0000 (21:48 -0800)] 
maint: groups: reduce variable scope

* src/groups.c (main): Declare variables where they are used instead of
at the start of the function. Convert a comment to GNU style.

2 months agomaint: printenv: reduce variable scope
Collin Funk [Wed, 10 Dec 2025 05:45:26 +0000 (21:45 -0800)] 
maint: printenv: reduce variable scope

* src/printenv.c (main): Declare variables where they are used instead
of at the start of the function. Constify some strings we do not modify.

2 months agomaint: rmdir: reduce variable scope
Collin Funk [Wed, 10 Dec 2025 05:43:11 +0000 (21:43 -0800)] 
maint: rmdir: reduce variable scope

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

2 months agomaint: date: reduce variable scope
Collin Funk [Wed, 10 Dec 2025 05:37:50 +0000 (21:37 -0800)] 
maint: date: reduce variable scope

* src/date.c (batch_convert, main): Declare variables where they are
used instead of at the start of the function.

2 months agomaint: install: reduce variable scope
Collin Funk [Wed, 10 Dec 2025 05:13:10 +0000 (21:13 -0800)] 
maint: install: reduce variable scope

* src/install.c (change_timestamps): Initialize variables where they are
declared.
(need_copy, setdefaultfilecon, get_ids, mkancesdirs_safe_wd, main):
Declare variables where they are used instead of at the start of the
block.

2 months agomaint: cp: reduce variable scope
Collin Funk [Wed, 10 Dec 2025 05:05:22 +0000 (21:05 -0800)] 
maint: cp: reduce variable scope

* src/cp.c (re_protect): Initialize variables where they are declared.
(make_dir_parents_private, do_copy, main): Declare variables where they
are used instead of at the start of the block.

2 months agomaint: mv: reduce variable scope
Collin Funk [Wed, 10 Dec 2025 04:45:51 +0000 (20:45 -0800)] 
maint: mv: reduce variable scope

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

2 months agotests: env: add a test for --ignore-signal=PIPE
Pádraig Brady [Wed, 10 Dec 2025 22:41:42 +0000 (22:41 +0000)] 
tests: env: add a test for --ignore-signal=PIPE

* tests/env/env-signal-handler.sh: Add a test for this
oft interfered with signal.

2 months agodoc: support html post processing in all cases
Pádraig Brady [Tue, 9 Dec 2025 17:07:13 +0000 (17:07 +0000)] 
doc: support html post processing in all cases

Previously the html-local make rule only worked for `make html`.
Instead add support for `make doc/coreutils.html` or `make web-manual`
through the use of a makeinfo wrapper.

* doc/local.mk: Move post processing from here to ...
* build-aux/makeinfo-wrapper.sh: ... here.
* cfg.mk: Ensure our wrapper is called with MAKEINFO.
Also pass --no-node-files so redirection html files
are not created for each anchor.

2 months agodoc: printf: mention how to print arguments starting with '-'
Collin Funk [Tue, 9 Dec 2025 04:15:07 +0000 (20:15 -0800)] 
doc: printf: mention how to print arguments starting with '-'

* doc/coreutils.texi (printDash): New macro.
(printf invocation, yes invocation): Use it.
Addresses https://bugs.gnu.org/79896

2 months agodoc: fix stale linuxjournal.com link
Pádraig Brady [Tue, 9 Dec 2025 14:10:58 +0000 (14:10 +0000)] 
doc: fix stale linuxjournal.com link

* doc/coreutils.texi: Update to working link.
Fixes https://bugs.gnu.org/79973

2 months agodoc: html: fix build with parallel make
Collin Funk [Tue, 9 Dec 2025 13:17:33 +0000 (13:17 +0000)] 
doc: html: fix build with parallel make

* doc/local.mk (html-local): Add html files to prerequisites so they are
generated before 'sed' is invoked.  Also interate over the already
populated $(HTMLS) to be more general (to multiple html files),
and more portable (to non GNU make).

2 months agotests: fix non-portable use of printf '\x..'
Pádraig Brady [Mon, 8 Dec 2025 22:32:48 +0000 (22:32 +0000)] 
tests: fix non-portable use of printf '\x..'

* tests/dd/conv-case.sh: Use octal instead.
* tests/ls/hyperlink.sh: Likewise.
* tests/sort/sort-locale.sh: Likewise.

2 months agodoc: fix pdf generation
Pádraig Brady [Mon, 8 Dec 2025 14:15:00 +0000 (14:15 +0000)] 
doc: fix pdf generation

* doc/coreutils.texi: Explicitly supply empty arguments to macros,
as dvi (a required prerequisite to pdf) is more strict in its
handling of macro arguments.
* cfg.mk (sc_texi_ensure_empty_option_args): Add a syntax check,
since this is not verified in the default build.
Reported by Collin Funk.

2 months agomaint: env: reduce variable scope
Collin Funk [Sun, 7 Dec 2025 23:48:15 +0000 (15:48 -0800)] 
maint: env: reduce variable scope

* src/env.c (extract_varname, parse_signal_action_params)
(parse_block_signal_params, set_signal_proc_mask)
(list_signal_handling, main): Declare variables where they are used
instead of at the start of the function.

2 months agomaint: nohup: reduce variable scope
Collin Funk [Sun, 7 Dec 2025 23:47:24 +0000 (15:47 -0800)] 
maint: nohup: reduce variable scope

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

2 months agomaint: sync: reduce variable scope
Collin Funk [Sun, 7 Dec 2025 23:35:48 +0000 (15:35 -0800)] 
maint: sync: reduce variable scope

* src/sync.c (sync_arg, main): Declare variables where they are used
instead of at the start of the function.

2 months agomaint: pwd: reduce variable scope
Collin Funk [Sun, 7 Dec 2025 23:27:29 +0000 (15:27 -0800)] 
maint: pwd: reduce variable scope

* src/pwd.c (find_dir_entry, robust_getcwd): Declare variables where
they are used.
(logical_getcwd, main): Likewise. Constify the result of getenv, since
the result cannot be modified.

2 months agomaint: dirname: reduce variable scope
Collin Funk [Sun, 7 Dec 2025 23:17:21 +0000 (15:17 -0800)] 
maint: dirname: reduce variable scope

* src/dirname.c (main): Declare variables where they are used instead of
at the start of the function. Prefer idx_t to size_t.

2 months agomaint: hostid: reduce variable scope
Collin Funk [Sun, 7 Dec 2025 23:11:55 +0000 (15:11 -0800)] 
maint: hostid: reduce variable scope

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

2 months agomaint: nproc: reduce variable scope
Collin Funk [Sun, 7 Dec 2025 23:06:24 +0000 (15:06 -0800)] 
maint: nproc: reduce variable scope

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

2 months agomaint: whoami: reduce variable scope
Collin Funk [Sun, 7 Dec 2025 23:03:00 +0000 (15:03 -0800)] 
maint: whoami: reduce variable scope

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

2 months agomaint: logname: reduce variable scope
Collin Funk [Sun, 7 Dec 2025 22:59:19 +0000 (14:59 -0800)] 
maint: logname: reduce variable scope

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

2 months agomaint: basename: initialize values while declaring
Collin Funk [Sun, 7 Dec 2025 22:55:18 +0000 (14:55 -0800)] 
maint: basename: initialize values while declaring

* src/basename.c (remove_suffix): Initialize values on the same line as
their declarations.

2 months agoshred: use gethrxtime instead of time
Collin Funk [Sun, 7 Dec 2025 01:19:55 +0000 (17:19 -0800)] 
shred: use gethrxtime instead of time

The gethrxtime function uses a monotonic clock if available on the
system. The effect should be unnoticeable since we print --verbose
information every 5 seconds, but is more correct and we already do the
same in 'dd'.

* src/local.mk (src_shred_LDADD): Add $(GETHRXTIME_LIB).
* src/shred.c (dopass): Use xtime_t instead of time_t. Use gethrxtime
instead of time.

2 months agotests: tac-continue.sh: modernise and always execute as root
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

2 months 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.

2 months 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.

2 months 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 months 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 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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

2 months 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

2 months 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.

2 months 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

2 months 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.

2 months 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

2 months 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.

2 months 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.

2 months 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'.

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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

2 months 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.

2 months 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

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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.

2 months 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

2 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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

3 months 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.

3 months 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.

3 months 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.

3 months 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.