1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-21 23:02:05 +02:00
Commit Graph

30769 Commits

Author SHA1 Message Date
Bernhard Voelker
7ac313dce6 join: remove unused #include "argmatch.h"
Prompted by the syntax-check failure:
  maint.mk: the above files include argmatch.h but don't use it
  make: *** [maint.mk:741: sc_prohibit_argmatch_without_use] Error 1

* src/join.c: Remove include, as the previous commit changed from using
ARRAY_CARDINALITY to countof - for which system.h includes the header.
2025-09-25 19:18:16 -07:00
Collin Funk
1bc5ec61d8 maint: prefer countof over ARRAY_CARDINALITY
* bootstrap.conf (gnulib_modules): Add stdcountof-h.
* src/system.h: Include stdcountof.h.
(ARRAY_CARDINALITY): Remove definition.
* .gitignore (/lib/stdcountof.h): Ignore Gnulib generated file.
* src/csplit.c: Use countof instead of ARRAY_CARDINALITY.
* src/df.c: Likewise.
* src/digest.c: Likewise.
* src/dircolors.c: Likewise.
* src/factor.c: Likewise.
* src/join.c: Likewise.
* src/ls.c: Likewise.
* src/od.c: Likewise.
* src/sort.c: Likewise.
* src/stdbuf.c: Likewise.
* src/tr.c: Likewise.
2025-09-24 17:31:57 -07:00
Hannes Braun
914972e80d tail: fix tailing larger number of lines in regular files
* src/tail.c (file_lines): Seek to the previous block instead of the
beginning (or a little before) of the block that was just scanned.
Otherwise, the same block is read and scanned (at least partially)
again. This bug was introduced by commit v9.7-219-g976f8abc1.
* tests/tail/basic-seek.sh: Add a new test.
* tests/local.mk: Reference the new test.
* NEWS: mention the bug fix.
2025-09-24 22:37:18 +01:00
Pádraig Brady
0cc3e1bfb6 tests: wc: fix hardware acceleration disabling test
* tests/wc/wc-cpu.sh: The message is only printed with wc -l.
Reported by Mathieu Borderé.
2025-09-24 15:53:34 +01:00
Pádraig Brady
de3ea76dbc build: copy: add dependency on $(LIB_SMACK)
* src/local.mk: Due to gnulib adjustments, this explicit
dependency is required with the mold linker at least.
Reported at https://github.com/coreutils/coreutils/issues/113
2025-09-24 11:21:51 +01:00
Pádraig Brady
2ef53e5b04 basenc: --base58: fix buffer overflow with input > 15MB
base58_length() operated naively on an int
which resulted in an overflow to a negative number
for any input > 2^31-1/138, i.e. 15,561,475 bytes.

* src/basenc.c (base_length): Change input and output
parameter types from int to idx_t since this needs to
cater for the full input size in the base58 case.
(base58_length): Likewise.  Also reorder the calculation
to be less exact, but doing the division first
to minimize the chance of overflow (which now on 64 bit
would only happen for inputs > around 6 Exa bytes).
* tests/basenc/basenc-large.sh: Add a new test,
that triggers with valgrind or ASAN.
* tests/local.mk: Reference the new test.
* NEWS: Mention the bug fix.
2025-09-23 20:35:34 +01:00
Pádraig Brady
d766efc7e4 doc: document gl_cv_crc_pclmul to control hardware acceleration
doc/coreutils.texi (Harware acceleration configuration):
Sort the list and add "gl_cv_crc_pclmul".
2025-09-23 20:28:19 +01:00
Pádraig Brady
062c16c17e build: fix build failure with mismatched pclmul
* src/cksum.c (pclmul_supported): In the case where
gnulib has pclmul enabled but coreutils does not,
ensure we don't reference the coreutils pclmul function.
Addresses https://bugs.gnu.org/79491
2025-09-23 20:28:19 +01:00
Paul Eggert
35795a8e35 build: update gnulib submodule to latest 2025-09-22 17:45:42 -07:00
Pádraig Brady
8c027d3bfb maint: post-release administrivia
* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.
2025-09-22 18:23:31 +01:00
Pádraig Brady
76e161dc2d version 9.8
* NEWS: Record release date.
v9.8
2025-09-22 17:50:52 +01:00
Pádraig Brady
71849a2421 build: update gnulib to latest
* gnulib: Update to latest to pull Android build fixes,
and fchownat fixes.
2025-09-22 14:02:23 +01:00
Pádraig Brady
b8b486dc32 tests: ls: avoid alignment check with non printable characters
* tests/ls/block-size.sh: Skip the case where there are
non-printable characters in ls' output, which is the case
with NBSP thousands separators on FreeBSD 11 and 12.
We may drop the MBSW_REJECT_UNPRINTABLE in future from
ls and numfmt, but for now avoid these characters in the test.
Reported by Bruno Haible.
2025-09-22 11:23:50 +01:00
Pádraig Brady
f9c6c730eb tests: du: avoid false failure in racy test
* tests/du/move-dir-while-traversing.sh: Expand the work to avoid
a false failure where du completes before the directory is moved.
Also expand the timeout to our more standard 10s to avoid the
"directory mover" being killed before du processes the directory.
This doesn't perceptibly impact the run time of the test.
Reported by Bruno Haible on a CentOS 7 system.
2025-09-22 00:09:03 +01:00
Pádraig Brady
52a15e470d build: revert gnulib update
There is a pending issue with fchownat:
https://lists.gnu.org/r/bug-gnulib/2025-09/msg00282.html
2025-09-22 00:06:03 +01:00
Collin Funk
dfedc2ee63 build: update gnulib submodule to latest 2025-09-21 15:14:12 -07:00
Collin Funk
483fa3b9ab build: fix missing declarations on Android
* configure.ac: Check for statx using gl_CHECK_FUNCS_ANDROID since it is
hidden for Android API level <= 30.
* m4/jm-macros.m4 (coreutils_MACROS): Check for syncfs using
gl_CHECK_FUNCS_ANDROID since it is hidden for Android API level <= 28.
2025-09-21 13:40:18 -07:00
Paul Eggert
ebedbe8997 maint: comment spelling fixes 2025-09-21 11:30:40 -07:00
Paul Eggert
6c194dc85b tests: fix OMP_NUM_THREADS misspelling
* tests/nproc/nproc-quota.sh: Fix misspelling.
2025-09-21 11:30:12 -07:00
Paul Eggert
e65f3a36c8 maint: update bootstrap from Gnulib 2025-09-21 09:47:03 -07:00
Pádraig Brady
8a1f434463 tests: avoid false failure on older Linux kernels
* tests/fold/fold-zero-width.sh: Check the shell was able to create
the redirection file, as intermittently on CentOS 5,6,7 this wasn't
the case, with the shell giving an xmalloc failure due to the ulimit.
Reported by William Bader and Bruno Haible.
2025-09-21 16:37:26 +01:00
Pádraig Brady
076e247416 tests: tail: avoid false failure with overlayfs
* tests/tail/inotify-dir-recreate.sh: Add an extra check
that inotify is in use, as it's required for this test.
Inotify is avoided with overlayfs for which the
df --local check is not sufficient exclusion for.
2025-09-21 13:45:54 +01:00
Pádraig Brady
70eb250fd7 tests: fold: avoid false failures on Solaris 10
* tests/fold/fold-characters.sh: Ensure we have independent verification
of the width of characters before testing based on those widths.
* tests/fold/fold-zero-width.sh: Likewise.
* tests/fold/fold.pl: Only compare the exit status,
as the error message can be translated.
2025-09-20 22:12:58 +01:00
Pádraig Brady
df30ce36e8 tests: dd: avoid false failure on Solaris 10
* tests/dd/no-allocate.sh: Give some extra space to the
determined vm limit.
2025-09-20 22:12:58 +01:00
Pádraig Brady
7c217bd8ac tests: avoid false failure on CentOS 5,6,7
* tests/fold/fold-zero-width.sh: Increase vm limit to avoid
failures on CentOS 5,6,7.  Match the limit used in write-errors.sh
as per commit v9.5-255-g0bd149403
2025-09-20 16:17:43 +01:00
Collin Funk
2d2eb2cbe8 doc: don't capitalize the first letter of cgroup
This is the correct way to write it as described in the documentation:
<https://docs.kernel.org/admin-guide/cgroup-v2.html#terminology>.

* doc/coreutils.texi (nproc invocation): Use cgroup instead of Cgroup.
2025-09-20 15:21:41 +01:00
Collin Funk
bbde83899d tests: env: skip a few tests if LD_LIBRARY_PATH is set
* tests/env/env-null.sh: Skip test if LD_LIBRARY_PATH or platform's
equivalent is set, since 'env -i' will unset it which may prevent
programs from running.
* tests/env/env-S.pl: Likewise.
Issue and suggested fix reported by Bruno Haible.
2025-09-19 16:40:09 -07:00
Grisha Levit
d9ff4d9af2 touch: fix diagnostic on macOS 26
* src/touch.c (touch): Do not use open_errno == EEXIST for diagnostic
if file was a directory as macOS 26 sets it for open("/", O_CREAT, ...).
2025-09-19 11:29:37 -07:00
Paul Eggert
d535ca4c06 copy: pacify older clang
* src/copy-file-data.c (copy_file_data):
Redo conditionals for clarity.
This pacifies the clang in FreeBSD 11 and OpenBSD 7.6.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/coreutils/2025-09/msg00104.html
2025-09-19 08:55:12 -07:00
Collin Funk
2662ddf335 dd: don't mistakenly use O_EXCL on GNU/Hurd
* src/dd.c (v): Add the O_EXCL flag to the set of bits that we do not
want to use for our definitions.
* cfg.mk (sc_dd_O_FLAGS): Adjust to pass syntax-check.
* NEWS: Mention the fix.
Reported by Bruno Haible.
2025-09-18 23:31:18 -07:00
Paul Eggert
7e41b00d07 maint: we don’t use Gnulib’s fchownat module
* bootstrap.conf (gnulib_modules): Remove fchownat.
It is used only indirectly, via the chownat module.
2025-09-18 17:08:01 -07:00
Bruno Haible
71a8cdf6b1 fmt: eliminate a clang -Wformat-extra-args warning
* src/fmt.c (fmt): When not reading from stdin, always mention the
file name in the error message.
2025-09-18 22:33:51 +01:00
Paul Eggert
af536b5ab7 maint: we use Gnulib’s stddef-h module directly
* bootstrap.conf (gnulib_modules): Add stddef-h, since the code
uses ‘unreachable’ which is supplied by that module.
2025-09-18 14:22:55 -07:00
Pádraig Brady
4ca51b1013 tests: tail/overlay-headers.sh: protect against hang
* tests/tail/overlay-headers.sh: Protect tail invocation with timeout,
and extend the possible running period to 60 seconds like other tests.
Reported by Brudno Haible on T2SDE Linux/alpha
2025-09-18 19:04:57 +01:00
Pádraig Brady
514f723d39 build: fix compile error on macOS
* gnulib: Update to latest to pull fix
for localcharset compile failure on macOS.
2025-09-18 18:04:57 +01:00
Pádraig Brady
0a2a3deb33 tests: tests/tail/wait.sh: protect against hang
* tests/tail/wait.sh: This test was seen to hang occasionally
on an Alpine Linux 3.20 system, so protect the tail(1) call
with `timeout 60` as done in similar tests.
Reported by Bruno Haible.
2025-09-18 17:47:45 +01:00
Pádraig Brady
c2e1816a53 build: fix link failure on macOS
* src/local.mk: Explicitly depend on @INTL_MACOS_LIBS@
which may be not implicitly referenced (in LIBINTL) without gettext.
This is a new transitive dependency through localename-unsafe.
We add this globally to ease future maintenance as currently
6 commands require the localename-unsafe dependency:
date, du through show-date() (fprintftime), and
ls, pr, stat, uptime through strftime().
2025-09-18 17:13:02 +01:00
Pádraig Brady
dc30eab314 build: update gnulib for stringeq adjustment
* gnulib: Pull in stringeq adjustment.
2025-09-17 21:44:46 +01:00
Pádraig Brady
5662192f39 tests: write-errors.sh: avoid portability issue with dash
* tests/misc/write-errors.sh: Use printf rather than echo
since the echo builtin in dash will interpret backslashes.
* tests/misc/read-errors.sh: Likewise for consistency.
2025-09-17 21:37:35 +01:00
Pádraig Brady
2b59958537 cksum,wc: inspect GLIBC_TUNABLES on all architectures
* gnulib: Update gnulib to latest to pull in change
to inspect GLIBC_TUNABLES on non x86_64 or aarch64 platforms.
This was needed on 32 bit x86, which supports calling into
accelerated code, and so requires inspection of GLIBC_TUNABLES
to pass the disablement verification in tests/cksum/cksum.sh
2025-09-17 20:56:38 +01:00
Paul Eggert
5257636761 maint: prefer memeq to memcmp
* gl/modules/randread-tests (Depends-on): Add stringeq.
* gl/tests/test-rand-isaac.c (main):
* src/copy.c (source_is_dst_backup):
* src/digest.c (b64_equal):
* src/install.c (have_same_content):
* src/ls.c (main, parse_ls_color):
* src/nl.c (check_section):
* src/od.c (write_block):
* src/seq.c (seq_fast):
* src/stty.c (eq_mode):
* src/system.h (is_nul):
Prefer memeq to memcmp when either will do.
2025-09-17 12:20:24 -07:00
Paul Eggert
ee367bd38d maint: STREQ → streq
Use new Gnulib streq function instead of rolling our own macro.
* bootstrap.conf (gnulib_modules): Add stringeq.
* src/rm.c (main): Don’t assume streq is a macro that expands to (...),
as it is now a function.
* src/system.h:
* tests/df/no-mtab-status.sh, tests/df/skip-duplicates.sh:
(STREQ): Remove.  All uses replaced by streq.
2025-09-17 12:20:24 -07:00
Paul Eggert
9f823e254a build: update gnulib submodule to latest 2025-09-17 12:20:24 -07:00
Pádraig Brady
78502174a9 tests: fix issues with fold-characters.sh test
This was noticed with:

  trap '' PIPE &&  # Ignore SIGPIPE
  make check TESTS=tests/fold/fold-characters.sh SUBDIRS=.

* tests/fold/fold-characters.sh: Move memory limit test to ...
* tests/misc/write-errors.sh: ... which avoids "write error"
messages on stderr due to the ignored SIGPIPE.  It also protects
the fold invocation with a timeout(1) so that fold implementations
that don't exit promptly upon write error don't hang the test suite
(Like we would have done before commit v9.7-311-gc95c7ee76).
2025-09-17 15:32:47 +01:00
Pádraig Brady
42ac231533 doc: remove older ChangeLog items
* Makefile.am: Update the oldest documented version
to 8.32 which is now about 5 years old.
2025-09-17 13:19:32 +01:00
Collin Funk
1efb539630 maint: remove unnecessary uintmaxtostr usage in printf
* src/comm.c (compare_files): Use the "%ju" printf directive instead of
"%s" and printing the result of umaxtostr.
* src/df.c (get_header): Likewise.
* src/ls.c (print_long_format): Likewise.
* src/sort.c (check): Likewise.
2025-09-16 19:43:46 -07:00
Pádraig Brady
168ae824f7 doc: add hardware acceleration configuration docs
* NEWS: Mention the new GLIBC_TUNABLES feature.
* doc/coreutils.texi (Hardware Acceleration): A new node
detailing the build time and run time configuration options.
2025-09-17 00:22:50 +01:00
Pádraig Brady
c95c7ee76f fold: fix write error checks with invalid multi-byte input
* src/fold.c (write_out): A new helper to check all writes.
(fold-file): Use write_out() for all writes.
* tests/fold/fold-zero-width.sh: Adjust to writing more
data in various patterns, rather than two buffers of NULs.
This is a more robust memory bound check, and the '\303' case
tests this particular logic change.
* NEWS: fold now exits immediately, not just promptly.
2025-09-16 18:41:51 +01:00
Pádraig Brady
10459ca7ed fold: exit promptly upon write errors
* NEWS: Mention the improvement.
* src/fold.c (fold_file): Check for write errors
after each buffer read from stdin.
* tests/misc/write-errors.sh: Add test cases.
2025-09-16 14:10:31 +01:00
Pádraig Brady
a6e9807eb9 maint: basenc: refactor overloaded use of ctx->i member
* src/basenc.c (base_decode_context): Remove the shared "i" member,
instead using per encoding data and access functions
for tracking pending data.
2025-09-16 14:09:12 +01:00