fix find not obeying -ignore_readdir_race in symlink_loop

This commit is contained in:
Lukáš Zaoral 2023-09-12 06:21:53 +02:00
parent 64f00ef362
commit 7f8da56ec7
No known key found for this signature in database
GPG Key ID: 39157506DD67752D
2 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,17 @@
# cherry picked from https://savannah.gnu.org/bugs/?45930
diff --git a/find/ftsfind.c b/find/ftsfind.c
index 0d96c4ca..6aeac28c 100644
--- a/find/ftsfind.c
+++ b/find/ftsfind.c
@@ -401,6 +401,10 @@ consider_visiting (FTS *p, FTSENT *ent)
}
else
{
+ /* Ignore unlink() error for vanished files. */
+ if (ENOENT == ent->fts_errno && options.ignore_readdir_race)
+ return;
+
nonfatal_target_file_error (ent->fts_errno, ent->fts_path);
/* Continue despite the error, as file name without stat info
* might be better than not even processing the file name. This

View File

@ -1,7 +1,7 @@
Summary: The GNU versions of find utilities (find and xargs) Summary: The GNU versions of find utilities (find and xargs)
Name: findutils Name: findutils
Version: 4.9.0 Version: 4.9.0
Release: 5%{?dist} Release: 6%{?dist}
Epoch: 1 Epoch: 1
License: GPL-3.0-or-later License: GPL-3.0-or-later
URL: https://www.gnu.org/software/findutils/ URL: https://www.gnu.org/software/findutils/
@ -22,6 +22,9 @@ Patch4: findutils-4.6.0-test-lock.patch
# implement the -noleaf option of find (#1252549) # implement the -noleaf option of find (#1252549)
Patch5: findutils-4.6.0-leaf-opt.patch Patch5: findutils-4.6.0-leaf-opt.patch
# fix find not obeying -ignore_readdir_race in symlink_loop (#2232278)
Patch6: findutils-4.9.0-ignore_readdir_race-symlink_loop.patch
Conflicts: filesystem < 3 Conflicts: filesystem < 3
Provides: /bin/find Provides: /bin/find
Provides: bundled(gnulib) Provides: bundled(gnulib)
@ -111,6 +114,9 @@ rm -f %{buildroot}%{_infodir}/dir
%{_infodir}/find-maint.info.* %{_infodir}/find-maint.info.*
%changelog %changelog
* Tue Sep 12 2023 Lukáš Zaoral <lzaoral@redhat.com> - 1:4.9.0-6
- fix find not obeying -ignore_readdir_race in symlink_loop (rhbz#2232278)
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.9.0-5 * Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.9.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild