From 06ef5d2f14536ea7f795ffdb5504827af4e89e8439cea2a8adce0cabaef77ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 7 Feb 2025 18:26:12 +0100 Subject: [PATCH] Sync from SUSE:SLFO:Main findutils revision bcb71a67702e067592583602871fc325 --- findutils-avoid-crash-system-loop.patch | 56 +++++++++++++++++++++++++ findutils-xautofs.patch | 24 +++++------ findutils.changes | 10 +++++ findutils.spec | 4 +- 4 files changed, 81 insertions(+), 13 deletions(-) create mode 100644 findutils-avoid-crash-system-loop.patch diff --git a/findutils-avoid-crash-system-loop.patch b/findutils-avoid-crash-system-loop.patch new file mode 100644 index 0000000..360f6ab --- /dev/null +++ b/findutils-avoid-crash-system-loop.patch @@ -0,0 +1,56 @@ +Index: findutils-4.10.0/find/ftsfind.c +=================================================================== +--- findutils-4.10.0.orig/find/ftsfind.c ++++ findutils-4.10.0/find/ftsfind.c +@@ -188,27 +188,6 @@ visit (FTS *p, FTSENT *ent, struct stat + } + } + +-static const char* +-partial_quotearg_n (int n, char *s, size_t len, enum quoting_style style) +-{ +- if (0 == len) +- { +- return quotearg_n_style (n, style, ""); +- } +- else +- { +- char saved; +- const char *result; +- +- saved = s[len]; +- s[len] = 0; +- result = quotearg_n_style (n, style, s); +- s[len] = saved; +- return result; +- } +-} +- +- + /* We've detected a file system loop. This is caused by one of + * two things: + * +@@ -218,7 +197,7 @@ partial_quotearg_n (int n, char *s, size + * + * 2. We have hit a real cycle in the directory hierarchy. In this + * case, we issue a diagnostic message (POSIX requires this) and we +- * skip that directory entry. ++ * will skip that directory entry. + */ + static void + issue_loop_warning (FTSENT * ent) +@@ -241,12 +220,8 @@ issue_loop_warning (FTSENT * ent) + */ + error (0, 0, + _("File system loop detected; " +- "%s is part of the same file system loop as %s."), +- safely_quote_err_filename (0, ent->fts_path), +- partial_quotearg_n (1, +- ent->fts_cycle->fts_path, +- ent->fts_cycle->fts_pathlen, +- options.err_quoting_style)); ++ "the following directory is part of the cycle: %s"), ++ safely_quote_err_filename (0, ent->fts_path)); + } + } + diff --git a/findutils-xautofs.patch b/findutils-xautofs.patch index 7655a52..63ec1e5 100644 --- a/findutils-xautofs.patch +++ b/findutils-xautofs.patch @@ -9,8 +9,8 @@ Index: doc/find.texi =================================================================== ---- doc/find.texi.orig -+++ doc/find.texi +--- a/doc/find.texi.orig ++++ b/doc/find.texi @@ -1607,6 +1607,10 @@ them. There are two ways to avoid searching certain filesystems. One way is to tell @code{find} to only search one filesystem: @@ -24,8 +24,8 @@ Index: doc/find.texi Don't descend directories on other filesystems. These options are Index: find/defs.h =================================================================== ---- find/defs.h.orig -+++ find/defs.h +--- a/find/defs.h.orig ++++ b/find/defs.h @@ -557,6 +557,9 @@ struct options /* If true, don't cross filesystem boundaries. */ bool stay_on_filesystem; @@ -38,8 +38,8 @@ Index: find/defs.h */ Index: find/find.1 =================================================================== ---- find/find.1.orig -+++ find/find.1 +--- a/find/find.1.orig ++++ b/find/find.1 @@ -654,6 +654,9 @@ to stat them; this gives a significant i .IP "\-version, \-\-version" Print the \fBfind\fR version number and exit. @@ -52,8 +52,8 @@ Index: find/find.1 Index: find/ftsfind.c =================================================================== ---- find/ftsfind.c.orig -+++ find/ftsfind.c +--- a/find/ftsfind.c.orig ++++ b/find/ftsfind.c @@ -433,6 +433,12 @@ consider_visiting (FTS *p, FTSENT *ent) } } @@ -69,8 +69,8 @@ Index: find/ftsfind.c /* this is the preorder visit, but user said -depth */ Index: find/parser.c =================================================================== ---- find/parser.c.orig -+++ find/parser.c +--- a/find/parser.c.orig ++++ b/find/parser.c @@ -150,6 +150,7 @@ static bool parse_used (const s static bool parse_user (const struct parser_table*, char *argv[], int *arg_ptr); static bool parse_wholename (const struct parser_table*, char *argv[], int *arg_ptr); @@ -106,8 +106,8 @@ Index: find/parser.c options.ignore_readdir_race = true; Index: find/util.c =================================================================== ---- find/util.c.orig -+++ find/util.c +--- a/find/util.c.orig ++++ b/find/util.c @@ -181,7 +181,8 @@ Positional options (always true):\n\ HTL (_("\n\ Normal options (always true, specified before other expressions):\n\ diff --git a/findutils.changes b/findutils.changes index f3f44d2..8462fa0 100644 --- a/findutils.changes +++ b/findutils.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Feb 4 08:43:24 UTC 2025 - pgajdos@suse.com + +- do not crash when file system loop was encountered [bsc#1231472] +- added patches + fix https://git.savannah.gnu.org/cgit/findutils.git/commit/?id=e5d6eb919b9 + + findutils-avoid-crash-system-loop.patch +- modified patches + % findutils-xautofs.patch (p1) + ------------------------------------------------------------------- Sat Jun 1 20:37:18 UTC 2024 - Bernhard Voelker diff --git a/findutils.spec b/findutils.spec index 5a3d801..3b24be9 100644 --- a/findutils.spec +++ b/findutils.spec @@ -41,6 +41,8 @@ Source1: https://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz.sig Source2: https://savannah.gnu.org/project/release-gpgkeys.php?group=%{name}&download=1&file=./%{name}.keyring # adds a new option -xautofs to find to not descend into directories on autofs file systems Patch0: findutils-xautofs.patch +# https://git.savannah.gnu.org/cgit/findutils.git/commit/?id=e5d6eb919b9 +Patch1: findutils-avoid-crash-system-loop.patch BuildRequires: automake @@ -65,7 +67,7 @@ useful for finding things on your system. %lang_package %prep -%autosetup -p0 +%autosetup -p1 %build %configure \