]> git.ipfire.org Git - thirdparty/coreutils.git/log
thirdparty/coreutils.git
4 weeks agowc: improve aarch64 Neon optimization for 'wc -l'
Collin Funk [Tue, 10 Mar 2026 02:32:27 +0000 (19:32 -0700)] 
wc: improve aarch64 Neon optimization for 'wc -l'

    $ yes abcdefghijklmnopqrstuvwxyz | head -n 200000000 > input
    $ time ./src/wc-prev -l input
    200000000 input

    real 0m1.240s
    user 0m0.456s
    sys 0m0.784s
    $ time ./src/wc -l input
    200000000 input

    real 0m0.936s
    user 0m0.141s
    sys 0m0.795s

* configure.ac: Use unsigned char for the buffer to avoid potential
compiler warnings. Check for the functions being used in src/wc_neon.c
after this patch.
* src/wc_neon.c (wc_lines_neon): Use vreinterpretq_s8_u8 to convert 0xff
into -1 instead of bitwise AND instructions into convert it into 1.
Perform the pairwise addition and lane extraction once every 8192 bytes
instead of once every 64 bytes.
Thanks to Lasse Collin for spotting this and reviewing a draft of this
patch.

4 weeks agotests: expand: fix false failure on various systems
Pádraig Brady [Mon, 9 Mar 2026 21:01:27 +0000 (21:01 +0000)] 
tests: expand: fix false failure on various systems

* tests/expand/mb.sh: Use $LOCALE_FR_UTF8 rather than
hardcoding "en_US.UTF-8".
* tests/unexpand/mb.sh: Likewise.
Reported by Bruno Haible.

4 weeks agobuild: update to latest gnulib
Pádraig Brady [Mon, 9 Mar 2026 13:14:54 +0000 (13:14 +0000)] 
build: update to latest gnulib

* src/ls.c: Adjust for renamed acl permissions member.

4 weeks agomaint: remove duplicate names from THANKS
Collin Funk [Sun, 8 Mar 2026 01:08:13 +0000 (17:08 -0800)] 
maint: remove duplicate names from THANKS

* .mailmap: Prefer the most recently used email address from each commit
author.

4 weeks agomaint: prefer memset_explicit to explicit_bzero
Collin Funk [Sun, 8 Mar 2026 00:16:01 +0000 (16:16 -0800)] 
maint: prefer memset_explicit to explicit_bzero

The explicit_bzero function is a common extension, but memset_explicit
was standardized in C23. It will likely become more portable in the
future, and Gnulib provides an implementation if needed.

* bootstrap.conf (gnulib_modules): Add memset_explicit. Remove
explicit_bzero.
* gl/lib/randint.c (randint_free): Use memset_explicit instead of
explicit_bzero.
* gl/lib/randread.c (randread_free_body): Likewise.

4 weeks agoexpand,unexpand: support multi-byte input
Lukáš Zaoral [Fri, 6 Mar 2026 14:13:17 +0000 (14:13 +0000)] 
expand,unexpand: support multi-byte input

* src/expand.c: Use mbbuf to support multi-byte input.
* src/unexpand.c: Likewise.
* tests/expand/mb.sh: New multi-byte test.
* tests/unexpand/mb.sh: Likewise.
* tests/local.mk: Reference new tests.
* NEWS: Mention the improvement.

4 weeks agomaint: shred: fix typo in comment
Weixie Cui [Sat, 7 Mar 2026 02:01:17 +0000 (10:01 +0800)] 
maint: shred: fix typo in comment

* src/shred.c: Fix "then" -> "than" in comment.

5 weeks agomaint: dd: fix typo in comment
Weixie Cui [Fri, 6 Mar 2026 13:05:55 +0000 (21:05 +0800)] 
maint: dd: fix typo in comment

* src/dd.c: Fix "that that" -> "that the" in comment.

5 weeks agobuild: update gnulib submodule to latest
Collin Funk [Fri, 6 Mar 2026 09:09:45 +0000 (01:09 -0800)] 
build: update gnulib submodule to latest

5 weeks agobuild: update gnulib submodule to latest
Collin Funk [Fri, 6 Mar 2026 06:24:38 +0000 (22:24 -0800)] 
build: update gnulib submodule to latest

5 weeks agomaint: touch: reduce variable scope
Collin Funk [Thu, 5 Mar 2026 07:40:03 +0000 (23:40 -0800)] 
maint: touch: reduce variable scope

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

5 weeks agomaint: chown,chgrp: reduce variable scope
Collin Funk [Thu, 5 Mar 2026 07:34:45 +0000 (23:34 -0800)] 
maint: chown,chgrp: reduce variable scope

* src/chown-core.c (describe_change, restricted_chown)
(change_file_owner, chown_files): Declare variables where they are used
instead of at the start of the function.
* src/chown.c (main): Likewise.

5 weeks agoinstall: allow the combination of --compare and --preserve-timestamps
Collin Funk [Sun, 1 Mar 2026 23:31:28 +0000 (15:31 -0800)] 
install: allow the combination of --compare and --preserve-timestamps

* NEWS: Mention the improvement.
* src/install.c (enum copy_status): New type to let the caller know if
the copy was performed or skipped.
(copy_file): Return the new type instead of bool. Reduce variable scope.
(install_file_in_file): Only strip the file if the copy was
performed. Update the timestamps if the copy was skipped.
(main): Don't error when --compare and --preserve-timestamps are
combined.
* tests/install/install-C.sh: Add some test cases.

5 weeks agocksum: use more defensive escaping for --check
Pádraig Brady [Sat, 28 Feb 2026 11:09:26 +0000 (11:09 +0000)] 
cksum: use more defensive escaping for --check

cksum --check is often the first interaction
users have with possibly untrusted downloads, so we should try
to be as defensive as possible when processing it.

Specifically we currently only escape \n characters in file names
presented in checksum files being parsed with cksum --check.
This gives some possibilty of dumping arbitrary data to the terminal
when checking downloads from an untrusted source.
This change gives these advantages:

  1. Avoids dumping arbitrary data to vulnerable terminals
  2. Avoids visual deception with ansi codes hiding checksum failures
  3. More secure if users copy and paste file names from --check output
  4. Simplifies programmatic parsing

Note this changes programmatic parsing, but given the original
format was so awkward to parse, I expect that's extremely rare.
I was not able to find example in the wild at least.
To parse the new format from from shell, you can do something like:

  cksum -c checksums | while IFS= read -r line; do
    case $line in
      *': FAILED')
        filename=$(eval "printf '%s' ${line%: FAILED}")
        cp -v "$filename" /quarantine
        ;;
    esac
  done

This change also slightly reduces the size of the sum(1) utility.
This change also apples to md5sum, sha*sum, and b2sum.

* src/cksum.c (digest_check): Call quotef() instead of
cksum(1) specific quoting.
* tests/cksum/md5sum-bsd.sh: Adjust accordingly.
* doc/coreutils.texi (cksum general options): Describe the
shell quoting used for problematic file names.
* NEWS: Mention the change in behavior.
Reported by: Aaron Rainbolt

5 weeks agomaint: tests: refactor uses of bad_unicode()
Pádraig Brady [Wed, 4 Mar 2026 17:57:54 +0000 (17:57 +0000)] 
maint: tests: refactor uses of bad_unicode()

* init.cfg: Use 0xFF rather than 0xC3 everywhere.
* tests/fold/fold-characters.sh: Reuse bad_unicode().
* tests/tac/tac-locale.sh: Likewise.

5 weeks agofold: fix output truncation with 0xFF bytes in input
Pádraig Brady [Wed, 4 Mar 2026 16:56:48 +0000 (16:56 +0000)] 
fold: fix output truncation with 0xFF bytes in input

On signed char platforms, 0xFF was converted to -1
which matches MBBUF_EOF, causing fold to stop processing.

* NEWS: Mention the bug fix.
* gl/lib/mbbuf.h: Avoid sign extension on signed char platforms.
* tests/fold/fold-characters.sh: Adjust test case.
Reported at https://src.fedoraproject.org/rpms/coreutils/pull-request/20

5 weeks agotests: date: add timezone conversion test
Sylvestre Ledru [Sat, 14 Feb 2026 19:08:12 +0000 (20:08 +0100)] 
tests: date: add timezone conversion test

*tests/date/date.pl: Add the test case.
Add test case for https://github.com/uutils/coreutils/issues/10800
to verify `date -u -d '10:30 UTC-05'` converts to 15:30 UTC.

5 weeks agotests: date: add edge cases for modifiers
Sylvestre Ledru [Fri, 27 Feb 2026 08:16:00 +0000 (09:16 +0100)] 
tests: date: add edge cases for modifiers

* tests/date/date.pl: Add the test case.
Add test cases for https://github.com/uutils/coreutils/issues/10957

5 weeks agotests: cut: add test case for newline delimiter with -s flag
Sylvestre Ledru [Wed, 4 Mar 2026 10:57:10 +0000 (11:57 +0100)] 
tests: cut: add test case for newline delimiter with -s flag

* tests/cut/cut.pl: Add a new test case.
https://github.com/coreutils/coreutils/pull/211

5 weeks agotests: mktemp: ensure mktemp does not depend on getrandom and ASLR
oech3 [Sat, 28 Feb 2026 01:42:01 +0000 (10:42 +0900)] 
tests: mktemp: ensure mktemp does not depend on getrandom and ASLR

* tests/mktemp/mktemp-misc.sh: Add new test.
* tests/local.mk: Reference new test.
https://github.com/coreutils/coreutils/pull/206

5 weeks agomaint: tests: decouple debug output determination
Pádraig Brady [Tue, 3 Mar 2026 11:33:27 +0000 (11:33 +0000)] 
maint: tests: decouple debug output determination

* tests/misc/warning-errors.sh: Simply check there is output
to stderr before checking that output induces an error.

5 weeks agotests: avoid false test failure when using address sanitizer
Collin Funk [Tue, 3 Mar 2026 05:43:22 +0000 (21:43 -0800)] 
tests: avoid false test failure when using address sanitizer

* tests/misc/warning-errors.sh: Skip commands which have been built with
sanitizers, since standard error will not be closed and checked for
errors.
Reported by Bruno Haible.

5 weeks agotests: avoid failure on systems without an optimized 'cksum' or 'wc -l'
Collin Funk [Tue, 3 Mar 2026 06:16:21 +0000 (22:16 -0800)] 
tests: avoid failure on systems without an optimized 'cksum' or 'wc -l'

* tests/misc/warning-errors.sh: Expect 'wc' and 'cksum' to exit
successfully if there is not an optimized 'wc -l' implementation or
CRC32 implementation.
Reported by Bruno Haible.

5 weeks agotests: shuf: ensure memory exhaustion is handled gracefully
oech3 [Mon, 2 Mar 2026 11:56:23 +0000 (11:56 +0000)] 
tests: shuf: ensure memory exhaustion is handled gracefully

* tests/shuf/shuf.sh: Ensure we exit 1 upon failure
to allocate memory.
https://github.com/uutils/coreutils/issues/11170
https://github.com/coreutils/coreutils/pull/209

5 weeks agotest: cp: add test for non-UTF8 directory names
Sylvestre Ledru [Sat, 28 Feb 2026 08:16:57 +0000 (09:16 +0100)] 
test: cp: add test for non-UTF8 directory names

Missing test identified here:
 https://github.com/uutils/coreutils/pull/11148

* tests/cp/non-utf8-name.sh: Add a new test to cover this case.
https://github.com/coreutils/coreutils/pull/207

5 weeks agodu: fflush after outputting a line
Paul Eggert [Sun, 1 Mar 2026 03:07:52 +0000 (19:07 -0800)] 
du: fflush after outputting a line

* src/du.c (print_size): Resurrect the fflush call, since there
can be significant delay between output lines.

5 weeks agotests: wc,du: add additional --files0-from test cases
Collin Funk [Sun, 1 Mar 2026 02:36:34 +0000 (18:36 -0800)] 
tests: wc,du: add additional --files0-from test cases

* tests/wc/wc-files0-from.pl ($limits): New variable.
(@Tests): Prefer the error strings from getlimits over writing them by
hand. Add test cases for --files0-from listing missing files and
duplicate files.
* tests/du/files0-from.pl ($limits): New variable.
(@Tests): Prefer the error strings from getlimits over writing them by
hand. Add test cases for --files0-from listing missing files. Add tests
for --files0-from listing duplicate files with and without the -l option
also in use.

5 weeks agobuild: update gnulib submodule to latest
Collin Funk [Sat, 28 Feb 2026 22:23:26 +0000 (14:23 -0800)] 
build: update gnulib submodule to latest

* po/POTFILES.in: Remove recently added lib/cygpath.c dependency after
gnulib commit 2a893de047 (filesystem-remote: New module., 2026-02-28).

5 weeks agotests: ls: treat invalid UTF-8 paths starting with a dot as hidden
Sylvestre Ledru [Fri, 27 Feb 2026 08:23:17 +0000 (09:23 +0100)] 
tests: ls: treat invalid UTF-8 paths starting with a dot as hidden

* tests/ls/non-utf8-hidden.sh: Add the test case.
https://github.com/uutils/coreutils/pull/11135
https://github.com/coreutils/coreutils/pull/202

5 weeks agotests: ln: verify that -f and -i override each other
Sylvestre Ledru [Thu, 26 Feb 2026 20:58:51 +0000 (21:58 +0100)] 
tests: ln: verify that -f and -i override each other

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

* tests/ln/misc.sh: Add the check.
 https://github.com/coreutils/coreutils/pull/199

5 weeks agotest: ln: verify backup suffix path traversal prevention
Sylvestre Ledru [Sat, 28 Feb 2026 08:31:48 +0000 (09:31 +0100)] 
test: ln: verify backup suffix path traversal prevention

missing test detected thanks to:
https://github.com/uutils/coreutils/pull/11149

* tests/ln/backup-suffix-traversal.sh: Add a test.
https://github.com/coreutils/coreutils/pull/208

5 weeks agomaint: fix typo in previous test
Pádraig Brady [Sat, 28 Feb 2026 16:32:50 +0000 (16:32 +0000)] 
maint: fix typo in previous test

* tests/shuf/shuf.sh: Use non varying $ret rather than $?

5 weeks agotests: shuf: ensure we handle unsupported getrandom syscall gracefully
oech3 [Fri, 27 Feb 2026 22:15:48 +0000 (07:15 +0900)] 
tests: shuf: ensure we handle unsupported getrandom syscall gracefully

* tests/shuf/shuf.sh: Check we fail normally or succeed where
the getrandom syscall is not available.
https://github.com/coreutils/coreutils/pull/205

5 weeks agobuild: update gnulib to latest
Pádraig Brady [Sat, 28 Feb 2026 11:10:57 +0000 (11:10 +0000)] 
build: update gnulib to latest

* NEWS: Mention the more encompassing remoteness check for df.
* po/POTFILES.in: Add new lib/cygpath.c dependency.

5 weeks agodu: avoid locking and flushing standard output
Collin Funk [Sat, 28 Feb 2026 06:18:48 +0000 (22:18 -0800)] 
du: avoid locking and flushing standard output

This results in a noticeable increase in performance:

    $ yes /dev/null | head -n 10000000 | tr '\n' '\0' \
        | time --format=%E ./src/du-prev -l --files0-from=- > /dev/null
    0:20.40
    $ yes /dev/null | head -n 10000000 | tr '\n' '\0' \
        | time --format=%E ./src/du -l --files0-from=- > /dev/null
    0:16.57

* src/du.c (print_size): Prefer putchar and fputs which may be unlocked
unlike printf. Prefer ferror to fflush.

5 weeks agostat: handle %%%N too
Paul Eggert [Sat, 28 Feb 2026 00:49:08 +0000 (16:49 -0800)] 
stat: handle %%%N too

* src/stat.c (main): Fix incorrect counting of '%'s before 'N'.
* tests/stat/stat-fmt.sh: Test for the bug.

5 weeks agoid: avoid unnecessary buffer flushing
Paul Eggert [Sat, 28 Feb 2026 00:17:27 +0000 (16:17 -0800)] 
id: avoid unnecessary buffer flushing

* src/groups.c (main):
* src/id.c (main, print_stuff):
Don’t flush stdout before testing for write error.
Do the test only when in a loop, as a one-shot will
test for write error soon anyway.

5 weeks agocksum: prefer signed int
Paul Eggert [Sat, 28 Feb 2026 00:17:27 +0000 (16:17 -0800)] 
cksum: prefer signed int

* src/cksum.c (min_digest_line_length, digest_hex_bytes)
(digest_length, md5_sum_stream, sha1_sum_stream)
(sha224_sum_stream, sha256_sum_stream, sha384_sum_stream)
(sha512_sum_stream, sha2_sum_stream, sha3_sum_stream)
(blake2b_sum_stream, sm3_sum_stream, problematic_chars)
(filename_unescape, valid_digits, bsd_split_3)
(algorithm_from_tag, split_3, digest_file, output_file)
(b64_equal, hex_equal, digest_check, main):
* src/cksum_avx2.c (cksum_avx2):
* src/cksum_avx512.c (cksum_avx512):
* src/cksum_crc.c (cksum_fp_t, cksum_slice8, crc_sum_stream)
(crc32b_sum_stream, output_crc):
* src/cksum_pclmul.c (cksum_pclmul):
* src/cksum_vmull.c (cksum_vmull):
* src/sum.c (bsd_sum_stream, sysv_sum_stream, output_bsd, output_sysv):
Prefer signed to unsigned int where either will do.
This allows better checking with -fsanitize=undefined.
It should also help simplify future patches, so that they
needn’t worry whether comparisons like ‘i < len - 2’ will misbehave.

6 weeks agostat: don't check QUOTING_STYLE when --printf %%N is used
Collin Funk [Fri, 27 Feb 2026 04:39:12 +0000 (20:39 -0800)] 
stat: don't check QUOTING_STYLE when --printf %%N is used

* NEWS: Mention the fix.
* src/stat.c (main): Only check QUOTING_STYLE if there is a %N that is
not preceded by a percentage sign.
* tests/stat/stat-fmt.sh: Add some test cases.

6 weeks agoid: promptly diagnose write errors
Collin Funk [Thu, 26 Feb 2026 04:59:35 +0000 (20:59 -0800)] 
id: promptly diagnose write errors

* NEWS: Mention the improvement.
* src/id.c (print_stuff): Call fflush for each listed user to check for
write errors.
* tests/misc/io-errors.sh: Add an invocation of 'id'.

6 weeks agogroups: promptly diagnose write errors
Collin Funk [Thu, 26 Feb 2026 04:56:12 +0000 (20:56 -0800)] 
groups: promptly diagnose write errors

* NEWS: Mention the improvement.
* src/groups.c (main): Call fflush for each listed user to check for
write errors.
* tests/misc/io-errors.sh: Add an invocation of 'groups'.

6 weeks agotests: ensure failure to write warnings is handled gracefully
Pádraig Brady [Thu, 26 Feb 2026 20:06:29 +0000 (20:06 +0000)] 
tests: ensure failure to write warnings is handled gracefully

* tests/misc/warning-errors.sh: Add a new test to ensure
failure to write warnings is diagnosed in the exit status.
* tests/local.mk: Reference the new test.

6 weeks agotests: shuf: ensure randomization doesn't depend solely on ASLR
oech3 [Thu, 26 Feb 2026 12:04:56 +0000 (21:04 +0900)] 
tests: shuf: ensure randomization doesn't depend solely on ASLR

* tests/shuf/shuf.sh: Use setarch --addr-no-randomize to disable
ASLR, and show the output is still random.
https://github.com/coreutils/coreutils/pull/198

6 weeks agomaint: fix description of tests/misc/io-errors.sh
Pádraig Brady [Thu, 26 Feb 2026 12:47:34 +0000 (12:47 +0000)] 
maint: fix description of tests/misc/io-errors.sh

* tests/misc/io-errors.sh: Promptness is checked in
write-errors.sh, not this test.

6 weeks agotests: nice: ensure a particular adjustment is disallowed
oech3 [Wed, 25 Feb 2026 10:57:26 +0000 (19:57 +0900)] 
tests: nice: ensure a particular adjustment is disallowed

* tests/nice/nice-fail.sh: Ensure "1+2-3" is disallowed.
https://github.com/coreutils/coreutils/pull/197

6 weeks agotests: factor,numfmt: verify embedded NUL handling
Pádraig Brady [Wed, 25 Feb 2026 14:49:12 +0000 (14:49 +0000)] 
tests: factor,numfmt: verify embedded NUL handling

* tests/factor/factor.pl: Verify that embedded NULs
on stdin terminate the _number_.
* tests/numfmt/numfmt.p: Verify that embedded NULs
on stdin terminate the _line_.
https://github.com/coreutils/coreutils/pull/196

6 weeks agotests: fix "Hangup" termination of non-interactive runs
Pádraig Brady [Tue, 24 Feb 2026 15:44:41 +0000 (15:44 +0000)] 
tests: fix "Hangup" termination of non-interactive runs

This avoids the test harness being terminated like:
  make[1]: *** [Makefile:24419: check-recursive] Hangup
  make[3]: *** [Makefile:24668: check-TESTS] Hangup
  make: *** [Makefile:24922: check] Hangup
  make[2]: *** [Makefile:24920: check-am] Hangup
  make[4]: *** [Makefile:24685: tests/misc/usage_vs_refs.log] Error 129
  ...

This happened sometimes when the tests were being run non interactively.
For example when run like:

  setsid make TESTS="tests/timeout/timeout.sh \
   tests/tail/overlay-headers.sh" SUBDIRS=. -j2 check

Note the race window can be made bigger by adding a sleep
after tail is stopped in overlay-headers.sh

The race can trigger the kernel to induce its job control
mechanism to prevent stuck processes.
I.e. where it sends SIGHUP + SIGCONT to a process group
when it determines that group may become orphaned,
and there are stopped processes in that group.

* tests/tail/overlay-headers.sh: Use setsid(1) to keep the stopped
tail process in a separate process group, thus avoiding any kernel
job control protection mechanism.
* tests/timeout/timeout.sh: Use setsid(1) to avoid the kernel
checking the main process group when sleep(1) is reparented.
Fixes https://bugs.gnu.org/80477

6 weeks agodoc: tee: avoid the use of gpg cleartext signatures in an example
Collin Funk [Sun, 22 Feb 2026 22:20:30 +0000 (14:20 -0800)] 
doc: tee: avoid the use of gpg cleartext signatures in an example

Cleartext signatures have many gotchas. Therefore, the use of detached
signatures is recommended where possible. See:
<https://gnupg.org/blog/20251226-cleartext-signatures.html>.

* doc/coreutils.texi (tee invocation): Adjust gpg invocation to produce
a detached signature.

6 weeks agotests: whoami, logname: verify error handling
oech3 [Mon, 23 Feb 2026 10:22:44 +0000 (19:22 +0900)] 
tests: whoami, logname: verify error handling

* tests/df/no-mtab-status-masked-proc.sh: Tweak unshare check.
* tests/local.mk: Reference new test.
* tests/misc/user.sh: Add new test using unshare -U, to verify
that whoami and logname diagnose failure correctly.
https://github.com/coreutils/coreutils/pull/195

6 weeks agodoc: stty: mention the -g does not save the terminal window size
Collin Funk [Sun, 22 Feb 2026 07:33:56 +0000 (23:33 -0800)] 
doc: stty: mention the -g does not save the terminal window size

* doc/coreutils.texi (stty invocation): Mention that 'stty -g' does not
save the terminal window size as allowed by POSIX.1-2024.

6 weeks agotests: shuf: check that write errors are promptly diagnosed
Collin Funk [Sun, 22 Feb 2026 04:16:43 +0000 (20:16 -0800)] 
tests: shuf: check that write errors are promptly diagnosed

* tests/misc/write-errors.sh: Add a shuf invocation that would run
forever if write errors weren't diagnosed.

6 weeks agoshuf: avoid locking standard output when using --input-range
Collin Funk [Sat, 21 Feb 2026 08:06:01 +0000 (00:06 -0800)] 
shuf: avoid locking standard output when using --input-range

Here is the throughput before this patch:

    # write_permuted_numbers
    $ ./src/shuf-prev -i 0-100000000 | pv -r > /dev/null
    [ 153MiB/s]

    # write_random_numbers
    $ timeout 10 ./src/shuf-prev -i 0-100000 -r | pv -r > /dev/null
    [78.6MiB/s]

Here is the throughput after this patch:

    # write_permuted_numbers
    $ timeout 10 ./src/shuf -i 0-100000000 | pv -r > /dev/null
    [ 308MiB/s]

    # write_random_numbers
    $ timeout 10 ./src/shuf -i 0-100000 -r | pv -r > /dev/null
    [ 196MiB/s]

* NEWS: Mention the performance improvement.
* src/shuf.c (write_permuted_numbers, write_random_numbers): Prefer
fputs and fputc which may be unlocked over printf which locks standard
output.

6 weeks agotests: chmod: test that chmod(2) is always called
Collin Funk [Fri, 20 Feb 2026 03:13:34 +0000 (19:13 -0800)] 
tests: chmod: test that chmod(2) is always called

* tests/chmod/only-op.sh: New file.
* tests/local.mk (all_test): Add the new test.

7 weeks agomaint: printf: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:42:35 +0000 (21:42 -0800)] 
maint: printf: prefer static initialization

* src/printf.c (main): Remove unnecessary initialization.

7 weeks agomaint: fmt: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:40:44 +0000 (21:40 -0800)] 
maint: fmt: prefer static initialization

* src/fmt.c (prefix, max_width): Initialize variables.
(main): Remove unnecessary initializations.

7 weeks agomaint: sort: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:37:15 +0000 (21:37 -0800)] 
maint: sort: prefer static initialization

* src/sort.c (main): Remove unnecessary initialization.

7 weeks agomaint: df: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:34:03 +0000 (21:34 -0800)] 
maint: df: prefer static initialization

* src/df.c (human_output_opts, grand_fsu): Initialize variables.
(main): Remove unnecessary initializations.

7 weeks agomaint: split: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:28:40 +0000 (21:28 -0800)] 
maint: split: prefer static initialization

* src/split.c (outbase, infile): Initialize variables.
(main): Remove unnecessary initializations.

7 weeks agomaint: tail: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:24:54 +0000 (21:24 -0800)] 
maint: tail: prefer static initialization

* src/tail.c (count_lines, line_end): Initialize variables.
(main): Remove unnecessary initializations.

7 weeks agomaint: csplit: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:22:17 +0000 (21:22 -0800)] 
maint: csplit: prefer static initialization

* src/csplit.c (prefix, remove_files): Initialize variables.
(main): Remove unnecessary initializations.

7 weeks agomaint: comm: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:18:41 +0000 (21:18 -0800)] 
maint: comm: prefer static initialization

* src/comm.c (only_file_1, only_file_2, both): Initialize variables.
(main): Remove unnecessary initializations.

7 weeks agomaint: wc: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:11:27 +0000 (21:11 -0800)] 
maint: wc: prefer static initialization

* src/wc.c (main): Remove unnecessary initializations.

7 weeks agomaint: tac: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:08:43 +0000 (21:08 -0800)] 
maint: tac: prefer static initialization

* src/tac.c (separator, separator_ends_record, sentinel_length):
Initialize variables.
(main): Remove unnecessary initializations.

7 weeks agomaint: join: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:05:11 +0000 (21:05 -0800)] 
maint: join: prefer static initialization

* src/join.c (print_pairables): Initialize variable.
(main): Remove unnecessary initializations.

7 weeks agomaint: cut: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 05:01:10 +0000 (21:01 -0800)] 
maint: cut: prefer static initialization

* src/cut.c (main): Remove unnecessary initializations.

7 weeks agomaint: seq: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:53:20 +0000 (20:53 -0800)] 
maint: seq: prefer static initialization

* src/seq.c (separator): Initialize variable.
(main): Remove unnecessary initializations.

7 weeks agomaint: paste: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:49:40 +0000 (20:49 -0800)] 
maint: paste: prefer static initialization

* src/paste.c (main): Remove unnecessary initializations.

7 weeks agomaint: install: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:45:54 +0000 (20:45 -0800)] 
maint: install: prefer static initialization

* src/install.c (main): Remove unnecessary initializations.

7 weeks agomaint: chmod: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:39:41 +0000 (20:39 -0800)] 
maint: chmod: prefer static initialization

* src/chmod.c (main): Remove unnecessary initializations.

7 weeks agomaint: head: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:33:10 +0000 (20:33 -0800)] 
maint: head: prefer static initialization

* src/head.c (line_end): Initialize variable.
(main): Remove unnecessary initializations.

7 weeks agomaint: ln: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:29:48 +0000 (20:29 -0800)] 
maint: ln: prefer static initialization

* src/ln.c (main): Remove unnecessary initializations.

7 weeks agomaint: nl: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:22:16 +0000 (20:22 -0800)] 
maint: nl: prefer static initialization

* src/nl.c (main): Remove unnecessary initialization.

7 weeks agomaint: touch: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:14:30 +0000 (20:14 -0800)] 
maint: touch: prefer static initialization

* src/touch.c (main): Remove unnecessary initializations.

7 weeks agomaint: fold: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:10:58 +0000 (20:10 -0800)] 
maint: fold: prefer static initialization

* src/fold.c (main): Remove unnecessary initializations.

7 weeks agomaint: tee: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:03:32 +0000 (20:03 -0800)] 
maint: tee: prefer static initialization

* src/tee.c (main): Remove unnecessary initializations.

7 weeks agomaint: rmdir: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 04:00:03 +0000 (20:00 -0800)] 
maint: rmdir: prefer static initialization

* src/rmdir.c (main): Remove unnecessary initialization.

7 weeks agomaint: tty: prefer static initialization
Collin Funk [Fri, 20 Feb 2026 03:52:29 +0000 (19:52 -0800)] 
maint: tty: prefer static initialization

* src/tty.c (main): Remove unnecessary initialization.

7 weeks agomaint: tests: DRY a recent change
Pádraig Brady [Thu, 19 Feb 2026 19:42:14 +0000 (19:42 +0000)] 
maint: tests: DRY a recent change

* tests/pwd/pwd-long.sh: Adjust so complicated command is not repeated.

7 weeks agowc: add aarch64 Neon optimization for wc -l
Collin Funk [Wed, 18 Feb 2026 08:03:05 +0000 (00:03 -0800)] 
wc: add aarch64 Neon optimization for wc -l

Here is an example of the performance improvement:

    $ yes abcdefghijklmnopqrstuvwxyz | head -n 100000000 > input
    $ time ./src/wc-prev -l < input
    100000000

    real 0m0.793s
    user 0m0.630s
    sys 0m0.162s
    $ time ./src/wc -l < input
    100000000

    real 0m0.230s
    user 0m0.065s
    sys 0m0.164s

* NEWS: Mention the performance improvement.
* gnulib: Update to the latest commit.
* configure.ac: Check the the necessary intrinsics and functions.
* src/local.mk (noinst_LIBRARIES) [USE_NEON_WC_LINECOUNT]: Add
src/libwc_neon.a.
(src_libwc_neon_a_SOURCES, wc_neon_ldadd, src_libwc_neon_a_CFLAGS)
[USE_NEON_WC_LINECOUNT]: New variables.
(src_wc_LDADD) [USE_NEON_WC_LINECOUNT]: Add $(wc_neon_ldadd).
* src/wc.c [USE_NEON_WC_LINECOUNT]: Include sys/auxv.h and asm/hwcap.h.
(neon_supported) [USE_NEON_WC_LINECOUNT]: New function.
(wc_lines) [USE_NEON_WC_LINECOUNT]: Use neon_supported and
wc_lines_neon.
* src/wc.h (wc_lines_neon): Add declaration.
* src/wc_neon.c: New file.
* doc/coreutils.texi (Hardware Acceleration): Document the "-ASIMD"
hwcap and the variable used in ./configure to override detection of Neon
instructions.
* tests/wc/wc-cpu.sh: Also add "-ASIMD" to disable the use of Neon
instructions.

7 weeks agotests: use system ENOTEMPTY message
Pádraig Brady [Tue, 17 Feb 2026 22:58:29 +0000 (22:58 +0000)] 
tests: use system ENOTEMPTY message

* tests/mv/dir2dir.sh: Map system specific messages.
* tests/rm/d-2.sh: Likewise.

7 weeks agomaint: tests: avoid ERANGE specific handling
Pádraig Brady [Tue, 17 Feb 2026 22:50:00 +0000 (22:50 +0000)] 
maint: tests: avoid ERANGE specific handling

* tests/fmt/base.pl: Verify ERANGE is diagnosed.
* tests/od/od.pl: Adjust determination of ERANGE.

7 weeks agomaint: tests: avoid ELOOP specific handling
Pádraig Brady [Tue, 17 Feb 2026 22:31:15 +0000 (22:31 +0000)] 
maint: tests: avoid ELOOP specific handling

* tests/du/long-sloop.sh: Adjust determination of ELOOP.

7 weeks agomaint: tests: avoid ENOSPC specific handling
Pádraig Brady [Tue, 17 Feb 2026 21:59:16 +0000 (21:59 +0000)] 
maint: tests: avoid ENOSPC specific handling

* tests/csplit/csplit-io-err.sh: Adjust determination of ENOSPC.
* tests/csplit/split-io-err.sh: Likewise.
* tests/fold/fold-zero-width.sh: Verify full ENOSPC message.
* tests/tac/tac-continue.sh: Likewise.
* tests/misc/io-errors.sh: Likewise.
* tests/misc/write-errors.sh: Likewise.

7 weeks agotests: use system ENOSPC message
Pádraig Brady [Tue, 17 Feb 2026 21:55:54 +0000 (21:55 +0000)] 
tests: use system ENOSPC message

* tests/head/head-write-error.sh: Verify ENOSPC is output.
* tests/misc/yes.sh: Likewise.

7 weeks agotests: use system ENOTSUP message
Pádraig Brady [Mon, 16 Feb 2026 12:54:35 +0000 (12:54 +0000)] 
tests: use system ENOTSUP message

* tests/cp/cp-mv-enotsup-xattr.sh: Don't hardcode "Operation not
supported".
* tests/cp/cp-a-selinux.sh: Likewise.

7 weeks agomaint: tests: avoid ENOTSUP specific handling
Pádraig Brady [Mon, 16 Feb 2026 12:50:32 +0000 (12:50 +0000)] 
maint: tests: avoid ENOTSUP specific handling

* tests/mv/mv-exchange.sh: Use ENOTSUP rather than
transforming variations.

7 weeks agotests: use system EACCES message
Pádraig Brady [Mon, 16 Feb 2026 12:09:34 +0000 (12:09 +0000)] 
tests: use system EACCES message

* tests/chgrp/no-x.sh: Don't harcode "Permission denied".
* tests/chmod/no-x.sh: Likewise.
* tests/du/inacc-dest.sh: Likewise.
* tests/du/no-x.sh: Likewise.
* tests/misc/nohup.sh: Likewise.
* tests/mv/part-fail.sh: Likewise.
* tests/mv/perm-1.sh: Likewise.
* tests/rm/fail-eacces.sh: Likewise.
* tests/rm/rm1.sh: Likewise.
* tests/rm/rm2.sh: Likewise.
* tests/rm/unread2.sh: Likewise.
* tests/rm/unreadable.pl: Likewise.

7 weeks agomaint: tests: avoid AIX specific EACCES handling
Pádraig Brady [Sat, 14 Feb 2026 13:50:48 +0000 (13:50 +0000)] 
maint: tests: avoid AIX specific EACCES handling

* tests/rm/inaccessible.sh: Remove AIX specific handling.
* tests/cp/fail-perm.sh: Likeise.  Also remove confusing
EPERM/HPUX mentions.
* tests/misc/sync.sh: Don't hardcode EISDIR and EACCES.

7 weeks agomaint: tests: avoid EPERM/EACCES specific handling
Pádraig Brady [Sat, 14 Feb 2026 12:23:00 +0000 (12:23 +0000)] 
maint: tests: avoid EPERM/EACCES specific handling

* tests/Coreutils.pm: Remove associated comment.
* tests/mv/sticky-to-xpart.sh: Use $EACCES and $EPERM.
* tests/rm/fail-2eperm.sh: Likewise.
* tests/touch/not-owner.sh: Likewise.

7 weeks agomaint: tests: avoid EPERM specific handling
Pádraig Brady [Sat, 14 Feb 2026 12:15:15 +0000 (12:15 +0000)] 
maint: tests: avoid EPERM specific handling

* tests/dd/fail-ftruncate-fstat.sh: Use $EPERM rather than
mapping specific strings to the Linux $EPERM.
* tests/mkdir/smack-no-root.sh: Use $EPERM rather than hardcoding.

7 weeks agomaint: expr: reduce variable scope
Collin Funk [Wed, 18 Feb 2026 02:45:33 +0000 (18:45 -0800)] 
maint: expr: reduce variable scope

* src/expr.c (mbs_logical_cspn, main, trace, docolon, eval7, eval6)
(eval5, eval4, eval3, eval2, eval1, eval): Declare variables where they
are used instead of at the start of the function.

7 weeks agotests: pwd: ensure our getcwd fallback is tested
Pádraig Brady [Tue, 17 Feb 2026 00:18:48 +0000 (00:18 +0000)] 
tests: pwd: ensure our getcwd fallback is tested

* tests/pwd/pwd-long.sh: Avoid the getcwd syscall,
to ensure our fallback getcwd code is exercised.
* NEWS: Mention the recent bug fix in pwd.

7 weeks agopwd: fix heap buffer overflow in file_name_prepend
Chris Down [Mon, 16 Feb 2026 05:06:31 +0000 (13:06 +0800)] 
pwd: fix heap buffer overflow in file_name_prepend

file_name_prepend works by right-aligning path data in a growing buffer.
When the buffer is too small, it then allocates a new buffer via
xpalloc() and copies existing data to the end of the new buffer.

Unfortunately, the memcpy destination is computed as buf + p->n_alloc -
n_free, but xpalloc has already updated p->n_alloc to the new (larger)
allocation size while n_free still reflects the old state. This places
the data at too high an offset, writing past the end of the buffer.

Update to properly calculate the destination offset.

Fixes: v9.5-171-g61ab25c35 ("pwd: prefer xpalloc to xnrealloc")
7 weeks agobuild: update gnulib submodule to latest
Paul Eggert [Sun, 15 Feb 2026 03:05:48 +0000 (19:05 -0800)] 
build: update gnulib submodule to latest

7 weeks agomaint: seq,who: prefer xasprintf
Collin Funk [Sat, 14 Feb 2026 22:48:45 +0000 (14:48 -0800)] 
maint: seq,who: prefer xasprintf

* src/seq.c (main): Use xasprintf instead of asprintf followed by a
check if the allocation fails.
* src/who.c (print_line): Likewise.

7 weeks agomaint: seq: reduce variable scope
Collin Funk [Sat, 14 Feb 2026 20:15:09 +0000 (12:15 -0800)] 
maint: seq: reduce variable scope

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

7 weeks agotests: date: check that options can follow the format string
Collin Funk [Sat, 14 Feb 2026 06:26:59 +0000 (22:26 -0800)] 
tests: date: check that options can follow the format string

* tests/date/date.pl (@Tests): Add the test case.

8 weeks agodoc: relax github issue/pull-request instructions
Pádraig Brady [Thu, 12 Feb 2026 17:42:52 +0000 (17:42 +0000)] 
doc: relax github issue/pull-request instructions

Be more accepting of github issues and pull-requests.
Be a bit less verbose in info provided.

8 weeks agotests: sort: ensure --batch-size=(rlimit+1) fails
oech3 [Sun, 1 Feb 2026 13:46:42 +0000 (22:46 +0900)] 
tests: sort: ensure --batch-size=(rlimit+1) fails

* tests/sort/sort-merge-fdlimit.sh: Add test case.
https://github.com/coreutils/coreutils/pull/182

8 weeks agotests: coreutils: remove redundant validity check
oech3 [Thu, 12 Feb 2026 17:07:30 +0000 (17:07 +0000)] 
tests: coreutils: remove redundant validity check

* tests/misc/coreutils.sh: Remove the check for non-empty coreutils.h,
as the existing `print_ver_ coreutils` is sufficient to determine
support for single binary mode.
https://github.com/coreutils/coreutils/pull/189