LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File patch-revert-e0f70752.patch of Package patch (Project openSUSE:Factory)

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