Sophie

Sophie

distrib > Mandriva > 2007.1 > i586 > media > main-updates-src > by-pkgid > c6f99d8c732c69b7a122654112b677f2 > files > 7

tar-1.16-3.2mdv2007.1.src.rpm

diff -u tar-1.16/src/extract.c tar-1.16/src/extract.c
--- tar-1.16/src/extract.c
+++ tar-1.16/src/extract.c
@@ -1122,7 +1122,13 @@
       break;
 
     case GNUTYPE_NAMES:
-      *fun = extract_mangle_wrapper;
+      if (allow_name_mangling_option) {
+          *fun = extract_mangle_wrapper;
+      }
+      else {
+          ERROR ((0, 0, _("GNUTYPE_NAMES mangling ignored")));
+          *fun = extract_failure;
+      }
       break;
 
     case GNUTYPE_MULTIVOL:
only in patch2:
unchanged:
--- tar-1.16.orig/src/tar.c
+++ tar-1.16/src/tar.c
@@ -247,6 +247,7 @@
 enum
 {
   ANCHORED_OPTION = CHAR_MAX + 1,
+  ALLOW_NAME_MANGLING_OPTION,
   ATIME_PRESERVE_OPTION,
   BACKUP_OPTION,
   CHECKPOINT_OPTION,
@@ -705,6 +706,8 @@
 
   {NULL, 'o', 0, 0,
    N_("when creating, same as --old-archive; when extracting, same as --no-same-owner"), GRID+1 },
+  {"allow-name-mangling", ALLOW_NAME_MANGLING_OPTION, 0, 0,
+   N_("when creating, allow GNUTYPE_NAMES mangling -- considered dangerous"), GRID+1 },
 #undef GRID
 
 #define GRID 120
@@ -1431,6 +1434,10 @@
       set_use_compress_program_option ("compress");
       break;
 
+    case ALLOW_NAME_MANGLING_OPTION:
+      allow_name_mangling_option = true;
+      break;
+
     case ANCHORED_OPTION:
       args->matching_flags |= EXCLUDE_ANCHORED;
       break;
only in patch2:
unchanged:
--- tar-1.16.orig/src/common.h
+++ tar-1.16/src/common.h
@@ -105,6 +105,9 @@
 
 GLOBAL bool absolute_names_option;
 
+/* Allow GNUTYPE_NAMES type? */
+GLOBAL bool allow_name_mangling_option;
+
 /* Display file times in UTC */
 GLOBAL bool utc_option;