new upstream release: findutils-4.8.0

This commit is contained in:
Kamil Dudka 2021-01-09 20:32:24 +01:00
parent 710681d5bd
commit 7e3826d7ba
7 changed files with 26 additions and 329 deletions

View File

@ -24,10 +24,10 @@ index f6f7443..6fbf57b 100644
-CLEANFILES = find.txt find_mono.html findutils.texi_html_node.tar.gz dblocation.texi \
+CLEANFILES = find.txt find_mono.html findutils.texi_html_node.tar.gz \
find_mono.html findutils.texi_html_node.tar.gz \
find-info.tar.gz find.texi find.texi.tar.gz \
find-info.tar.gz find.texi.tar.gz \
find.txt tmp-doc-install find_mono.html.gz
@@ -73,9 +71,6 @@ findutils.texi_html_node.tar.gz: find.html
tar zcf $@ $<
tar zcf $@ find.html
-dblocation.texi: ../locate/dblocation.texi
@ -83,14 +83,14 @@ index c2714dd..01367a4 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -7,7 +7,6 @@
@c @setchapternewpage odd
@c %**end of header
@include version.texi
-@include dblocation.texi
@iftex
@finalout
@@ -575,8 +574,7 @@ the databases are updated, and the directories for which they contain
@@ -572,8 +571,7 @@ the databases are updated, and the directories for which they contain
entries.
Here is how to select which file name databases @code{locate}
@ -100,7 +100,7 @@ index c2714dd..01367a4 100644
@table @code
@item --database=@var{path}
@@ -2929,13 +2927,9 @@ thrashing the network.
@@ -2993,13 +2991,9 @@ thrashing the network.
directories are indexed by each database file.
The default location for the locate database depends on how findutils
@ -117,7 +117,7 @@ index c2714dd..01367a4 100644
@node Database Formats
@section Database Formats
@@ -3460,8 +3454,7 @@ present.
@@ -3508,8 +3502,7 @@ present.
@item --database=@var{path}
@itemx -d @var{path}
@ -127,7 +127,7 @@ index c2714dd..01367a4 100644
name databases in @var{path}, which is a colon-separated list of
database file names. You can also use the environment variable
@code{LOCATE_PATH} to set the list of database files to search. The
@@ -3636,8 +3629,7 @@ The environment variable @code{PRUNEFS} also sets this value. Default
@@ -3684,8 +3677,7 @@ The environment variable @code{PRUNEFS} also sets this value. Default
is @file{nfs NFS proc}.
@item --output=@var{dbfile}
@ -137,7 +137,7 @@ index c2714dd..01367a4 100644
@item --localuser=@var{user}
The user to search the non-network directories as, using @code{su}.
@@ -5631,7 +5623,7 @@ See the manual of the system call @code{dup2(2)}.
@@ -5709,7 +5701,7 @@ See the manual of the system call @code{dup2(2)}.
@section Error Messages From @code{locate}
@table @samp
@ -146,7 +146,7 @@ index c2714dd..01367a4 100644
The @code{locate} program relies on a database which is periodically
built by the @code{updatedb} program. That hasn't happened in a long
time. To fix this problem, run @code{updatedb} manually. This can
@@ -5639,7 +5631,7 @@ often happen on systems that are generally not left on, so the
@@ -5717,7 +5709,7 @@ often happen on systems that are generally not left on, so the
periodic ``cron'' task which normally does this doesn't get a chance
to run.

View File

@ -1,164 +0,0 @@
From b9f9ed14bda93ecb407129b69e6476813c250046 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 15 Apr 2020 20:50:32 -0700
Subject: [PATCH] fts: remove NOSTAT_LEAF_OPTIMIZATION
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
It caused find and du to dump core, and it was useful
only for obsolescent Linux filesystems anyway. Problem reported in:
https://lists.gnu.org/r/bug-gnulib/2020-04/msg00068.html
Quite possibly there is still a serious underlying fts bug with
tight-loop-check and mutating file systems, but if so this patch
should cause the bug to be triggered less often.
* lib/fts.c (enum leaf_optimization): Remove
NOSTAT_LEAF_OPTIMIZATION, as its problematic.
(S_MAGIC_REISERFS, S_MAGIC_XFS): Remove; no longer needed.
(leaf_optimization): Remove special cases for ReiserFS and XFS.
(fts_read): Remove NOSTAT_LEAF_OPTIMIZATION code.
* lib/fts_.h (struct _ftsent.fts_n_dirs_remaining):
Remove. All uses removed.
Upstream-commit: 47bf2cf3184027c1eb9c1dfeea5c5b8b2d69710d
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
gl/lib/fts.c | 56 ++++++++-------------------------------------------
gl/lib/fts_.h | 5 -----
2 files changed, 8 insertions(+), 53 deletions(-)
diff --git a/gl/lib/fts.c b/gl/lib/fts.c
index 1093ce5..dfe3fef 100644
--- a/gl/lib/fts.c
+++ b/gl/lib/fts.c
@@ -445,7 +445,6 @@ fts_open (char * const *argv,
if ((parent = fts_alloc(sp, "", 0)) == NULL)
goto mem2;
parent->fts_level = FTS_ROOTPARENTLEVEL;
- parent->fts_n_dirs_remaining = -1;
}
/* The classic fts implementation would call fts_stat with
@@ -634,9 +633,8 @@ fts_close (FTS *sp)
}
/* Minimum link count of a traditional Unix directory. When leaf
- optimization is OK and MIN_DIR_NLINK <= st_nlink, then st_nlink is
- an upper bound on the number of subdirectories (counting "." and
- ".."). */
+ optimization is OK and a directory's st_nlink == MIN_DIR_NLINK,
+ then the directory has no subdirectories. */
enum { MIN_DIR_NLINK = 2 };
/* Whether leaf optimization is OK for a directory. */
@@ -645,12 +643,8 @@ enum leaf_optimization
/* st_nlink is not reliable for this directory's subdirectories. */
NO_LEAF_OPTIMIZATION,
- /* Leaf optimization is OK, but is not useful for avoiding stat calls. */
- OK_LEAF_OPTIMIZATION,
-
- /* Leaf optimization is not only OK: it is useful for avoiding
- stat calls, because dirent.d_type does not work. */
- NOSTAT_LEAF_OPTIMIZATION
+ /* st_nlink == 2 means the directory lacks subdirectories. */
+ OK_LEAF_OPTIMIZATION
};
#if (defined __linux__ || defined __ANDROID__) \
@@ -663,9 +657,7 @@ enum leaf_optimization
# define S_MAGIC_CIFS 0xFF534D42
# define S_MAGIC_NFS 0x6969
# define S_MAGIC_PROC 0x9FA0
-# define S_MAGIC_REISERFS 0x52654973
# define S_MAGIC_TMPFS 0x1021994
-# define S_MAGIC_XFS 0x58465342
# ifdef HAVE___FSWORD_T
typedef __fsword_t fsword;
@@ -786,23 +778,15 @@ dirent_inode_sort_may_be_useful (FTSENT const *p, int dir_fd)
}
/* Given an FTS entry P for a directory with descriptor DIR_FD,
- return true if it is both useful and valid to apply leaf optimization.
- The optimization is useful only for file systems that lack usable
- dirent.d_type info. The optimization is valid if an st_nlink value
- of at least MIN_DIR_NLINK is an upper bound on the number of
- subdirectories of D, counting "." and ".." as subdirectories.
+ return whether it is valid to apply leaf optimization.
+ The optimization is valid if a directory's st_nlink value equal
+ to MIN_DIR_NLINK means the directory has no subdirectories.
DIR_FD is negative if unavailable. */
static enum leaf_optimization
leaf_optimization (FTSENT const *p, int dir_fd)
{
switch (filesystem_type (p, dir_fd))
{
- /* List here the file system types that may lack usable dirent.d_type
- info, yet for which the optimization does apply. */
- case S_MAGIC_REISERFS:
- case S_MAGIC_XFS: /* XFS lacked it until 2013-08-22 commit. */
- return NOSTAT_LEAF_OPTIMIZATION;
-
case 0:
/* Leaf optimization is unsafe if the file system type is unknown. */
FALLTHROUGH;
@@ -1027,26 +1011,7 @@ check_for_dir:
if (p->fts_info == FTS_NSOK)
{
if (p->fts_statp->st_size == FTS_STAT_REQUIRED)
- {
- FTSENT *parent = p->fts_parent;
- if (parent->fts_n_dirs_remaining == 0
- && ISSET(FTS_NOSTAT)
- && ISSET(FTS_PHYSICAL)
- && (leaf_optimization (parent, sp->fts_cwd_fd)
- == NOSTAT_LEAF_OPTIMIZATION))
- {
- /* nothing more needed */
- }
- else
- {
- p->fts_info = fts_stat(sp, p, false);
- if (S_ISDIR(p->fts_statp->st_mode)
- && p->fts_level != FTS_ROOTLEVEL
- && 0 < parent->fts_n_dirs_remaining
- && parent->fts_n_dirs_remaining != (nlink_t) -1)
- parent->fts_n_dirs_remaining--;
- }
- }
+ p->fts_info = fts_stat(sp, p, false);
else
fts_assert (p->fts_statp->st_size == FTS_NO_STAT_REQUIRED);
}
@@ -1830,11 +1795,6 @@ err: memset(sbp, 0, sizeof(struct stat));
}
if (S_ISDIR(sbp->st_mode)) {
- p->fts_n_dirs_remaining
- = ((sbp->st_nlink < MIN_DIR_NLINK
- || p->fts_level <= FTS_ROOTLEVEL)
- ? -1
- : sbp->st_nlink - (ISSET (FTS_SEEDOT) ? 0 : MIN_DIR_NLINK));
if (ISDOT(p->fts_name)) {
/* Command-line "." and ".." are real directories. */
return (p->fts_level == FTS_ROOTLEVEL ? FTS_D : FTS_DOT);
diff --git a/gl/lib/fts_.h b/gl/lib/fts_.h
index d40a116..2e76cc4 100644
--- a/gl/lib/fts_.h
+++ b/gl/lib/fts_.h
@@ -227,11 +227,6 @@ typedef struct _ftsent {
size_t fts_namelen; /* strlen(fts_name) */
- /* If not (nlink_t) -1, an upper bound on the number of
- remaining subdirectories of interest. If this becomes
- zero, some work can be avoided. */
- nlink_t fts_n_dirs_remaining;
-
# define FTS_D 1 /* preorder directory */
# define FTS_DC 2 /* directory that causes cycles */
# define FTS_DEFAULT 3 /* none of the above */
--
2.21.1

View File

@ -1,132 +0,0 @@
From 498674f70816bb380ce11e62b620e4ece7763fd0 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Sun, 9 Feb 2020 19:58:07 +0100
Subject: [PATCH] tests: avoid FP when run as root
Test 'sv-bug-54171' produced a false-positive error as 'find' would
not fail for an unreadable directory when run as root.
Migrate the test to the newer shell-based tests, and add the
'skip_if_root_' guard to avoid a false-positive.
* find/testsuite/find.posix/sv-bug-54171.exp: Remove.
* find/testsuite/find.posix/sv-bug-54171.xo: Remove.
* find/testsuite/Makefile.am (EXTRA_DIST_XO, EXTRA_DIST_EXP): Remove the
above deleted test.
* tests/find/depth-unreadable-dir.sh: Add test.
* tests/local.mk (all_tests): Reference it.
Test FP introduced in commit v4.6.0-178-gdf4610d0.
Fixes https://savannah.gnu.org/bugs/?57762
and https://bugzilla.redhat.com/1799064
Upstream-commit: 2f9fff9e1f0c0b7a9034d7c46ca197ce693c4736
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
find/testsuite/Makefile.am | 2 --
find/testsuite/find.posix/sv-bug-54171.exp | 5 ---
find/testsuite/find.posix/sv-bug-54171.xo | 1 -
tests/find/depth-unreadable-dir.sh | 39 ++++++++++++++++++++++
tests/local.mk | 1 +
5 files changed, 40 insertions(+), 8 deletions(-)
delete mode 100644 find/testsuite/find.posix/sv-bug-54171.exp
delete mode 100644 find/testsuite/find.posix/sv-bug-54171.xo
create mode 100755 tests/find/depth-unreadable-dir.sh
diff --git a/find/testsuite/Makefile.am b/find/testsuite/Makefile.am
index d252451a..77a2902c 100644
--- a/find/testsuite/Makefile.am
+++ b/find/testsuite/Makefile.am
@@ -119,7 +119,6 @@ find.posix/prune-stat.xo \
find.posix/sizetype.xo \
find.posix/sv-bug-15235.xo \
find.posix/sv-bug-19613.xo \
-find.posix/sv-bug-54171.xo \
find.posix/typesize.xo
@@ -246,7 +245,6 @@ find.posix/sv-bug-15235.exp \
find.posix/sv-bug-19605.exp \
find.posix/sv-bug-19613.exp \
find.posix/sv-bug-19617.exp \
-find.posix/sv-bug-54171.exp \
find.posix/typesize.exp \
find.posix/user-empty.exp \
find.posix/user-missing.exp
diff --git a/find/testsuite/find.posix/sv-bug-54171.exp b/find/testsuite/find.posix/sv-bug-54171.exp
deleted file mode 100644
index 8e5448fb..00000000
--- a/find/testsuite/find.posix/sv-bug-54171.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-exec rm -rf tmp
-exec mkdir tmp tmp/dir
-exec chmod 0311 tmp/dir
-find_start f {tmp -depth -name dir }
-exec rm -rf tmp
diff --git a/find/testsuite/find.posix/sv-bug-54171.xo b/find/testsuite/find.posix/sv-bug-54171.xo
deleted file mode 100644
index 2dc4706a..00000000
--- a/find/testsuite/find.posix/sv-bug-54171.xo
+++ /dev/null
@@ -1 +0,0 @@
-tmp/dir
diff --git a/tests/find/depth-unreadable-dir.sh b/tests/find/depth-unreadable-dir.sh
new file mode 100755
index 00000000..86e2fd60
--- /dev/null
+++ b/tests/find/depth-unreadable-dir.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+# find -depth: ensure to output an unreadable directory.
+
+# Copyright (C) 2020 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"; fu_path_prepend_
+print_ver_ find
+
+# Find run as root would not fail for an unreadable directory.
+skip_if_root_
+
+# Prepare an unreadable directory, and the expected stdout/stderr.
+mkdir tmp tmp/dir \
+ && chmod 0311 tmp/dir \
+ && echo 'tmp/dir' > exp \
+ && echo "find: 'tmp/dir': Permission denied" > experr \
+ || framework_failure_
+
+# Run FTS-based find with -depth; versions < 4.7.0 failed to output
+# an unreadable directory (see #54171).
+returns_ 1 find tmp -depth -name dir > out 2> err || fail=1
+
+compare exp out || fail=1
+compare experr err || fail=1
+
+Exit $fail
diff --git a/tests/local.mk b/tests/local.mk
index dccc7342..986df55e 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -106,6 +106,7 @@ check-root:
all_tests = \
tests/misc/help-version.sh \
+ tests/find/depth-unreadable-dir.sh \
tests/find/many-dir-entries-vs-OOM.sh \
tests/find/name-lbracket-literal.sh \
tests/find/printf_escapechars.sh \
--
2.21.1

View File

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEpRidtpwRZNMwApNmRlAu95aRcZUFAl1oMFIACgkQRlAu95aR
cZW3SAgAkWnO8T7D2ljH3BU7h1VRdZyqCsyinorRt7/LdGVIGZ3pcc0pux+dhOxo
p1ZuwSBczXJ7+R9WCMTx6wlfn2wXerBGWjxVsU1J8LIhxou8su4Otp2NPSf1iRqe
TfJ8Fj2uJB3FzOPz93jq6MQhwn0DZyI5++TgxtuRIFEKHZh29Op3i3ceb+KUBknd
dIf/p7B25pc7OG8sn1ClaL6+fORvMcVg/VoVrD4KYXLkKgIHuwUutCGXlkaEx0tD
sZQ9Rzh1A4NF5gyHkeSWZFS8MHnOixOykPtxJWfrQRFkTLRNgICy+vBsKiL5tupG
EvOKD0mniJnHJW/jal/8hIz4zoq31A==
=YyBw
-----END PGP SIGNATURE-----

View File

@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEpRidtpwRZNMwApNmRlAu95aRcZUFAl/53q8ACgkQRlAu95aR
cZVPlwgAshQRkDwagj5Zi1tFovX2GBbGfoTT9PddleIqGCieCy28GvVRkQNKf/q9
8hjZ5L/dKUhMPQuoiB6zlL2iVzWz/8pHxBIbCWUqWEIyoubSzPI6oSfpKmzODLNk
2BBWcM+7uTPEK7Q/l2GCk7R1txzFM7izk5wwyVNtq0ARjU0njUm3w6wSgKUcXKpR
deV4psEwSkkUzcZ/IBXKZrW41Dtj4LaS0AsIqj4j1lUsDyYd/NC4Z66GAlg80PRK
7TOv8AHels0nXpgJtWiwcIz74MmCfbMq8IL1vzoTVEMMYItRkGyREoGTKnDecjCm
w9GvH4sTRO0h7JDWjKMDXD2ZxHxXmg==
=QPJY
-----END PGP SIGNATURE-----

View File

@ -1,7 +1,7 @@
Summary: The GNU versions of find utilities (find and xargs)
Name: findutils
Version: 4.7.0
Release: 7%{?dist}
Version: 4.8.0
Release: 1%{?dist}
Epoch: 1
License: GPLv3+
URL: http://www.gnu.org/software/findutils/
@ -22,12 +22,6 @@ Patch4: findutils-4.6.0-test-lock.patch
# implement the -noleaf option of find (#1252549)
Patch5: findutils-4.6.0-leaf-opt.patch
# make upstream test-suite work with root privileges (#1799064)
Patch6: findutils-4.7.0-root-tests.patch
# simplify leaf optimization for XFS (#1823247)
Patch7: findutils-4.7.0-leaf-opt-xfs.patch
Conflicts: filesystem < 3
Provides: /bin/find
Provides: bundled(gnulib)
@ -78,10 +72,6 @@ git commit -m "remove ignored files from git"
# apply all patches
%autopatch
# replace weirdo constant in gnulib tests causing test failures on armv7hl
sed -e 's/1729576/EPERM/' \
-i gnulib-tests/test-{perror2,strerror_r}.c
# needed because of findutils-4.5.15-no-locate.patch
autoreconf -fiv
git add --all .
@ -122,6 +112,9 @@ rm -f %{buildroot}%{_infodir}/dir
%{_infodir}/find-maint.info.*
%changelog
* Sat Jan 09 2021 Kamil Dudka <kdudka@redhat.com> - 1:4.8.0-1
- new upstream release
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.7.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (findutils-4.7.0.tar.xz) = 650a24507f8f4ebff83ad28dd27daa4785b4038dcaadc4fe00823b976e848527074cce3f9ec34065b7f037436d2aa6e9ec099bc05d7472c29864ac2c69de7f2e
SHA512 (findutils-4.8.0.tar.xz) = eaa2da304dbeb2cd659b9210ac37da1bde4cd665c12a818eca98541c5ed5cba1050641fc0c39c0a446a5a7a87a8d654df0e0e6b0cee21752ea485188c9f1071e