- do not fail silently on a remount during traverse (#501848)

This commit is contained in:
Kamil Dudka 2009-11-18 18:39:38 +00:00
parent 29ef88d6c3
commit 4736063417
2 changed files with 31 additions and 1 deletions

View File

@ -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

View File

@ -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 <kdudka@redhat.com> - 1:4.4.2-5
- do not fail silently on a remount during traverse (#501848)
* Tue Oct 20 2009 Kamil Dudka <kdudka@redhat.com> - 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