SHA256
1
0
forked from pool/patch

- patch-revert-e0f70752.patch: Revert broken upstream commit

(bnc#755136).

OBS-URL: https://build.opensuse.org/package/show/devel:tools/patch?expand=0&rev=30
This commit is contained in:
Jean Delvare 2012-04-06 12:24:18 +00:00 committed by Git OBS Bridge
parent 32ed207b62
commit 0a622f8d7f
3 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,64 @@
References: bnc#755136
Revert upstream commit e0f707523cab26f74ec23f4a20a27add8702ed5b.
--- patch-2.6.1.136-31a7.orig/src/pch.c
+++ patch-2.6.1.136-31a7/src/pch.c
@@ -379,18 +379,11 @@ skip_hex_digits (char const *str)
static bool
name_is_valid (char const *name)
{
- static char const *bad[2];
- char const *n;
-
- if (bad[0] && ! strcmp (bad[0], name))
- return false;
- if (bad[1] && ! strcmp (bad[1], name))
- return false;
+ const char *n = name;
if (IS_ABSOLUTE_FILE_NAME (name))
{
say ("Ignoring potentially dangerous file name %s\n", quotearg (name));
- bad[!! bad[0]] = name;
return false;
}
for (n = name; *n; )
@@ -398,7 +391,6 @@ name_is_valid (char const *name)
if (*n == '.' && *++n == '.' && ( ! *++n || ISSLASH (*n)))
{
say ("Ignoring potentially dangerous file name %s\n", quotearg (name));
- bad[!! bad[0]] = name;
return false;
}
while (*n && ! ISSLASH (*n))
--- patch-2.6.1.136-31a7.orig/tests/bad-filenames
+++ patch-2.6.1.136-31a7/tests/bad-filenames
@@ -114,27 +114,3 @@ echo 1 > g
check 'patch -f -p1 --dry-run < d.diff || echo status: $?' <<EOF
patching file g
EOF
-
-mkdir d
-cd d
-cat > d.diff <<EOF
---- ../h
-+++ ../h
-@@ -0,0 +1 @@
-+x
-EOF
-
-touch ../h
-check 'patch -f -p0 < d.diff || echo status: $?' <<EOF
-Ignoring potentially dangerous file name ../h
-can't find file to patch at input line 3
-Perhaps you used the wrong -p or --strip option?
-The text leading up to this was:
---------------------------
-|--- ../h
-|+++ ../h
---------------------------
-No file to patch. Skipping patch.
-1 out of 1 hunk ignored
-status: 1
-EOF

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Apr 6 14:22:12 CEST 2012 - jdelvare@suse.de
- patch-revert-e0f70752.patch: Revert broken upstream commit
(bnc#755136).
-------------------------------------------------------------------
Wed Apr 4 19:03:25 CEST 2012 - jdelvare@suse.de

View File

@ -31,6 +31,7 @@ Version: 2.6.1.136
Release: 1
Summary: GNU patch
Source: ftp://alpha.gnu.org/gnu/patch/patch-%version%hash.tar.bz2
Patch1: patch-revert-e0f70752.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -46,6 +47,7 @@ Authors:
%prep
%setup -q -n patch-%version%hash
%patch1 -p1
%build
export CFLAGS="$RPM_OPT_FLAGS -Wall -O2 -pipe"