SHA256
1
0
forked from pool/coreutils

Compare commits

...

4 Commits

15 changed files with 512 additions and 439 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cd328edeac92f6a665de9f323c93b712af1858bc2e0d88f3f7100469470a1b8a
size 6007136

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEbDfcEhIaUAa8HbgE32/ZcTBgN9kFAmYFirgACgkQ32/ZcTBg
N9nZMg//WF6fyy6kxNZJIeUnAzAyMhY5hjlD33hFSaj2ihfmt7IQzRuOu7bhYk94
5lpDJvfljubJpuAU15MD0g/7xdRVPEf/igkRqdvm79eWips1c8d7HfcorxqJcYKf
40JV0rQyDaMqQbqFl6rPipAaagE3GBSdHz3eNVhiEQ9MII/XKNX7dZ/5MBIUW/wl
VM7G7sA4WBh0k+K0fGNALrlFHSmQDqwVIVhuDlFNcVmY37NIsIcvIT910HlKTFWV
A5okdepRs9a2dOIhGvMVK/U+4D9vbVbS+QlnXH74UlmnczKPQsCQKsusG02bv9L0
ih+jFj9BVCoUjB1fQlo6/VE4Kvdhpg/NZKZCaKIEH0d4mn1XHqvyTTRN0SVOlJr8
ZmY7e94A5TDbpkt5MFPxZ6M1Z5dZTtVX2/rkQtb59jIr/p5eYmjId3NsjWtoXICo
XMr+hLtjMt/XIfN/eXnaSOZSoyNxOPurfe59hfjVhaexCeIrEIglZmYWw8HhkfWz
vAxGWOFVwYfWlWlfxggdYkysRvU0vUb1JhO8HIRwmCX05YEhvTwKZMnvo/z/Y++G
CrXyduj9e8jzRkunlU6mqFmHqaYrgt5t7e1PLFYxEgWBX77fvpSbBsLhX5nH2c6I
4uRaQpaZQ+hnYu7U5OHfhy1OwG2qcYjbou4zK4BuI1ktnBHFgbc=
=IhBg
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,61 @@
From 14f2d2317b2f935cb2277a4140c1afa569be9629 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Fri, 17 Jan 2025 17:29:34 +0000
Subject: [PATCH] ls: fix crash with --context
* src/ls.c (main): Flag that we need to stat()
if we're going to get security context (call file_has_aclinfo_cache).
(file_has_aclinfo_cache): Be defensive and only lookup the device
for the file if the stat has been performed.
(has_capability_cache): Likewise.
* tests/ls/selinux-segfault.sh: Add a test case.
* NEWS: Mention the bug fix.
Reported by Bruno Haible.
---
src/ls.c | 6 +++---
tests/ls/selinux-segfault.sh | 3 +++
2 files changed, 6 insertions(+), 3 deletions(-)
Index: coreutils-9.6/src/ls.c
===================================================================
--- coreutils-9.6.orig/src/ls.c
+++ coreutils-9.6/src/ls.c
@@ -1768,7 +1768,7 @@ main (int argc, char **argv)
format_needs_stat = ((sort_type == sort_time) | (sort_type == sort_size)
| (format == long_format)
- | print_block_size | print_hyperlink);
+ | print_block_size | print_hyperlink | print_scontext);
format_needs_type = ((! format_needs_stat)
& (recursive | print_with_color | print_scontext
| directories_first
@@ -3309,7 +3309,7 @@ file_has_aclinfo_cache (char const *file
static int unsupported_scontext_err;
static dev_t unsupported_device;
- if (f->stat.st_dev == unsupported_device)
+ if (f->stat_ok && f->stat.st_dev == unsupported_device)
{
ai->buf = ai->u.__gl_acl_ch;
ai->size = 0;
@@ -3342,7 +3342,7 @@ has_capability_cache (char const *file,
found that has_capability fails indicating lack of support. */
static dev_t unsupported_device;
- if (f->stat.st_dev == unsupported_device)
+ if (f->stat_ok && f->stat.st_dev == unsupported_device)
{
errno = ENOTSUP;
return 0;
Index: coreutils-9.6/tests/ls/selinux-segfault.sh
===================================================================
--- coreutils-9.6.orig/tests/ls/selinux-segfault.sh
+++ coreutils-9.6/tests/ls/selinux-segfault.sh
@@ -30,4 +30,7 @@ mkdir sedir || framework_failure_
ln -sf missing sedir/broken || framework_failure_
returns_ 1 ls -L -R -Z -m sedir > out || fail=1
+# ls 9.6 would segfault with the following
+ls -Z . > out || fail=1
+
Exit $fail

BIN
coreutils-9.6.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

16
coreutils-9.6.tar.xz.sig Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEbDfcEhIaUAa8HbgE32/ZcTBgN9kFAmeKeeoACgkQ32/ZcTBg
N9m4JA/8DDvn6KAIa5q95yH37wtJfp2nau1BqjCYDxh51x4q0RX6dc7VHXvxkNeD
JCkL8tkzWEEZyK1NHHfaXq9xO0WgXvo0NPdAzSeB1+yDgH9RZR5EdkcgTmOsdx5A
gO/Ki/rVpUh9Xi5+Njc55xrH1H9NNT+71aWFde+DIU1iUqQRpBW7foEH4gjsTx+z
eyZ8CIbNwoQqhS4p0UzgQlYAO7cA0KyOVDcwfloa5dd9laJxKFTKJjsWXi07u5iR
tC34n1ZYOO5PVlpHCQ6zpGzkvRHpxhduvPi17wpLeE7kmx8DsjfGvk2L3qyJKcHg
58c7Ca7IvxcPePezK6k6/zYmGtj1Bol89YHNFVV0ERnL9BuT0v7LGJqZu9Efuutt
6hlkgMRpScm3G0dGAoPl9Qqpya8EtMF6WypAtiGH2lR+SV7F7C4lRUUKR56DKKd2
RvlTpWkgNYytnm52hVNEIOYnGcsj4EmURRuGiEhqBRph0VxEKs8+2P67UQib/k7M
7E/5JEpNAOS8ikkN6Fyq2AzPoDKOrCGqNScqbb2xxViNomWyQlc8RDIOG/ydDIaW
J8cqiT07Sw4mUXJTs/E3WdW4ZOP9vpr2KeirG5eoYE+1osx5ZP9npE+gNMGJzYhX
MX8iIuc9DdPGxxvL/Td++gEIG0QzSh+W0TUVcdk5qdtXlf7R2ok=
=ChFm
-----END PGP SIGNATURE-----

View File

@ -6,7 +6,7 @@ Index: gnulib-tests/gnulib.mk
===================================================================
--- gnulib-tests/gnulib.mk.orig
+++ gnulib-tests/gnulib.mk
@@ -1473,10 +1473,10 @@ EXTRA_DIST += test-getloadavg.c signatur
@@ -1528,10 +1528,10 @@ EXTRA_DIST += test-getloadavg.c signatur
## begin gnulib module getlogin-tests

View File

@ -1,95 +0,0 @@
2 upstream gnulib commits for coreutils-9.5 to skip localtime_r tests
when the timezone 'Europe/Paris' does not work.
Commit 1:
http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=f130f5426ecd4edd559
From f130f5426ecd4edd5596797e0a5721b927f80126 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sat, 30 Mar 2024 13:28:01 -0600
Subject: [PATCH 1/2] time_r-tests: skip French tests if no Europe/Paris
* tests/test-localtime_r.c (main):
* tests/test-localtime_r-mt.c (main):
If TZ='Europe/Paris' does not work, skip these tests.
Commit 2:
http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=2c04db80e2c52b8f05b
From 2c04db80e2c52b8f05b4136af955510e7d370470 Mon Sep 17 00:00:00 2001
From: Bruno Haible <bruno@clisp.org>
Date: Sat, 30 Mar 2024 22:50:39 +0100
Subject: [PATCH 2/2] time_r tests: Avoid misleading skip message on native
Windows.
* tests/test-localtime_r.c (main): Use the macro FRENCH_TZ.
* tests/test-localtime_r-mt.c (main): Likewise.
---
gnulib-tests/test-localtime_r-mt.c | 21 +++++++++++++++++++++
gnulib-tests/test-localtime_r.c | 21 +++++++++++++++++++++
2 files changed, 42 insertions(+)
Index: gnulib-tests/test-localtime_r-mt.c
===================================================================
--- gnulib-tests/test-localtime_r-mt.c.orig
+++ gnulib-tests/test-localtime_r-mt.c
@@ -107,6 +107,27 @@ main (int argc, char *argv[])
{
setenv ("TZ", FRENCH_TZ, 1);
+ /* Check that this TZ works. */
+ {
+ time_t t = 0; /* 1970-01-01 01:00:00 */
+ struct tm *result = localtime (&t);
+ if (! (result
+ && result->tm_sec == 0
+ && result->tm_min == 0
+ && result->tm_hour == 1
+ && result->tm_mday == 1
+ && result->tm_mon == 1 - 1
+ && result->tm_year == 1970 - 1900
+ && result->tm_wday == 4
+ && result->tm_yday == 0
+ && result->tm_isdst == 0))
+ {
+ fputs ("Skipping test: TZ='" FRENCH_TZ "' is not Paris time\n",
+ stderr);
+ return 77;
+ }
+ }
+
/* Create the threads. */
gl_thread_create (thread1_func, NULL);
gl_thread_create (thread2_func, NULL);
Index: gnulib-tests/test-localtime_r.c
===================================================================
--- gnulib-tests/test-localtime_r.c.orig
+++ gnulib-tests/test-localtime_r.c
@@ -43,6 +43,27 @@ main (void)
{
setenv ("TZ", FRENCH_TZ, 1);
+ /* Check that this TZ works. */
+ {
+ time_t t = 0; /* 1970-01-01 01:00:00 */
+ struct tm *result = localtime (&t);
+ if (! (result
+ && result->tm_sec == 0
+ && result->tm_min == 0
+ && result->tm_hour == 1
+ && result->tm_mday == 1
+ && result->tm_mon == 1 - 1
+ && result->tm_year == 1970 - 1900
+ && result->tm_wday == 4
+ && result->tm_yday == 0
+ && result->tm_isdst == 0))
+ {
+ fputs ("Skipping test: TZ='" FRENCH_TZ "' is not Paris time\n",
+ stderr);
+ return 77;
+ }
+ }
+
/* Note: The result->tm_gmtoff values and the result->tm_zone values are the
same (3600, "CET" or 7200, "CEST") across all tested platforms:
glibc, musl, macOS, FreeBSD, NetBSD, OpenBSD, Minix, Cygwin, Android. */

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@ Index: doc/coreutils.texi
* hostid invocation:: Print numeric host identifier
* uptime invocation:: Print system uptime and load
@@ -16421,7 +16419,6 @@ information.
@@ -16482,7 +16480,6 @@ information.
* arch invocation:: Print machine hardware name.
* nproc invocation:: Print the number of processors.
* uname invocation:: Print system information.
@ -39,7 +39,7 @@ Index: doc/coreutils.texi
* hostid invocation:: Print numeric host identifier.
* uptime invocation:: Print system uptime and load.
@end menu
@@ -17329,15 +17326,6 @@ This is non-portable, even across GNU/Li
@@ -17395,15 +17392,6 @@ This is non-portable, even across GNU/Li
Print the machine hardware name (sometimes called the hardware class
or hardware type).
@ -55,7 +55,7 @@ Index: doc/coreutils.texi
@item -p
@itemx --processor
@opindex -p
@@ -17391,34 +17379,6 @@ Print the kernel version.
@@ -17457,34 +17445,6 @@ Print the kernel version.
@exitstatus

View File

@ -33,7 +33,7 @@ Index: doc/coreutils.texi
Delaying
* sleep invocation:: Delay for a specified time
@@ -18848,90 +18842,6 @@ timeout -s INT 5s env --ignore-signal=IN
@@ -18918,90 +18912,6 @@ timeout -s INT 5s env --ignore-signal=IN
timeout -s INT -k 3s 5s env --ignore-signal=INT sleep 20
@end example

View File

@ -21,7 +21,7 @@ Index: gnulib-tests/gnulib.mk
===================================================================
--- gnulib-tests/gnulib.mk.orig
+++ gnulib-tests/gnulib.mk
@@ -3299,9 +3299,10 @@ EXTRA_DIST += test-timespec.c macros.h
@@ -3567,9 +3567,10 @@ EXTRA_DIST += test-timespec.c macros.h
## begin gnulib module tls-tests

View File

@ -16,7 +16,7 @@ Index: tests/local.mk
===================================================================
--- tests/local.mk.orig
+++ tests/local.mk
@@ -755,14 +755,9 @@ all_tests = \
@@ -758,14 +758,9 @@ all_tests = \
# See tests/factor/create-test.sh.
tf = tests/factor
factor_tests = \
@ -27,10 +27,10 @@ Index: tests/local.mk
- $(tf)/t20.sh $(tf)/t21.sh $(tf)/t22.sh $(tf)/t23.sh $(tf)/t24.sh \
- $(tf)/t25.sh $(tf)/t26.sh $(tf)/t27.sh $(tf)/t28.sh $(tf)/t29.sh \
- $(tf)/t30.sh $(tf)/t31.sh $(tf)/t32.sh $(tf)/t33.sh $(tf)/t34.sh \
- $(tf)/t35.sh $(tf)/t36.sh
- $(tf)/t35.sh $(tf)/t36.sh $(tf)/t37.sh
+ $(tf)/t00.sh \
+ $(tf)/t05.sh \
+ $(tf)/t36.sh
+ $(tf)/t36.sh $(tf)/t37.sh
$(factor_tests): $(tf)/run.sh $(tf)/create-test.sh
$(AM_V_GEN)$(MKDIR_P) $(tf)

View File

@ -6,7 +6,7 @@ Index: tests/init.sh
===================================================================
--- tests/init.sh.orig
+++ tests/init.sh
@@ -691,6 +691,16 @@ compare ()
@@ -731,6 +731,16 @@ compare ()
}
# -----------------------------------------------------------------------------

View File

@ -1,3 +1,111 @@
-------------------------------------------------------------------
Fri Jan 17 22:22:08 UTC 2025 - Bernhard Voelker <mail@bernhard-voelker.de>
- Update to 9.6:
Bug fixes
* cp fixes support for --update=none-fail, which would have been
rejected as an invalid option.
[bug introduced in coreutils-9.5]
* cp,mv --update no longer overrides --interactive or --force.
[bug introduced in coreutils-9.3]
* csplit no longer creates empty files given empty input.
[This bug was present in "the beginning".]
* ls and printf fix shell quoted output in the edge case of escaped
first and last characters, and single quotes in the string.
[bug introduced in coreutils-8.26]
* ls -l no longer outputs "Permission denied" errors on NFS
which may happen with files without read permission, and which resulted
in inaccurate indication of ACLs (missing '+' flag after mode).
[bug introduced in coreutils-9.4]
* ls -l no longer outputs "Not supported" errors on virtiofs.
[bug introduced in coreutils-9.4]
* mv works again with macFUSE file systems. Previously it would
have exited with a "Function not implemented" error.
[bug introduced in coreutils-8.28]
* nproc gives more consistent results on systems with more than 1024 CPUs.
Previously it would have ignored the affinity mask on such systems.
[bug introduced with nproc in coreutils-8.1]
* numfmt --from=iec-i now works with numbers without a suffix.
Previously such numbers were rejected with an error.
[bug introduced with numfmt in coreutils-8.21]
* printf now diagnoses attempts to treat empty strings as numbers,
as per POSIX. For example, "printf '%d' ''" now issues a diagnostic
and fails instead of silently succeeding.
[This bug was present in "the beginning".]
* pwd no longer outputs an erroneous double slash on systems
where the system getcwd() was completely replaced.
[bug introduced in coreutils-9.2]
* 'shuf' generates more-random output when the output is small.
[bug introduced in coreutils-8.6]
* `tail --follow=name` no longer waits indefinitely for watched
file names that are moved elsewhere within the same file system.
[bug introduced in coreutils-8.24]
* `tail --follow` without --retry, will consistently exit with failure status
where inotify is not used, when all followed files become inaccessible.
[This bug was present in "the beginning".]
* `tail --follow --pid=PID` will now exit when the PID dies,
even in the presence of blocking inputs like unopened fifos.
[This bug was present in "the beginning".]
* 'tail -c 4096 /dev/zero' no longer loops forever.
[This bug was present in "the beginning".]
Changes in behavior
* 'factor' now buffers output more efficiently in some cases.
* install -C now dereferences symlink sources when comparing,
rather than always treating as different and performing the copy.
* kill -l and -t now list signal 0, as it's a valid signal to send.
* ls's -f option now simply acts like -aU, instead of also ignoring
some earlier options. For example 'ls -fl' and 'ls -lf' are now
equivalent because -f no longer ignores an earlier -l. The new
behavior is more orthogonal and is compatible with FreeBSD.
* stat -f -c%T now reports the "fuseblk" file system type as "fuse",
given that there is no longer a distinct "ctl" fuse variant file system.
New Features
* cksum -a now supports the "crc32b" option, which calculates the CRC
of the input as defined by ITU V.42, as used by gzip for example.
For performance pclmul instructions are used where supported.
* ls now supports the --sort=name option,
to explicitly select the default operation of sorting by file name.
* printf now supports indexed arguments, using the POSIX:2024 specified
%<i>$ format, where '<i>' is an integer referencing a particular argument,
thus allowing repetition or reordering of printf arguments.
* test supports the POSIX:2024 specified '<' and '>' operators with strings,
to compare the string locale collating order.
* timeout now supports the POSIX:2024 specified -f, and -p short options,
corresponding to --foreground, and --preserve-status respectively.
Improvements
* cksum -a crc, makes use of AVX2, AVX512, and ARMv8 SIMD extensions
for time reductions of up to 40%, 60%, and 80% respectively.
* 'head -c NUM', 'head -n NUM', 'nl -l NUM', 'nproc --ignore NUM',
'tail -c NUM', 'tail -n NUM', and 'tail --max-unchanged-stats NUM
no longer fail merely because NUM stands for 2**64 or more.
* sort operates more efficiently when used on pseudo files with
an apparent size of 0, like those in /proc.
* stat and tail now know about the "bcachefs", and "pidfs" file system types.
stat -f -c%T now reports the file system type,
and tail -f uses inotify for these file systems.
* wc now reads a minimum of 256KiB at a time.
This was previously 16KiB and increasing to 256KiB was seen to increase
wc -l performance by about 10% when reading cached files on modern systems.
- coreutils-fix-gnulib-time_r-tests.patch: Remove now-upstream patch.
- coreutils-9.6-ls-Z-crash-fix.patch: Add upstream patch from after the release.
- coreutils.spec (Patch920): Exchange names of above patch files accordingly.
- coreutils-i18n.patch: Refresh patch, manually porting some upstream fixes
into the i18n chunks for expand.c, fold.c and unexpand.c.
- Refresh all other patches:
* coreutils-disable_tests.patch
* coreutils-remove_hostname_documentation.patch
* coreutils-remove_kill_documentation.patch
* coreutils-skip-gnulib-test-tls.patch
* coreutils-tests-shorten-extreme-factor-tests.patch
* coreutils-tests-workaround-make-fdleak.patch
-------------------------------------------------------------------
Sun Sep 29 14:36:55 UTC 2024 - Bernhard Voelker <mail@bernhard-voelker.de>
- coreutils-i18n.patch: fold(1): fix fold -b with UTF8 locale.
Sync fix in I18N patch from Fedora/Redhat and add a test. (RHEL-60295)
Original report: https://access.redhat.com/solutions/3459791
-------------------------------------------------------------------
Fri Jul 19 07:57:52 UTC 2024 - Andreas Schwab <schwab@suse.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package coreutils
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -30,7 +30,7 @@
%global psuffix %{nil}
%endif
Name: coreutils%{?psuffix}
Version: 9.5
Version: 9.6
Release: 0
Summary: GNU Core Utilities
License: GPL-3.0-or-later
@ -64,8 +64,10 @@ Patch501: coreutils-test_without_valgrind.patch
# tests: skip tests/rm/ext3-perf.sh temporarily as it hangs on OBS.
Patch810: coreutils-skip-tests-rm-ext3-perf.patch
Patch900: coreutils-tests-workaround-make-fdleak.patch
# Upstream gnulib patch for coreutils-9.5.
Patch920: coreutils-fix-gnulib-time_r-tests.patch
# Upstream coreutils patch right after the release was done:
# `ls -Z dir` would crash. [bug introduced in coreutils-9.6]
# see <https://lists.gnu.org/r/coreutils/2025-01/msg00054.html>
Patch920: coreutils-9.6-ls-Z-crash-fix.patch
BuildRequires: automake
BuildRequires: gmp-devel
BuildRequires: hostname
@ -167,7 +169,7 @@ This package contains the documentation for the GNU Core Utilities.
%patch -P 810
%patch -P 900
%patch -P 920
%patch -P 920 -p1
# ================================================
%build