bump to 9.4

Signed-off-by: lvgenggeng <lvgenggeng@uniontech.com>
This commit is contained in:
lvgenggeng 2024-01-12 16:33:25 +08:00
parent 245198ab2e
commit 87dfe36e62
6 changed files with 606 additions and 643 deletions

View File

@ -1,22 +1,20 @@
From f11a739f6aabbf280fa68a8013974de7d0855ecd Mon Sep 17 00:00:00 2001
From: xueyamao <xueyamao@kylinos.cn>
Date: Wed, 20 Jul 2022 17:49:23 +0800
Subject: [PATCH 2/2] coreutils-df-direct add df --direct option,direct statfs
for a file. Do not resolve mount point and show statistics directly for a
file. Signed-off-by: xueyamao <xueyamao@kylinos.cn>
From 6e36198f10a2f63b89c89ebb5d5c185b20fb3a63 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Mon, 29 Mar 2010 17:20:34 +0000
Subject: [PATCH] coreutils-df-direct.patch
---
doc/coreutils.texi | 7 ++++++
src/df.c | 38 ++++++++++++++++++++++++++++---
tests/df/direct.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 98 insertions(+), 3 deletions(-)
create mode 100644 tests/df/direct.sh
src/df.c | 34 ++++++++++++++++++++++++++--
tests/df/direct.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 94 insertions(+), 2 deletions(-)
create mode 100755 tests/df/direct.sh
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index cb00eea..7667ace 100644
index 5b9a597..6810c15 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -12067,6 +12067,13 @@ some systems (notably Solaris), doing this yields more up to date results,
@@ -12074,6 +12074,13 @@ some systems (notably Solaris), doing this yields more up to date results,
but in general this option makes @command{df} much slower, especially when
there are many or very busy file systems.
@ -31,7 +29,7 @@ index cb00eea..7667ace 100644
@opindex --total
@cindex grand total of file system size, usage and available space
diff --git a/src/df.c b/src/df.c
index 6256d0a..1c5fe5f 100644
index 48025b9..c8efa5b 100644
--- a/src/df.c
+++ b/src/df.c
@@ -125,6 +125,9 @@ static bool print_type;
@ -55,16 +53,16 @@ index 6256d0a..1c5fe5f 100644
static struct option const long_options[] =
{
{"all", no_argument, NULL, 'a'},
{"block-size", required_argument, NULL, 'B'},
+ {"direct",no_argument,NULL,DIRECT_OPTION},
{"inodes", no_argument, NULL, 'i'},
{"human-readable", no_argument, NULL, 'h'},
{"si", no_argument, NULL, 'H'},
{"all", no_argument, nullptr, 'a'},
{"block-size", required_argument, nullptr, 'B'},
+ {"direct", no_argument, nullptr, DIRECT_OPTION},
{"inodes", no_argument, nullptr, 'i'},
{"human-readable", no_argument, nullptr, 'h'},
{"si", no_argument, nullptr, 'H'},
@@ -583,7 +588,10 @@ get_header (void)
for (col = 0; col < ncolumns; col++)
{
char *cell = NULL;
char *cell = nullptr;
- char const *header = _(columns[col]->caption);
+ char const *header = (columns[col]->field == TARGET_FIELD
+ && direct_statfs)?
@ -73,29 +71,25 @@ index 6256d0a..1c5fe5f 100644
if (columns[col]->field == SIZE_FIELD
&& (header_mode == DEFAULT_MODE
@@ -1480,7 +1488,20 @@ get_point (char const *point, const struct stat *statp)
@@ -1486,6 +1494,17 @@ get_point (char const *point, const struct stat *statp)
static void
get_entry (char const *name, struct stat const *statp)
{
- if ((S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode))
+ if (direct_statfs)
+ if (direct_statfs)
+ {
+ char *resolved = canonicalize_file_name (name);
+ if (resolved)
+ {
+ char *mp = find_mount_point (name, statp);
+ get_dev (NULL, mp, resolved, NULL, NULL, false, false, NULL, false);
+ free(mp);
+ free (resolved);
+ return;
+ }
+ {
+ get_dev (NULL, resolved, name, NULL, NULL, false, false, NULL, false);
+ free (resolved);
+ return;
+ }
+ }
+
+ if ((S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode))
+
if ((S_ISBLK (statp->st_mode) || S_ISCHR (statp->st_mode))
&& get_device (name))
return;
@@ -1550,6 +1571,7 @@ or all file systems by default.\n\
@@ -1556,6 +1575,7 @@ or all file systems by default.\n\
-B, --block-size=SIZE scale sizes by SIZE before printing them; e.g.,\n\
'-BM' prints sizes in units of 1,048,576 bytes;\n\
see SIZE format below\n\
@ -103,24 +97,24 @@ index 6256d0a..1c5fe5f 100644
-h, --human-readable print sizes in powers of 1024 (e.g., 1023M)\n\
-H, --si print sizes in powers of 1000 (e.g., 1.1G)\n\
"), stdout);
@@ -1640,6 +1662,9 @@ main (int argc, char **argv)
@@ -1646,6 +1666,9 @@ main (int argc, char **argv)
xstrtol_fatal (e, oi, c, long_options, optarg);
}
break;
+ case DIRECT_OPTION:
+ case DIRECT_OPTION:
+ direct_statfs = true;
+ break;
case 'i':
if (header_mode == OUTPUT_MODE)
{
@@ -1736,6 +1761,13 @@ main (int argc, char **argv)
@@ -1742,6 +1765,13 @@ main (int argc, char **argv)
}
}
+ if (direct_statfs && show_local_fs)
+ {
+ error (0, 0, _("options --direct and --local (-l) are mutually "
+ "exclusive"));
+ "exclusive"));
+ usage (EXIT_FAILURE);
+ }
+
@ -128,11 +122,11 @@ index 6256d0a..1c5fe5f 100644
{
if (posix_format)
diff --git a/tests/df/direct.sh b/tests/df/direct.sh
new file mode 100644
index 0000000..25fbc57
new file mode 100755
index 0000000..8e4cfb8
--- /dev/null
+++ b/tests/df/direct.sh
@@ -0,0 +1,56 @@
@@ -0,0 +1,55 @@
+#!/bin/sh
+# Ensure "df --direct" works as documented
+
@ -188,7 +182,6 @@ index 0000000..25fbc57
+compare file_out file_exp || fail=1
+
+Exit $fail
+
--
2.33.0
2.31.1

File diff suppressed because it is too large Load Diff

View File

@ -1,67 +0,0 @@
From 3fb0cc80fa5e1cede9ec05303a70c26d0d23ca1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Tue, 25 Apr 2023 14:07:03 +0100
Subject: [PATCH] pr: fix infinite loop when double spacing
* src/pr.c (init_parameters): Ensure we avoid a 0 lines_per_body
which was possible when adjusting for double spacing.
That caused print_page() to always return true,
causing an infinite loop.
* tests/pr/pr-tests.pl: Add a test case.
* NEWS: Mention the fix.
Fixes https://bugs.debian.org/1034808
Conflict:NEWS context adaption
Reference:https://github.com/coreutils/coreutils/commit/3fb0cc80fa5e1cede9ec05303a70c26d0d23ca1d
---
NEWS | 3 +++
src/pr.c | 2 +-
tests/pr/pr-tests.pl | 3 +++
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index f65eb95..5320b9c 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ GNU coreutils NEWS -*- outline -*-
* Noteworthy changes in release 9.3 (2023-04-18) [stable]
** Bug fixes
+
+ 'pr --length=1 --double-space' no longer enters an infinite loop.
+ [This bug was present in "the beginning".]
cp --reflink=auto (the default), mv, and install
will again fall back to a standard copy in more cases.
Previously copies could fail with permission errors on
diff --git a/src/pr.c b/src/pr.c
index 2c5cdceb1..14a368b6c 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -1209,7 +1209,7 @@ init_parameters (int number_of_files)
lines_per_body = lines_per_page;
if (double_space)
- lines_per_body = lines_per_body / 2;
+ lines_per_body = MAX (1, lines_per_body / 2);
/* If input is stdin, cannot print parallel files. BSD dumps core
on this. */
diff --git a/tests/pr/pr-tests.pl b/tests/pr/pr-tests.pl
index 265e6e108..eafc13d81 100755
--- a/tests/pr/pr-tests.pl
+++ b/tests/pr/pr-tests.pl
@@ -415,6 +415,9 @@ my @tv = (
['padding2', '-t -n,64', "1\n", (" "x 63)."1,1\n", 0],
# Ensure we handle buffer truncation correctly
['padding3', '-t -N1000000 -n,1', "1\n", "0,1\n", 0],
+
+# This entered an infinite loop before coreutils-9.4
+['page-length1', '-dl1', "", "", 0],
);
# Convert the above old-style test vectors to the newer
--
2.36.1

Binary file not shown.

BIN
coreutils-9.4.tar.xz Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: coreutils
Version: 9.3
Release: 3
Version: 9.4
Release: 1
License: GPLv3+
Summary: A set of basic GNU tools commonly used in shell scripts
Url: https://www.gnu.org/software/coreutils/
@ -19,11 +19,10 @@ Patch3: bugfix-remove-usr-local-lib-from-m4.patch
Patch4: bugfix-dummy_help2man.patch
Patch6: skip-the-tests-that-require-selinux-if-selinux-is-di.patch
Patch7: backport-config-color-alias-for-ls.patch
Patch8: backport-coreutils-i18n.patch
Patch9: backport-pr-fix-infinite-loop-when-double-spacing.patch
Patch8: backport-coreutils-df-direct.patch
Patch9: backport-coreutils-i18n.patch
patch10: backport-CVE-2024-0684-split-do-not-shrink-hold-buffer.patch
Patch9000: openEuler-coreutils-df-direct.patch
%ifarch sw_64
Patch9001: coreutils-9.0-sw.patch
%endif
@ -155,6 +154,9 @@ fi
%{_mandir}/man*/*
%changelog
* Thu Feb 1 2024 lvgenggeng <lvgenggeng@uniontech.com> - 9.4-1
- bump to 9.4
* Wed Jan 24 2024 Jiangchuangang <jiangchuangang@huawei.com> - 9.3-3
- fix CVE-2024-0684