Accepting request 1243066 from Base:System

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

OBS-URL: https://build.opensuse.org/request/show/1243066
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/findutils?expand=0&rev=74
This commit is contained in:
Ana Guerrero 2025-02-05 11:40:22 +00:00 committed by Git OBS Bridge
commit e3b0a13d07
4 changed files with 82 additions and 14 deletions

View File

@ -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));
}
}

View File

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

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Feb 4 08:37:08 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 <mail@bernhard-voelker.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package findutils
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -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 \