Compare commits

..

2 Commits
rawhide ... f24

Author SHA1 Message Date
Kamil Dudka d6e8893bf6 findutils.spec: remove non-existing option of %autopatch 2016-06-24 13:30:57 +02:00
Kamil Dudka dab49d525d Resolves: #1299169 - disable leaf optimization for NFS 2016-06-24 13:24:07 +02:00
22 changed files with 800 additions and 666 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
/findutils-4.*.*.tar.?z
/findutils-4.*.*.tar.gz

View File

@ -1,22 +1,22 @@
From 17e470dc1acca4824b70328d733d5f99c12d0d65 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Wed, 11 May 2011 16:46:45 +0200
Subject: [PATCH] findutils-4.4.2-xautofs.patch
Subject: [PATCH 3/4] findutils-4.4.2-xautofs.patch
---
doc/find.texi | 4 ++++
find/defs.h | 3 +++
find/find.1 | 3 +++
find/ftsfind.c | 6 ++++++
find/parser.c | 9 +++++++++
find/util.c | 3 ++-
find/parser.c | 11 ++++++++++-
find/util.c | 1 +
6 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/doc/find.texi b/doc/find.texi
index c584298..9731b71 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -1606,6 +1606,10 @@ them.
@@ -1446,6 +1446,10 @@ them.
There are two ways to avoid searching certain filesystems. One way is
to tell @code{find} to only search one filesystem:
@ -31,7 +31,7 @@ diff --git a/find/defs.h b/find/defs.h
index 11d1d00..f95ce72 100644
--- a/find/defs.h
+++ b/find/defs.h
@@ -562,6 +562,9 @@ struct options
@@ -557,6 +557,9 @@ struct options
/* If true, don't cross filesystem boundaries. */
bool stay_on_filesystem;
@ -45,7 +45,7 @@ diff --git a/find/find.1 b/find/find.1
index e851f82..a4799ff 100644
--- a/find/find.1
+++ b/find/find.1
@@ -638,6 +638,9 @@ to stat them; this gives a significant increase in search speed.
@@ -520,6 +520,9 @@ to stat them; this gives a significant increase in search speed.
.IP "\-version, \-\-version"
Print the \fBfind\fR version number and exit.
@ -59,7 +59,7 @@ diff --git a/find/ftsfind.c b/find/ftsfind.c
index 9fdb8ef..bd7cc37 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -435,6 +435,12 @@ consider_visiting (FTS *p, FTSENT *ent)
@@ -485,6 +485,12 @@ consider_visiting (FTS *p, FTSENT *ent)
}
}
@ -76,50 +76,50 @@ diff --git a/find/parser.c b/find/parser.c
index 52a1ef6..995aec3 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -139,6 +139,7 @@ static bool parse_used (const struct parser_table*, char *argv[], int *
static bool parse_user (const struct parser_table*, char *argv[], int *arg_ptr);
@@ -146,6 +146,7 @@ static bool parse_user (const struct parser_table*, char *argv[], int *
static bool parse_version (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_wholename (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_xdev (const struct parser_table*, char *argv[], int *arg_ptr);
+static bool parse_xautofs (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_ignore_race (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_noignore_race (const struct parser_table*, char *argv[], int *arg_ptr);
static bool parse_warn (const struct parser_table*, char *argv[], int *arg_ptr);
@@ -304,6 +305,7 @@ static struct parser_table const parse_table[] =
PARSE_TEST_NP ("wholename", wholename), /* GNU, replaced -path, but now -path is standardized since POSIX 2008 */
@@ -306,6 +307,7 @@ static struct parser_table const parse_table[] =
PARSE_TEST_NP ("wholename", wholename), /* GNU, replaced -path, but anyway -path will soon be in POSIX */
{ARG_TEST, "writable", parse_accesscheck, pred_writable}, /* GNU, 4.3.0+ */
PARSE_OPTION ("xdev", xdev), /* POSIX */
+ PARSE_OPTION ("xautofs", xautofs),
PARSE_TEST ("xtype", xtype), /* GNU */
#ifdef UNIMPLEMENTED_UNIX
/* It's pretty ugly for find to know about archive formats.
@@ -2607,6 +2609,13 @@ parse_xdev (const struct parser_table* entry, char **argv, int *arg_ptr)
return parse_noop (entry, argv, arg_ptr);
@@ -1239,7 +1241,7 @@ operators (decreasing precedence; -and is implicit where no others are given):\n
positional options (always true): -daystart -follow -regextype\n\n\
normal options (always true, specified before other expressions):\n\
-depth --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf\n\
- --version -xdev -ignore_readdir_race -noignore_readdir_race\n"));
+ --version -xautofs -xdev -ignore_readdir_race -noignore_readdir_race\n"));
puts (_("\
tests (N can be +N or -N or N): -amin N -anewer FILE -atime N -cmin N\n\
-cnewer FILE -ctime N -empty -false -fstype TYPE -gid N -group NAME\n\
@@ -2683,6 +2685,13 @@ parse_xdev (const struct parser_table* entry, char **argv, int *arg_ptr)
}
+static bool
static bool
+parse_xautofs (const struct parser_table* entry, char **argv, int *arg_ptr)
+{
+ options.bypass_autofs = true;
+ return parse_noop (entry, argv, arg_ptr);
+}
+
static bool
+static bool
parse_ignore_race (const struct parser_table* entry, char **argv, int *arg_ptr)
{
options.ignore_readdir_race = true;
diff --git a/find/util.c b/find/util.c
index 8577396..4d45f84 100644
--- a/find/util.c
+++ b/find/util.c
@@ -183,7 +183,7 @@ Positional options (always true):\n\
HTL (_("\n\
Normal options (always true, specified before other expressions):\n\
-depth -files0-from FILE -maxdepth LEVELS -mindepth LEVELS\n\
- -mount -noleaf -xdev -ignore_readdir_race -noignore_readdir_race\n"));
+ -mount -noleaf -xautofs -xdev -ignore_readdir_race -noignore_readdir_race\n"));
HTL (_("\n\
Tests (N can be +N or -N or N):\n\
-amin N -anewer FILE -atime N -cmin N -cnewer FILE -context CONTEXT\n\
@@ -1028,6 +1028,7 @@ set_option_defaults (struct options *p)
@@ -1017,6 +1017,7 @@ set_option_defaults (struct options *p)
p->full_days = false;
p->stay_on_filesystem = false;

View File

@ -1,7 +1,7 @@
From 690d4bd9f29a805999a3ce4651dac9585ccc9917 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Wed, 11 May 2011 16:46:57 +0200
Subject: [PATCH] findutils-4.5.7-warnings.patch
Subject: [PATCH 1/2] findutils-4.5.7-warnings.patch
---
xargs/xargs.c | 3 ++-
@ -11,7 +11,7 @@ diff --git a/xargs/xargs.c b/xargs/xargs.c
index 5e373f2..c0a8676 100644
--- a/xargs/xargs.c
+++ b/xargs/xargs.c
@@ -1346,7 +1346,8 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
@@ -1289,7 +1289,8 @@ xargs_do_exec (struct buildcmd_control *ctl, void *usercontext, int argc, char *
* utility if we run it, for POSIX compliance on the
* handling of exit values.
*/
@ -24,3 +24,30 @@ index 5e373f2..c0a8676 100644
--
1.7.1
From c5654b9ca5f50daa1ca406ebd7b4546f24d00db6 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Mon, 23 Sep 2013 15:04:03 +0200
Subject: [PATCH 2/2] parser: silence a [-Wmaybe-uninitialized] GCC warning
... caused by a missing model of error()
---
find/parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/find/parser.c b/find/parser.c
index 89d8bcf..8c399d7 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -2723,7 +2723,7 @@ insert_type (char **argv, int *arg_ptr,
const struct parser_table *entry,
PRED_FUNC which_pred)
{
- mode_t type_cell;
+ mode_t type_cell /* to silence GCC warning */ = 0;
struct predicate *our_pred;
float rate = 0.5;
const char *typeletter;
--
1.9.3

View File

@ -0,0 +1,141 @@
From 1328926a705fdb4728c1f255dd368de928736d39 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Fri, 25 Sep 2015 16:09:39 +0200
Subject: [PATCH 1/3] fts: introduce the FTS_NOLEAF flag
The flag is needed to implement the -noleaf option of find.
* lib/fts.c (link_count_optimize_ok): Implement the FTS_NOLEAF flag.
* lib/fts_.h (FTS_NOLEAF): New macro, shifted conflicting constants.
---
gl/lib/fts.c | 4 ++++
gl/lib/fts_.h | 12 +++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/gl/lib/fts.c b/gl/lib/fts.c
index d2d404f..808466f 100644
--- a/gl/lib/fts.c
+++ b/gl/lib/fts.c
@@ -788,6 +788,10 @@ link_count_optimize_ok (FTSENT const *p)
bool opt_ok;
struct LCO_ent *t2;
+ if (ISSET(FTS_NOLEAF))
+ /* leaf optimization explicitly disabled by the FTS_NOLEAF flag */
+ return false;
+
/* If we're not in CWDFD mode, don't bother with this optimization,
since the caller is not serious about performance. */
if (!ISSET(FTS_CWDFD))
diff --git a/gl/lib/fts_.h b/gl/lib/fts_.h
index 63d4b74..f1d519b 100644
--- a/gl/lib/fts_.h
+++ b/gl/lib/fts_.h
@@ -155,10 +155,16 @@ typedef struct {
from input path names during fts_open initialization. */
# define FTS_VERBATIM 0x1000
-# define FTS_OPTIONMASK 0x1fff /* valid user option mask */
+ /* Disable leaf optimization (which eliminates stat() calls during traversal,
+ based on the count of nested directories stored in stat.st_nlink of each
+ directory). Note that the optimization is by default enabled only for
+ selected file systems, and only if the FTS_CWDFD flag is set. */
+# define FTS_NOLEAF 0x2000
-# define FTS_NAMEONLY 0x2000 /* (private) child names only */
-# define FTS_STOP 0x4000 /* (private) unrecoverable error */
+# define FTS_OPTIONMASK 0x3fff /* valid user option mask */
+
+# define FTS_NAMEONLY 0x4000 /* (private) child names only */
+# define FTS_STOP 0x8000 /* (private) unrecoverable error */
int fts_options; /* fts_open options, global flags */
/* Map a directory's device number to a boolean. The boolean is
--
2.5.0
From c186934e6e37ddadf7511abb9b1045192757618e Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Fri, 25 Sep 2015 19:13:15 +0200
Subject: [PATCH 2/3] ftsfind: propagate the -noleaf option to FTS
* find/ftsfind.c (find): Propagate the -noleaf option to FTS.
---
find/ftsfind.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/find/ftsfind.c b/find/ftsfind.c
index 5159470..e34b672 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -559,6 +559,9 @@ find (char *arg)
if (options.stay_on_filesystem)
ftsoptions |= FTS_XDEV;
+ if (options.no_leaf_check)
+ ftsoptions |= FTS_NOLEAF;
+
p = fts_open (arglist, ftsoptions, NULL);
if (NULL == p)
{
--
2.5.0
From 2edb6204bab0acb0ef8cdde7499396afd9c66131 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Mon, 18 Jan 2016 17:29:28 +0000
Subject: [PATCH 3/3] fts: don't unconditionally use leaf optimization for NFS
NFS st_nlink are not accurate on all implementations,
leading to aborts() if that assumption is made.
See <https://bugzilla.redhat.com/1299169>
* lib/fts.c (leaf_optimization_applies): Remove NFS from
the white list, and document the issue.
Upstream-commit: 85717b68b03bf85016c5079fbbf0c8aa2b182ba6
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
gl/lib/fts.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/gl/lib/fts.c b/gl/lib/fts.c
index 55cd554..6e1eaf5 100644
--- a/gl/lib/fts.c
+++ b/gl/lib/fts.c
@@ -718,22 +718,23 @@ leaf_optimization_applies (int dir_fd)
switch (fs_buf.f_type)
{
- case S_MAGIC_NFS:
- /* NFS provides usable dirent.d_type but not necessarily for all entries
- of large directories. See <https://bugzilla.redhat.com/1252549>. */
- return true;
-
/* List here the file system types that lack usable dirent.d_type
info, yet for which the optimization does apply. */
case S_MAGIC_REISERFS:
case S_MAGIC_XFS:
return true;
+ /* Explicitly list here any other file system type for which the
+ optimization is not applicable, but need documentation. */
+ case S_MAGIC_NFS:
+ /* NFS provides usable dirent.d_type but not necessarily for all entries
+ of large directories, so as per <https://bugzilla.redhat.com/1252549>
+ NFS should return true. However st_nlink values are not accurate on
+ all implementations as per <https://bugzilla.redhat.com/1299169>. */
+ /* fall through */
case S_MAGIC_PROC:
- /* Explicitly listing this or any other file system type for which
- the optimization is not applicable is not necessary, but we leave
- it here to document the risk. Per http://bugs.debian.org/143111,
- /proc may have bogus stat.st_nlink values. */
+ /* Per <http://bugs.debian.org/143111> /proc may have
+ bogus stat.st_nlink values. */
/* fall through */
default:
return false;
--
2.5.5

View File

@ -6,9 +6,24 @@ Subject: [PATCH 1/2] Revert "Don't include dblocation.texi from original spot,
This reverts commit f59d88e456553dfe0b5185caf75e4041285fd595.
---
doc/Makefile.am | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
configure.ac | 2 +-
doc/Makefile.am | 8 +-------
doc/find.texi | 2 +-
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7962719..ce0e768 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,7 +70,7 @@ AC_PROG_CPP
dnl for gnulib
gl_EARLY
-AC_PROG_LN_S
+
AC_PROG_INSTALL
AC_CHECK_TOOLS([AR], [ar])
AC_CHECK_TOOLS([RANLIB], [ranlib], [:])
diff --git a/doc/Makefile.am b/doc/Makefile.am
index f6f7443..6fbf57b 100644
--- a/doc/Makefile.am
@ -21,21 +36,32 @@ index f6f7443..6fbf57b 100644
-nodist_find_TEXINFOS = dblocation.texi
find_maint_TEXINFOS = fdl.texi
MOSTLYCLEANFILES = find.cps
-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.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 $@ find.html
-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
MAKEINFOTXT = $(MAKEINFO) --plaintext
@@ -69,7 +67,3 @@ find_mono.html: find.texi
# for "make all" or "make install" (or even "make check").
findutils.texi_html_node.tar.gz: find.html
tar zcf $@ $<
-
-
-dblocation.texi: ../locate/dblocation.texi
- $(LN_S) ../locate/dblocation.texi $@
-
find-info.tar.gz:
$(MKDIR_P) tmp-doc-install/info
$(MAKE) $(AM_MAKEFLAGS) \
diff --git a/doc/find.texi b/doc/find.texi
index a83a645..c2714dd 100644
--- a/doc/find.texi
+++ b/doc/find.texi
@@ -7,7 +7,7 @@
@c %**end of header
@include version.texi
-@include dblocation.texi
+@include ../locate/dblocation.texi
@iftex
@finalout
--
2.5.0
@ -46,30 +72,29 @@ Date: Wed, 11 May 2011 16:46:13 +0200
Subject: [PATCH 2/2] findutils-4.4.0-no-locate.patch
---
Makefile.am | 2 +-
configure.ac | 2 --
doc/find.texi | 24 ++++++++----------------
tests/local.mk | 2 +-
4 files changed, 10 insertions(+), 20 deletions(-)
Makefile.am | 2 +-
configure.ac | 2 --
doc/find.texi | 24 ++++++++----------------
3 files changed, 9 insertions(+), 19 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index af82d54..6ad453b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -35,7 +35,7 @@ DISTCLEANFILES = tool-versions.txt
@@ -9,7 +9,7 @@ DISTCLEANFILES = tool-versions.txt
# "gnulib-tests" is the gnulib unit test dir.
-SUBDIRS = gl build-aux lib find xargs locate doc po m4 gnulib-tests
+SUBDIRS = gl build-aux lib find xargs doc po m4 gnulib-tests
# "tests" is the gnulib unit test dir.
-SUBDIRS = gl tests build-aux lib find xargs locate doc po m4
+SUBDIRS = gl tests build-aux lib find xargs doc po m4
ALL_RECURSIVE_TARGETS =
ACLOCAL_AMFLAGS = -I gl/m4 -I m4
diff --git a/configure.ac b/configure.ac
index ce0e768..521e665 100644
--- a/configure.ac
+++ b/configure.ac
@@ -309,8 +309,6 @@ find/testsuite/Makefile
@@ -248,8 +248,6 @@ find/testsuite/Makefile
gl/Makefile
gl/lib/Makefile
lib/Makefile
@ -83,14 +108,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 dblocation.texi
@include version.texi
-@include ../locate/dblocation.texi
@iftex
@finalout
@@ -661,8 +660,7 @@ the databases are updated, and the directories for which they contain
@@ -571,8 +570,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 +125,7 @@ index c2714dd..01367a4 100644
@table @code
@item --database=@var{path}
@@ -3112,13 +3110,9 @@ thrashing the network.
@@ -2892,13 +2890,9 @@ thrashing the network.
directories are indexed by each database file.
The default location for the locate database depends on how findutils
@ -109,7 +134,7 @@ index c2714dd..01367a4 100644
-
-If no database exists at @file{@value{LOCATE_DB}} but the user did not
-specify where to look (by using @samp{-d} or setting
-@env{LOCATE_PATH}), then @code{locate} will also check for a
-@code{LOCATE_PATH}), then @code{locate} will also check for a
-``secure'' database in @file{/var/lib/slocate/slocate.db}.
+is built. If user did not specify where to look (by using @samp{-d}
+or setting @code{LOCATE_PATH}), then @code{locate} will also check for
@ -117,7 +142,7 @@ index c2714dd..01367a4 100644
@node Database Formats
@section Database Formats
@@ -3627,8 +3621,7 @@ present.
@@ -3438,8 +3432,7 @@ present.
@item --database=@var{path}
@itemx -d @var{path}
@ -126,8 +151,8 @@ index c2714dd..01367a4 100644
+@code{locate} searches the file
name databases in @var{path}, which is a colon-separated list of
database file names. You can also use the environment variable
@env{LOCATE_PATH} to set the list of database files to search. The
@@ -3803,8 +3796,7 @@ The environment variable @env{PRUNEFS} also sets this value. Default
@code{LOCATE_PATH} to set the list of database files to search. The
@@ -3614,8 +3607,7 @@ The environment variable @code{PRUNEFS} also sets this value. Default
is @file{nfs NFS proc}.
@item --output=@var{dbfile}
@ -137,7 +162,7 @@ index c2714dd..01367a4 100644
@item --localuser=@var{user}
The user to search the non-network directories as, using @code{su}.
@@ -5828,7 +5820,7 @@ See the manual of the system call @code{dup2(2)}.
@@ -5635,7 +5627,7 @@ why @code{xargs} is confused by your operating system).
@section Error Messages From @code{locate}
@table @samp
@ -146,7 +171,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
@@ -5836,7 +5828,7 @@ often happen on systems that are generally not left on, so the
@@ -5643,7 +5635,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.
@ -155,19 +180,6 @@ index c2714dd..01367a4 100644
This should not happen. Re-run @code{updatedb}. If that works, but
@code{locate} still produces this error, run @code{locate --version}
and @code{updatedb --version}. These should produce the same output.
diff --git a/tests/local.mk b/tests/local.mk
index 7e52a04..ae08a56 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -15,7 +15,7 @@
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <https://www.gnu.org/licenses/>.
-built_programs = find xargs frcode locate updatedb
+built_programs = find xargs
# Indirections required so that we'll still be able to know the
# complete list of our tests even if the user overrides TESTS
--
2.5.0

View File

@ -0,0 +1,226 @@
From 443166adaf1c8b91e16a716f3b13f47493b895cc Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Tue, 31 May 2016 10:38:52 +0200
Subject: [PATCH] Fix bug #48030: find: -exec + does not pass all arguments in
certain cases
When the -exec arguments buffer (usually 128k) is full and the given
command has been executed with all that arguments, find(1) missed to
execute the command yet another time if only 1 another file would have
to be processed.
Both find(1), i.e., nowadays FTS-version, and oldfind are affected.
This bug was present since the implementation of '-exec +' in 2005,
see commit FINDUTILS_4_2_11-1-25-gf0a6ac6.
* lib/buildcmd.c (bc_push_arg): Move the assignment to set 'state->todo'
to 1 down after the immediate execution which resets that flag.
* find/testsuite/sv-48030-exec-plus-bug.sh: Add a test.
* find/testsuite/Makefile.am (test_shell_progs): Reference the test.
* NEWS (Bug Fixes): Mention the fix.
Reported by Joe Philip Ninan <indiajoe@gmail.com> in
https://savannah.gnu.org/bugs/?48030
Upstream-commit: 8cdc9767e305c9566f537af9d1acf71d1bc6ee8e
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
find/testsuite/Makefile.am | 3 +-
find/testsuite/sv-48030-exec-plus-bug.sh | 143 +++++++++++++++++++++++++++++++
lib/buildcmd.c | 10 +--
3 files changed, 150 insertions(+), 6 deletions(-)
create mode 100644 find/testsuite/sv-48030-exec-plus-bug.sh
diff --git a/find/testsuite/Makefile.am b/find/testsuite/Makefile.am
index c1369c3..ab5dbe8 100644
--- a/find/testsuite/Makefile.am
+++ b/find/testsuite/Makefile.am
@@ -258,7 +258,8 @@ test_escapechars.sh \
test_escape_c.sh \
test_inode.sh \
sv-34079.sh \
-sv-34976-execdir-fd-leak.sh
+sv-34976-execdir-fd-leak.sh \
+sv-48030-exec-plus-bug.sh
EXTRA_DIST = $(EXTRA_DIST_EXP) $(EXTRA_DIST_XO) $(EXTRA_DIST_GOLDEN) \
$(test_shell_progs) binary_locations.sh checklists.py
diff --git a/find/testsuite/sv-48030-exec-plus-bug.sh b/find/testsuite/sv-48030-exec-plus-bug.sh
new file mode 100755
index 0000000..4dbf149
--- /dev/null
+++ b/find/testsuite/sv-48030-exec-plus-bug.sh
@@ -0,0 +1,143 @@
+#! /bin/sh
+# Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
+#
+
+# This test verifies that find invokes the given command for the
+# multiple-argument sytax '-exec CMD {} +'. Between FINDUTILS-4.2.12
+# and v4.6.0, find(1) would have failed to execute CMD another time
+# if there was only one last single file argument.
+
+testname="$(basename $0)"
+
+. "${srcdir}"/binary_locations.sh
+
+die() {
+ echo "$@" >&2
+ exit 1
+}
+
+# This is used to simplify checking of the return value
+# which is useful when ensuring a command fails as desired.
+# I.e., just doing `command ... &&fail=1` will not catch
+# a segfault in command for example. With this helper you
+# instead check an explicit exit code like
+# returns_ 1 command ... || fail
+returns_ () {
+ # Disable tracing so it doesn't interfere with stderr of the wrapped command
+ { set +x; } 2>/dev/null
+
+ local exp_exit="$1"
+ shift
+ "$@"
+ test $? -eq $exp_exit && ret_=0 || ret_=1
+
+ set -x
+ { return $ret_; } 2>/dev/null
+}
+
+# Define the nicest compare available (borrowed from gnulib).
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
+ && diff -u Makefile "$0" 2>/dev/null | grep '^[+]#!' >/dev/null; then
+ # diff accepts the -u option and does not (like AIX 7 'diff') produce an
+ # extra space on column 1 of every content line.
+ if test -z "$diff_out_"; then
+ compare () { diff -u "$@"; }
+ else
+ compare ()
+ {
+ if diff -u "$@" > diff.out; then
+ # No differences were found, but Solaris 'diff' produces output
+ # "No differences encountered". Hide this output.
+ rm -f diff.out
+ true
+ else
+ cat diff.out
+ rm -f diff.out
+ false
+ fi
+ }
+ fi
+elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
+ if test -z "$diff_out_"; then
+ compare () { diff -c "$@"; }
+ else
+ compare ()
+ {
+ if diff -c "$@" > diff.out; then
+ # No differences were found, but AIX and HP-UX 'diff' produce output
+ # "No differences encountered" or "There are no differences between the
+ # files.". Hide this output.
+ rm -f diff.out
+ true
+ else
+ cat diff.out
+ rm -f diff.out
+ false
+ fi
+ }
+ fi
+elif cmp -s /dev/null /dev/null 2>/dev/null; then
+ compare () { cmp -s "$@"; }
+else
+ compare () { cmp "$@"; }
+fi
+
+DIR='RashuBug'
+# Name of the CMD to execute: the file name must be 6 characters long
+# (to trigger the bug in combination with the test files).
+CMD='tstcmd'
+
+# Create test files.
+make_test_data() {
+ # Create the CMD script and check that it works.
+ mkdir "$DIR" 'bin' \
+ && echo 'printf "%s\n" "$@"' > "bin/$CMD" \
+ && chmod +x "bin/$CMD" \
+ && PATH="$PWD/bin:$PATH" \
+ && [ $( "${ftsfind}" bin -maxdepth 0 -exec "$CMD" '{}' + ) = 'bin' ] \
+ || return 1
+
+ # Create expected output file - also used for creating the test data.
+ { seq -f "${DIR}/abcdefghijklmnopqrstuv%04g" 901 &&
+ seq -f "${DIR}/abcdefghijklmnopqrstu%04g" 902 3719
+ } > exp2 \
+ && LC_ALL=C sort exp2 > exp \
+ && rm exp2 \
+ || return 1
+
+ # Create test files, and check if test data has been created correctly.
+ xargs touch < exp \
+ && [ -f "${DIR}/abcdefghijklmnopqrstu3719" ] \
+ && [ 3719 = $( "${ftsfind}" "$DIR" -type f | wc -l ) ] \
+ || return 1
+}
+
+set -x
+tmpdir="$(mktemp -d)" \
+ && cd "$tmpdir" \
+ && make_test_data "${tmpdir}" \
+ || die "FAIL: failed to set up the test in ${tmpdir}"
+
+fail=0
+for exe in "${ftsfind}" "${oldfind}"; do
+ "$exe" "$DIR" -type f -exec "$CMD" '{}' + > out || fail=1
+ LC_ALL=C sort out > out2 || fail=1
+ compare exp out2 || fail=1
+done
+
+cd ..
+rm -rf "${tmpdir}" || exit 1
+exit $fail
diff --git a/lib/buildcmd.c b/lib/buildcmd.c
index a58f67e..27e9ce5 100644
--- a/lib/buildcmd.c
+++ b/lib/buildcmd.c
@@ -356,11 +356,6 @@ bc_push_arg (struct buildcmd_control *ctl,
assert (arg != NULL);
- if (!initial_args)
- {
- state->todo = 1;
- }
-
if (!terminate)
{
if (state->cmd_argv_chars + len + pfxlen > ctl->arg_max)
@@ -380,6 +375,11 @@ bc_push_arg (struct buildcmd_control *ctl,
bc_do_exec (ctl, state);
}
+ if (!initial_args)
+ {
+ state->todo = 1;
+ }
+
if (state->cmd_argc >= state->cmd_argv_alloc)
{
/* XXX: we could use extendbuf() here. */
--
2.5.5

View File

@ -0,0 +1,195 @@
From d844b7bbf3952998a906f21ba432aa62a3b9c7c6 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Tue, 14 Jun 2016 20:49:42 +0200
Subject: [PATCH] Fix bug #48180: find: avoid segfault for internal '-noop'
option
The pseudo-option '-noop' was never meant to be exposed to the user
interface. If specified by the user, find(1) segfaulted.
Bug introduced in commit FINDUTILS_4_3_0-1-12-g6b8a4db.
* find/parser.c (struct parser_table): Rename the parser_name element of
the ARG_NOOP entry from 'noop' to '--noop', thus indicating its pure
internal character.
(found_parser): Return NULL when the user has passed the '---noop' option;
the caller does the error handling.
* find/testsuite/sv-48180-refuse-noop.sh: Add test.
* find/testsuite/Makefile.am (test_shell_progs): Reference the test.
* NEWS (Bug fixes): Document the fix.
Reported by Tavian Barnes <tavianator@tavianator.com> in
https://savannah.gnu.org/bugs/?48180
Upstream-commit: 595060f28eb5f658fa8d98970959c617fab0f078
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
find/parser.c | 6 +-
find/testsuite/Makefile.am | 3 +-
find/testsuite/sv-48180-refuse-noop.sh | 117 +++++++++++++++++++++++++++++++++
3 files changed, 124 insertions(+), 2 deletions(-)
create mode 100644 find/testsuite/sv-48180-refuse-noop.sh
diff --git a/find/parser.c b/find/parser.c
index 2d45349..697b2a2 100644
--- a/find/parser.c
+++ b/find/parser.c
@@ -321,7 +321,8 @@ static struct parser_table const parse_table[] =
*/
{ARG_TEST, "false", parse_false, pred_false}, /* GNU */
{ARG_TEST, "true", parse_true, pred_true }, /* GNU */
- {ARG_NOOP, "noop", NULL, pred_true }, /* GNU, internal use only */
+ /* Internal pseudo-option, therefore 3 minus: ---noop. */
+ {ARG_NOOP, "--noop", NULL, pred_true }, /* GNU, internal use only */
/* Various other cases that don't fit neatly into our macro scheme. */
{ARG_TEST, "help", parse_help, NULL}, /* GNU */
@@ -596,6 +597,9 @@ found_parser (const char *original_arg, const struct parser_table *entry)
*/
if (entry->type != ARG_POSITIONAL_OPTION)
{
+ if (entry->type == ARG_NOOP)
+ return NULL; /* internal use only, trap -noop here. */
+
/* Something other than -follow/-daystart.
* If this is an option, check if it followed
* a non-option and if so, issue a warning.
diff --git a/find/testsuite/Makefile.am b/find/testsuite/Makefile.am
index ab5dbe8..1371c70 100644
--- a/find/testsuite/Makefile.am
+++ b/find/testsuite/Makefile.am
@@ -259,7 +259,8 @@ test_escape_c.sh \
test_inode.sh \
sv-34079.sh \
sv-34976-execdir-fd-leak.sh \
-sv-48030-exec-plus-bug.sh
+sv-48030-exec-plus-bug.sh \
+sv-48180-refuse-noop.sh
EXTRA_DIST = $(EXTRA_DIST_EXP) $(EXTRA_DIST_XO) $(EXTRA_DIST_GOLDEN) \
$(test_shell_progs) binary_locations.sh checklists.py
diff --git a/find/testsuite/sv-48180-refuse-noop.sh b/find/testsuite/sv-48180-refuse-noop.sh
new file mode 100755
index 0000000..974f0f0
--- /dev/null
+++ b/find/testsuite/sv-48180-refuse-noop.sh
@@ -0,0 +1,117 @@
+#! /bin/sh
+# Copyright (C) 2016 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 <http://www.gnu.org/licenses/>.
+#
+
+# This test verifies that find refuses the internal -noop, ---noop option.
+# Between findutils-4.3.1 and 4.6, find dumped core ($? = 139).
+
+testname="$(basename $0)"
+
+. "${srcdir}"/binary_locations.sh
+
+die() {
+ echo "$@" >&2
+ exit 1
+}
+
+# This is used to simplify checking of the return value
+# which is useful when ensuring a command fails as desired.
+# I.e., just doing `command ... &&fail=1` will not catch
+# a segfault in command for example. With this helper you
+# instead check an explicit exit code like
+# returns_ 1 command ... || fail
+returns_ () {
+ # Disable tracing so it doesn't interfere with stderr of the wrapped command
+ { set +x; } 2>/dev/null
+
+ local exp_exit="$1"
+ shift
+ "$@"
+ test $? -eq $exp_exit && ret_=0 || ret_=1
+
+ set -x
+ { return $ret_; } 2>/dev/null
+}
+
+# Define the nicest compare available (borrowed from gnulib).
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
+ && diff -u Makefile "$0" 2>/dev/null | grep '^[+]#!' >/dev/null; then
+ # diff accepts the -u option and does not (like AIX 7 'diff') produce an
+ # extra space on column 1 of every content line.
+ if test -z "$diff_out_"; then
+ compare () { diff -u "$@"; }
+ else
+ compare ()
+ {
+ if diff -u "$@" > diff.out; then
+ # No differences were found, but Solaris 'diff' produces output
+ # "No differences encountered". Hide this output.
+ rm -f diff.out
+ true
+ else
+ cat diff.out
+ rm -f diff.out
+ false
+ fi
+ }
+ fi
+elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
+ if test -z "$diff_out_"; then
+ compare () { diff -c "$@"; }
+ else
+ compare ()
+ {
+ if diff -c "$@" > diff.out; then
+ # No differences were found, but AIX and HP-UX 'diff' produce output
+ # "No differences encountered" or "There are no differences between the
+ # files.". Hide this output.
+ rm -f diff.out
+ true
+ else
+ cat diff.out
+ rm -f diff.out
+ false
+ fi
+ }
+ fi
+elif cmp -s /dev/null /dev/null 2>/dev/null; then
+ compare () { cmp -s "$@"; }
+else
+ compare () { cmp "$@"; }
+fi
+
+set -x
+tmpdir="$(mktemp -d)" \
+ && cd "$tmpdir" \
+ || die "FAIL: failed to set up the test in ${tmpdir}"
+
+fail=0
+# Exercise both the previous name of the pseudo-option '-noop',
+# and the now renamed '---noop' option for both find executables.
+for exe in "${ftsfind}" "${oldfind}"; do
+ for opt in 'noop' '--noop'; do
+ out="${exe}${opt}.out"
+ err="${exe}${opt}.err"
+ returns_ 1 "$exe" "-${opt}" >"$out" 2> "$err" || fail=1
+ compare /dev/null "$out" || fail=1
+ grep "find: unknown predicate .-${opt}." "$err" \
+ || { cat "$err"; fail=1; }
+ done
+done
+
+cd ..
+rm -rf "$tmpdir" || exit 1
+exit $fail
--
2.5.5

View File

@ -1,122 +0,0 @@
From 547e7145f335dc07144f35eaacc520475068852e Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Fri, 30 Aug 2019 10:22:22 +0200
Subject: [PATCH 1/3] Revert "fts: cleanup after FTS_NOATIME removal"
This reverts commit dce8759f0f0236a860a3e68b63c5e99cc6f168f9.
---
gl/lib/fts_.h | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gl/lib/fts_.h b/gl/lib/fts_.h
index fb5558f..0122262 100644
--- a/gl/lib/fts_.h
+++ b/gl/lib/fts_.h
@@ -149,14 +149,16 @@ typedef struct {
dirent.d_type data. */
# define FTS_DEFER_STAT 0x0400
+/* 0x0800 unused, was non-working FTS_NOATIME */
+
/* Use this flag to disable stripping of trailing slashes
from input path names during fts_open initialization. */
-# define FTS_VERBATIM 0x0800
+# define FTS_VERBATIM 0x1000
-# define FTS_OPTIONMASK 0x0fff /* valid user option mask */
+# define FTS_OPTIONMASK 0x1fff /* valid user option mask */
-# define FTS_NAMEONLY 0x1000 /* (private) child names only */
-# define FTS_STOP 0x2000 /* (private) unrecoverable error */
+# define FTS_NAMEONLY 0x2000 /* (private) child names only */
+# define FTS_STOP 0x4000 /* (private) unrecoverable error */
int fts_options; /* fts_open options, global flags */
/* Map a directory's device number to a boolean. The boolean is
--
2.20.1
From 1328926a705fdb4728c1f255dd368de928736d39 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Fri, 25 Sep 2015 16:09:39 +0200
Subject: [PATCH 2/3] fts: introduce the FTS_NOLEAF flag
The flag is needed to implement the -noleaf option of find.
* lib/fts.c (link_count_optimize_ok): Implement the FTS_NOLEAF flag.
* lib/fts_.h (FTS_NOLEAF): New macro, shifted conflicting constants.
---
gl/lib/fts.c | 4 ++++
gl/lib/fts_.h | 12 +++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/gl/lib/fts.c b/gl/lib/fts.c
index d2d404f..808466f 100644
--- a/gl/lib/fts.c
+++ b/gl/lib/fts.c
@@ -706,6 +706,10 @@ filesystem_type (FTSENT const *p, int fd)
struct dev_type *ent;
struct statfs fs_buf;
+ if (ISSET(FTS_NOLEAF))
+ /* leaf optimization explicitly disabled by the FTS_NOLEAF flag */
+ return 0;
+
/* If we're not in CWDFD mode, don't bother with this optimization,
since the caller is not serious about performance. */
if (!ISSET (FTS_CWDFD))
diff --git a/gl/lib/fts_.h b/gl/lib/fts_.h
index 63d4b74..f1d519b 100644
--- a/gl/lib/fts_.h
+++ b/gl/lib/fts_.h
@@ -155,10 +155,16 @@ typedef struct {
from input path names during fts_open initialization. */
# define FTS_VERBATIM 0x1000
-# define FTS_OPTIONMASK 0x1fff /* valid user option mask */
+ /* Disable leaf optimization (which eliminates stat() calls during traversal,
+ based on the count of nested directories stored in stat.st_nlink of each
+ directory). Note that the optimization is by default enabled only for
+ selected file systems, and only if the FTS_CWDFD flag is set. */
+# define FTS_NOLEAF 0x2000
-# define FTS_NAMEONLY 0x2000 /* (private) child names only */
-# define FTS_STOP 0x4000 /* (private) unrecoverable error */
+# define FTS_OPTIONMASK 0x3fff /* valid user option mask */
+
+# define FTS_NAMEONLY 0x4000 /* (private) child names only */
+# define FTS_STOP 0x8000 /* (private) unrecoverable error */
int fts_options; /* fts_open options, global flags */
/* Map a directory's device number to a boolean. The boolean is
--
2.5.0
From c186934e6e37ddadf7511abb9b1045192757618e Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Fri, 25 Sep 2015 19:13:15 +0200
Subject: [PATCH 3/3] ftsfind: propagate the -noleaf option to FTS
* find/ftsfind.c (find): Propagate the -noleaf option to FTS.
---
find/ftsfind.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/find/ftsfind.c b/find/ftsfind.c
index 5159470..e34b672 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -509,6 +509,9 @@ find (char *arg)
if (options.stay_on_filesystem)
ftsoptions |= FTS_XDEV;
+ if (options.no_leaf_check)
+ ftsoptions |= FTS_NOLEAF;
+
p = fts_open (arglist, ftsoptions, NULL);
if (NULL == p)
{
--
2.5.0

View File

@ -0,0 +1,44 @@
From a8ff1e964b2b8cd0b60362c76bd92795cee6b3c3 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Sun, 17 Apr 2016 22:36:13 +0200
Subject: [PATCH] doc: clarify exit status handling of -exec command {} +
* find/find.1 (-exec): Explain how exit status is propagated if the
-exec command {} + syntax is used.
(-execdir): Likewise.
Reported at https://bugzilla.redhat.com/1325049
Upstream-commit: ae424b959c5e9bd23f9f686cb34653bc4cd1270e
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
find/find.1 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/find/find.1 b/find/find.1
index a36a0bc..c4aaf17 100644
--- a/find/find.1
+++ b/find/find.1
@@ -1069,6 +1069,9 @@ command line is built in much the same way that
.B xargs
builds its command lines. Only one instance of `{}' is allowed within
the command. The command is executed in the starting directory. If
+any invocation returns a non-zero value as exit status, then
+.B find
+returns a non-zero exit status. If
.B find
encounters an error, this can sometimes cause an
immediate exit, so some pending commands may not be run
@@ -1104,6 +1107,9 @@ appropriately-named file in a directory in which you will run
The same applies to having entries in
.B $PATH
which are empty or which are not absolute directory names. If
+any invocation returns a non-zero value as exit status, then
+.B find
+returns a non-zero exit status. If
.B find
encounters an error, this can sometimes cause an
immediate exit, so some pending commands may not be run
--
2.5.5

View File

@ -0,0 +1,35 @@
From 06a46ba755195810f2aeda01b12d1ccfe7c2dcfd Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@gnu.org>
Date: Mon, 28 Dec 2015 06:27:42 +0900
Subject: [PATCH] maint: fix operator precedence in mbrtowc test
This is a fix for test breakage introduced by commit 45228d96; the
equality expression must be parenthesized when negated with '!',
otherwise we always get:
test-mbrtowc.c:49: assertion 'ret == (size_t)(-2)' failed
* m4/mbrtowc.m4 (gl_MBRTOWC_EMPTY_INPUT): Negate the entire expression.
Upstream-commit: 1f63650823cebf52044df840c81062ccb52163a2
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
gl/m4/mbrtowc.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
index deb9f06..be2e9d6 100644
--- a/gl/m4/mbrtowc.m4
+++ b/gl/m4/mbrtowc.m4
@@ -569,7 +569,7 @@ changequote([,])dnl
int
main (void)
{
- return ! mbrtowc (&wc, "", 0, &mbs) == (size_t) -2;
+ return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
}]])],
[gl_cv_func_mbrtowc_empty_input=yes],
[gl_cv_func_mbrtowc_empty_input=no],
--
2.5.0

View File

@ -1,29 +0,0 @@
From 129f23ce758620fade812baab811379ce8454048 Mon Sep 17 00:00:00 2001
From: rpm-build <rpm-build>
Date: Fri, 27 Jan 2017 11:44:41 +0100
Subject: [PATCH] test-lock: disable the rwlock test
It hangs indefinitely if the system rwlock implementation does not
prevent writer starvation (and glibc does not implement it).
Bug: http://www.mail-archive.com/bug-gnulib@gnu.org/msg33017.html
---
gnulib-tests/test-lock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gnulib-tests/test-lock.c b/gnulib-tests/test-lock.c
index a992f64..fd9c014 100644
--- a/gnulib-tests/test-lock.c
+++ b/gnulib-tests/test-lock.c
@@ -42,7 +42,7 @@
Uncomment some of these, to verify that all tests crash if no locking
is enabled. */
#define DO_TEST_LOCK 1
-#define DO_TEST_RWLOCK 1
+#define DO_TEST_RWLOCK 0
#define DO_TEST_RECURSIVE_LOCK 1
#define DO_TEST_ONCE 1
--
2.7.4

BIN
findutils-4.6.0.tar.gz.sig Normal file

Binary file not shown.

View File

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEpRidtpwRZNMwApNmRlAu95aRcZUFAmH50AcACgkQRlAu95aR
cZU/DQgAjt38b5+7CREWR7rk9y/NRvc+xAg7wMfwjt90cAycjRZ7hMVviB7R+MhO
1rrV+4UkKCYzBzks5FIhN00IwmXoe0VPeH17ATtSB6c70rBNwHE7CWcGz2cnqHBQ
CzPBy3hXEq7YY1kq7bfZCkTTEnxve9eKrgoczj/NpxvxoRkLmXzzKd0ChvHLlYJl
m0GrPAl81eUF2vYIo5/9F28AR2mfCv1cwzsb1Ch3WEXqZB2tcIKsocrO4AVVpkmD
o1pmPZa1FTKPI4YdBOlOuWUYkf6rD7WEKTcFmXrafkPlzhY4HJyN35XslAllJg6w
81EbRarQvxrVDuxoS0jnx0oMvV7jxg==
=hp30
-----END PGP SIGNATURE-----

View File

@ -1,27 +1,40 @@
Summary: The GNU versions of find utilities (find and xargs)
Name: findutils
Version: 4.9.0
Release: 2%{?dist}
Version: 4.6.0
Release: 7%{?dist}
Epoch: 1
License: GPLv3+
URL: https://www.gnu.org/software/findutils/
Source0: https://ftp.gnu.org/pub/gnu/%{name}/%{name}-%{version}.tar.xz
Group: Applications/File
URL: http://www.gnu.org/software/findutils/
Source0: ftp://ftp.gnu.org/pub/gnu/findutils/%{name}-%{version}.tar.gz
# prevent mbrtowc tests from failing (#1294016)
Patch0: findutils-4.6.0-mbrtowc-tests.patch
# do not build locate
Patch1: findutils-4.5.15-no-locate.patch
Patch1: findutils-4.5.15-no-locate.patch
# add -xautofs option to not descend into directories on autofs file systems
Patch2: findutils-4.4.2-xautofs.patch
# add a new option -xautofs to find to not descend into directories on autofs
# file systems
Patch3: findutils-4.4.2-xautofs.patch
# eliminate compile-time warnings
Patch3: findutils-4.5.13-warnings.patch
Patch4: findutils-4.5.13-warnings.patch
# test-lock: disable the rwlock test
Patch4: findutils-4.6.0-test-lock.patch
# clarify exit status handling of -exec cmd {} + in find(1) man page (#1325049)
Patch5: findutils-4.6.0-man-exec.patch
# make sure that find -exec + passes all arguments (upstream bug #48030)
Patch6: findutils-4.6.0-exec-args.patch
# implement the -noleaf option of find (#1252549)
Patch5: findutils-4.6.0-leaf-opt.patch
Patch8: findutils-4.5.15-leaf-opt.patch
# avoid SIGSEGV in case the internal -noop option is used (#1346471)
Patch9: findutils-4.6.0-internal-noop.patch
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
Conflicts: filesystem < 3
Provides: /bin/find
Provides: bundled(gnulib)
@ -29,10 +42,7 @@ Provides: bundled(gnulib)
BuildRequires: automake
BuildRequires: dejagnu
BuildRequires: gettext-devel
BuildRequires: gcc
BuildRequires: git
BuildRequires: libselinux-devel
BuildRequires: make
BuildRequires: texinfo
%description
@ -78,20 +88,18 @@ git add --all .
git commit -q -m "after invocation of autoreconf"
%build
# disable -flto on ppc64le to make test-float pass (#1789115)
%ifarch ppc64le
export CFLAGS="$RPM_OPT_FLAGS -fno-lto"
%endif
# prevent test-isinf from failing with gcc-5.3.1 on ppc64le (#1294016)
export CFLAGS="$RPM_OPT_FLAGS -D__SUPPORT_SNAN__"
mkdir build
cd build
%global _configure ../configure
ln -s ../configure
%configure
%make_build
make %{?_smp_mflags}
%check
make %{?_smp_mflags} check -C build V=1
make %{?_smp_mflags} check -C build
%install
%make_install -C build
@ -100,7 +108,20 @@ rm -f %{buildroot}%{_infodir}/dir
%find_lang %{name}
%post
if [ -f %{_infodir}/find.info.gz ]; then
/sbin/install-info %{_infodir}/find.info.gz %{_infodir}/dir || :
fi
%preun
if [ $1 = 0 ]; then
if [ -f %{_infodir}/find.info.gz ]; then
/sbin/install-info --delete %{_infodir}/find.info.gz %{_infodir}/dir || :
fi
fi
%files -f %{name}.lang
%{!?_licensedir:%global license %%doc}
%license COPYING
%doc AUTHORS NEWS README THANKS TODO
%{_bindir}/find
@ -108,109 +129,11 @@ rm -f %{buildroot}%{_infodir}/dir
%{_mandir}/man1/find.1*
%{_mandir}/man1/xargs.1*
%{_infodir}/find.info*
%{_infodir}/find-maint.info.*
%{_infodir}/find-maint.info.gz
%changelog
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.9.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Feb 02 2022 Kamil Dudka <kdudka@redhat.com> - 1:4.9.0-1
- new upstream release
* Mon Jan 24 2022 Kamil Dudka <kdudka@redhat.com> - 1:4.8.0-6
- make findutils build on 32bit x86
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.8.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.8.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue May 25 2021 Florian Weimer <fweimer@redhat.com> - 1:4.8.0-3
- Rebuild with new binutils to fix ppc64le corruption (#1960730)
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* 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
* Fri Jul 24 2020 Kamil Dudka <kdudka@redhat.com> - 1:4.7.0-6
- disable -flto on ppc64le to make test-float pass (#1789115)
- do not compile with -D__SUPPORT_SNAN__ (#1294016)
* Mon Jul 13 2020 Tom Stellard <tstellar@redhat.com> - 1:4.7.0-5
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Fri Apr 17 2020 Kamil Dudka <kdudka@redhat.com> - 1:4.7.0-4
- simplify leaf optimization for XFS (#1823247)
* Tue Feb 11 2020 Kamil Dudka <kdudka@redhat.com> - 1:4.7.0-3
- make upstream test-suite work with root privileges (#1799064)
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Aug 30 2019 Kamil Dudka <kdudka@redhat.com> - 1:4.7.0-1
- new upstream release
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Wed Apr 24 2019 Björn Esser <besser82@fedoraproject.org> - 1:4.6.0-23
- Remove hardcoded gzip suffix from GNU info pages
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Nov 05 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-21
- fix programming mistakes detected by static analysis
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Apr 20 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-19
- fix crash caused by mistakenly enabled leaf optimization (#1558249)
* Tue Mar 06 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-18
- fix build failure with glibc-2.28
* Mon Feb 19 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-17
- add explicit BR for the gcc compiler
* Mon Feb 12 2018 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-16
- import gnulib's FTS module from upstream commit 281b825e (#1544429)
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Thu Mar 02 2017 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-12
- drop ppc64le workaround no longer needed (#1417753)
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.6.0-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Jan 30 2017 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-10
- avoid using broken memcmp() code that gcc generates on ppc64le (#1417753)
* Fri Jan 27 2017 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-9
- add explicit BR for git as we use it in %%prep
* Fri Sep 16 2016 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-8
- disable leaf optimization for NFS (#1299169)
* Fri Jun 24 2016 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-7
- bump release to preserve upgrade path f24 -> f25
- disable leaf optimization for NFS (#1299169)
* Fri Jun 17 2016 Kamil Dudka <kdudka@redhat.com> - 1:4.6.0-6
- use %%autosetup to create a git repo in %%prep

View File

@ -1 +1 @@
SHA512 (findutils-4.9.0.tar.xz) = ba4844f4403de0148ad14b46a3dbefd5a721f6257c864bf41a6789b11705408524751c627420b15a52af95564d8e5b52f0978474f640a62ab86a41d20cf14be9
9936aa8009438ce185bea2694a997fc1 findutils-4.6.0.tar.gz

View File

@ -1,63 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/findutils/Sanity/smoke
# Description: Smoke test for find and xargs.
# Author: Branislav Nater <bnater@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/findutils/Sanity/smoke
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
test -x runtest.sh || chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Branislav Nater <bnater@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Smoke test for find and xargs." >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 5m" >> $(METADATA)
@echo "RunFor: findutils" >> $(METADATA)
@echo "Requires: findutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,3 +0,0 @@
PURPOSE of /CoreOS/findutils/Sanity/smoke
Description: Smoke test for find and xargs.
Author: Branislav Nater <bnater@redhat.com>

View File

@ -1,64 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/findutils/Sanity/smoke
# Description: Smoke test for find and xargs.
# Author: Branislav Nater <bnater@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2014 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include rhts environment
. /usr/bin/rhts-environment.sh || exit 1
. /usr/lib/beakerlib/beakerlib.sh || exit 1
PACKAGE="findutils"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory"
rlRun "pushd $TmpDir"
rlRun "touch \"file with spaces\"" 0
rlRun "mkdir dir" 0
rlRun "touch dir/file1" 0
rlPhaseEnd
rlGetTestState && {
rlPhaseStartTest
rlRun "find . -name \"file*\" -type f | tee output | wc -l > wcout" 0
cat output
rlAssertGrep 2 wcout
rlRun "find $TmpDir -mindepth 1 -type d | tee output | wc -l > wcout" 0
cat output
rlAssertGrep 1 wcout
rlRun "find $TmpDir -name \"file*\" -print0 | xargs -0 ls -l | tee output | wc -l > wcout" 0
cat output
rlAssertGrep 2 wcout
rlPhaseEnd
}
rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
rlPhaseEnd
rlJournalEnd
rlJournalPrintText

View File

@ -1,14 +0,0 @@
---
# Tests which will run in all contexts
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- container
- atomic
tests:
- smoke
- xautofs
required_packages:
- autofs # autofs required for xautofs test

View File

@ -1,65 +0,0 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Makefile of /CoreOS/findutils/Sanity/options/xautofs
# Description: Check xautofs option
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export TEST=/CoreOS/findutils/Sanity/options/xautofs
export TESTVERSION=1.0
BUILT_FILES=
FILES=$(METADATA) runtest.sh Makefile PURPOSE
.PHONY: all install download clean
run: $(FILES) build
./runtest.sh
build: $(BUILT_FILES)
chmod a+x runtest.sh
clean:
rm -f *~ $(BUILT_FILES)
include /usr/share/rhts/lib/rhts-make.include
$(METADATA): Makefile
@echo "Owner: Branislav Nater <bnater@redhat.com>" > $(METADATA)
@echo "Name: $(TEST)" >> $(METADATA)
@echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
@echo "Path: $(TEST_DIR)" >> $(METADATA)
@echo "Description: Check xautofs option" >> $(METADATA)
@echo "Type: Sanity" >> $(METADATA)
@echo "TestTime: 10m" >> $(METADATA)
@echo "RunFor: findutils" >> $(METADATA)
@echo "Requires: autofs findutils" >> $(METADATA)
@echo "Priority: Normal" >> $(METADATA)
@echo "License: GPLv2" >> $(METADATA)
@echo "Confidential: no" >> $(METADATA)
@echo "Destructive: no" >> $(METADATA)
@echo "Bug: 485672 529391" >> $(METADATA)
@echo "Releases: -RHEL3 -RHEL4" >> $(METADATA)
rhts-lint $(METADATA)

View File

@ -1,8 +0,0 @@
PURPOSE of /CoreOS/findutils/Sanity/options/xautofs
Description: Check xautofs option
Author: Petr Splichal <psplicha@redhat.com>
Bug summary: [RFE] Modify find to be able to skip direct mapped autofs mounts
Bugzilla link: None
Check that the new -xautofs option works as expected: make sure
find does not descend into directories on autofs filesystems.

View File

@ -1,90 +0,0 @@
#!/bin/bash
# vim: dict=/usr/share/rhts-library/dictionary.vim cpt=.,w,b,u,t,i,k
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# runtest.sh of /CoreOS/findutils/Sanity/options/xautofs
# Description: Check xautofs option
# Author: Petr Splichal <psplicha@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2009 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing
# to use, modify, copy, or redistribute it subject to the terms
# and conditions of the GNU General Public License version 2.
#
# 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, write to the Free
# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Include rhts environment
. /usr/bin/rhts-environment.sh
. /usr/share/rhts-library/rhtslib.sh
PACKAGE="findutils"
MasterConf="/etc/auto.master"
DirectConf="/etc/auto.direct"
MountDir="/mnt/findutils"
AutomountDir="$MountDir/etc"
RegularDir="$MountDir/regular/directory/master"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlAssertRpm "autofs"
rlRun "set -o pipefail"
# create dirs & back up
rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
rlRun "mkdir -p $RegularDir" 0 "Creating regular directory"
rlRun "rlFileBackup $MasterConf"
# set up autofs
rlRun "echo '/- /etc/auto.direct' > $MasterConf" \
0 "Setting up autofs master map"
rlRun "echo '$AutomountDir localhost:/etc' > $DirectConf" \
0 "Setting up autofs direct map"
# RHEL-7 is using xfs
rlIsRHEL 4 5 6 && fs="ext[34]" || fs="xfs"
rlRun "pushd $TmpDir"
rlPhaseEnd
rlPhaseStartTest "Without -xautofs option"
rlRun "rlServiceStart autofs" 0 "Starting autofs"
rlAssertNotGrep "$AutomountDir.*$fs" "/proc/mounts"
rlRun "find $MountDir -noleaf -name '*master*' | tee filelist"
rlAssertGrep "$RegularDir" "filelist"
rlAssertGrep "$MountDir$MasterConf" "filelist"
rlAssertGrep "$AutomountDir.*$fs" "/proc/mounts"
rlPhaseEnd
rlPhaseStartTest "With -xautofs option"
rlRun "rlServiceStart autofs" 0 "Starting autofs"
rlAssertNotGrep "$AutomountDir.*$fs" "/proc/mounts"
rlRun "find $MountDir -xautofs -noleaf -name '*master*' | tee filelist"
rlAssertGrep "$RegularDir" "filelist"
rlAssertNotGrep "$MountDir$MasterConf" "filelist"
rlAssertNotGrep "$AutomountDir.*$fs" "/proc/mounts"
rlPhaseEnd
rlPhaseStartCleanup
rlRun "popd"
rlRun "rlFileRestore"
rlRun "rlServiceRestore autofs"
rlRun "rm -r $TmpDir $DirectConf $MountDir" 0 "Removing tmp files"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd