From 8ab91647aa2466c16f04e662cee9d188a5bbac6097d13dec5af87591b61bc213 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 7 Jan 2015 15:25:39 +0000 Subject: [PATCH] Accepting request 280066 from home:bernhard-voelker:branches:Base:System - findutils-oldfind-fix-dotdot-skipping.patch: Add upstream patch to fix 'oldfind' which skipped all files starting with ".." (e.g. "..file"). - findutils.spec: Add BuildRequires:dejagnu - otherwise only a very limited set of the tests was run by 'make check'. OBS-URL: https://build.opensuse.org/request/show/280066 OBS-URL: https://build.opensuse.org/package/show/Base:System/findutils?expand=0&rev=58 --- findutils-oldfind-fix-dotdot-skipping.patch | 100 ++++++++++++++++++++ findutils.changes | 9 ++ findutils.spec | 8 +- 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 findutils-oldfind-fix-dotdot-skipping.patch diff --git a/findutils-oldfind-fix-dotdot-skipping.patch b/findutils-oldfind-fix-dotdot-skipping.patch new file mode 100644 index 0000000..b03e361 --- /dev/null +++ b/findutils-oldfind-fix-dotdot-skipping.patch @@ -0,0 +1,100 @@ +Upstream patch to fix a problem in oldfind(1) skipping files starting with "..". +http://lists.gnu.org/archive/html/findutils-patches/2014-12/msg00004.html + +2 patches squashed together: +- the fix by Phil Miller in find/find.c, +- the test for it by Bernhard Voelker. + +-------------------------------------------------------------------------------- +From 286a2ff1d1bb71837c72d44c88da8ba3827906d4 Mon Sep 17 00:00:00 2001 +From: Phil Miller +Date: Mon, 29 Dec 2014 16:27:49 -0600 +Subject: [PATCH] oldfind: Don't skip names matching ..* + +Prevent errors like the following: + +$ mkdir test +$ touch test/..test +$ oldfind test +test + +Note that the file "test/..test" was not listed. + +* find/find.c (process_dir): When skipping a directory's self and +parent entries, don't also skip other entries that happen to begin +with "..". + +Copyright-paperwork-exempt: yes +-------------------------------------------------------------------------------- +From bebee334524bc7c23ebc2db27f97094989a7de5d Mon Sep 17 00:00:00 2001 +From: Bernhard Voelker +Date: Tue, 30 Dec 2014 14:38:56 +0100 +Subject: [PATCH] tests: add test for the previously fixed regression + +* find/testsuite/find.posix/dotdotfiles.exp: Add test to verify +oldfind(1) does not skip directory entries starting with "..". +* find/testsuite/find.posix/dotdotfiles.xo: Add expected output +for the above test. +* find/testsuite/Makefile.am (EXTRA_DIST_XO, EXTRA_DIST_EXP): +Mention the above new test files. +--- + find/find.c | 4 +++- + find/testsuite/Makefile.am | 2 ++ + find/testsuite/find.posix/dotdotfiles.exp | 7 +++++++ + find/testsuite/find.posix/dotdotfiles.xo | 2 ++ + 5 files changed, 16 insertions(+), 1 deletion(-) + +Index: find/find.c +=================================================================== +--- find/find.c.orig ++++ find/find.c +@@ -1441,7 +1441,9 @@ process_dir (char *pathname, char *name, + namep = dp->d_name; + /* Skip "", ".", and "..". "" is returned by at least one buggy + implementation: Solaris 2.4 readdir on NFS file systems. */ +- if (!namep[0] || (namep[0] == '.' && (namep[1] == '.' || namep[1] == 0))) ++ if (!namep[0] || ++ (namep[0] == '.' && (namep[1] == 0 || ++ (namep[1] == '.' && namep[2] == 0)))) + continue; + } + +Index: find/testsuite/Makefile.am +=================================================================== +--- find/testsuite/Makefile.am.orig ++++ find/testsuite/Makefile.am +@@ -73,6 +73,7 @@ find.gnu/quit.xo \ + find.gnu/xtype.xo \ + find.posix/and.xo \ + find.posix/depth1.xo \ ++find.posix/dotdotfiles.xo \ + find.posix/exec-nogaps.xo \ + find.posix/exec-one.xo \ + find.posix/files-not-expressions1.xo \ +@@ -189,6 +190,7 @@ find.gnu/xtype.exp \ + find.posix/and.exp \ + find.posix/bracket-depth.exp \ + find.posix/depth1.exp \ ++find.posix/dotdotfiles.exp \ + find.posix/empty-parens.exp \ + find.posix/exec-nogaps.exp \ + find.posix/exec-one.exp \ +Index: find/testsuite/find.posix/dotdotfiles.exp +=================================================================== +--- /dev/null ++++ find/testsuite/find.posix/dotdotfiles.exp +@@ -0,0 +1,7 @@ ++# Test entries starting with "..", e.g. "..tmp". ++# Commit v4.5.10-95-ga29e61b introduced a regression ++# which made oldfind(1) skip such entries. ++exec rm -rf tmp ++exec mkdir tmp tmp/..tmp ++find_start p {tmp} ++exec rm -rf tmp +Index: find/testsuite/find.posix/dotdotfiles.xo +=================================================================== +--- /dev/null ++++ find/testsuite/find.posix/dotdotfiles.xo +@@ -0,0 +1,2 @@ ++tmp ++tmp/..tmp diff --git a/findutils.changes b/findutils.changes index eb81597..ed799b2 100644 --- a/findutils.changes +++ b/findutils.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Jan 6 16:44:55 UTC 2015 - mail@bernhard-voelker.de + +- findutils-oldfind-fix-dotdot-skipping.patch: Add upstream patch + to fix 'oldfind' which skipped all files starting with ".." + (e.g. "..file"). +- findutils.spec: Add BuildRequires:dejagnu - otherwise only a + very limited set of the tests was run by 'make check'. + ------------------------------------------------------------------- Sun Aug 3 22:56:51 UTC 2014 - mail@bernhard-voelker.de diff --git a/findutils.spec b/findutils.spec index 3d72f0e..755b316 100644 --- a/findutils.spec +++ b/findutils.spec @@ -1,7 +1,7 @@ # # spec file for package findutils # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -28,7 +28,12 @@ Source: http://alpha.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz Patch0: findutils-4.4.2-xautofs.patch # Fix imported gnulib long double math tests for little-endian PowerPC Patch1: findutils-gnulib-ppc64le.patch +# Upstream patch to fix a problem in oldfind(1) skipping files starting with "..". +Patch2: findutils-oldfind-fix-dotdot-skipping.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build +# BuildRequire dejagnu for 'runtest' to execute all tests. +BuildRequires: dejagnu %if 0%{?suse_version} > 1100 BuildRequires: libselinux-devel %endif @@ -56,6 +61,7 @@ useful for finding things on your system. %setup -q %patch0 %patch1 +%patch2 %build %if 0%{?qemu_user_space_build}