From 4736063417b72ab24740a16dcb5d16caac7d3550 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Wed, 18 Nov 2009 18:39:38 +0000 Subject: [PATCH] - do not fail silently on a remount during traverse (#501848) --- findutils-4.4.2-fts-remount.patch | 25 +++++++++++++++++++++++++ findutils.spec | 7 ++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 findutils-4.4.2-fts-remount.patch diff --git a/findutils-4.4.2-fts-remount.patch b/findutils-4.4.2-fts-remount.patch new file mode 100644 index 0000000..858177b --- /dev/null +++ b/findutils-4.4.2-fts-remount.patch @@ -0,0 +1,25 @@ +diff --git a/gnulib/lib/fts.c b/gnulib/lib/fts.c +index ceb8935..2f1eda4 100644 +--- a/gnulib/lib/fts.c ++++ b/gnulib/lib/fts.c +@@ -974,6 +974,20 @@ fts_build (register FTS *sp, int type) + opening it. */ + if (cur->fts_info == FTS_NSOK) + cur->fts_info = fts_stat(sp, cur, false); ++ else if (sp->fts_options & FTS_TIGHT_CYCLE_CHECK) { ++ /* Now read the stat info again after opening a directory to ++ * reveal eventual changes caused by a submount triggered by ++ * the traverse. But do it only for utilities which use ++ * FTS_TIGHT_CYCLE_CHECK. Therefore only find and du can ++ * benefit from this feature for now. ++ */ ++ LEAVE_DIR (sp, cur, "4"); ++ fts_stat (sp, cur, false); ++ if (! enter_dir (sp, cur)) { ++ __set_errno (ENOMEM); ++ return NULL; ++ } ++ } + + /* + * Nlinks is the number of possible entries of type directory in the diff --git a/findutils.spec b/findutils.spec index 2f6c419..9754219 100644 --- a/findutils.spec +++ b/findutils.spec @@ -1,7 +1,7 @@ Summary: The GNU versions of find utilities (find and xargs) Name: findutils Version: 4.4.2 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 License: GPLv3+ Group: Applications/File @@ -12,6 +12,7 @@ Patch1: findutils-4.4.0-no-locate.patch Patch2: findutils-4.4.0-selinux.patch Patch3: findutils-4.4.2-autofs.patch Patch4: findutils-4.4.2-xautofs.patch +Patch5: findutils-4.4.2-fts-remount.patch Requires(post): /sbin/install-info Requires(preun): /sbin/install-info Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -36,6 +37,7 @@ useful for finding things on your system. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 autoreconf @@ -93,6 +95,9 @@ rm -rf $RPM_BUILD_ROOT %{_infodir}/find-maint.info.gz %changelog +* Wed Nov 18 2009 Kamil Dudka - 1:4.4.2-5 +- do not fail silently on a remount during traverse (#501848) + * Tue Oct 20 2009 Kamil Dudka - 1:4.4.2-4 - make it possible to recognize an autofs filesystem by find - add a new find's option -xautofs to not descend directories on autofs