Procházet zdrojové kódy

dpkg-deb: Use --no-unquote when using -T to avoid mangling filenames

We get the filenames from find(1), so we should not be letting tar
mangle them, or it might create unexpected results.

Closes: #743687

Reported-by: Niels Thykier <niels@thykier.net>
Guillem Jover před 12 roky
rodič
revize
14ba15362d
2 změnil soubory, kde provedl 4 přidání a 1 odebrání
  1. 2 0
      debian/changelog
  2. 2 1
      dpkg-deb/build.c

+ 2 - 0
debian/changelog

@@ -88,6 +88,8 @@ dpkg (1.17.7) UNRELEASED; urgency=low
     compression ratio, and in cases where higher compatibility or raw speed
     is desired gzip is still the better option. Although unpacking will be
     kept being supported to handle existing bzip2 compressed .deb files.
+  * Use GNU tar's --no-unquote when using -T in dpkg-deb to avoid mangling
+    filenames. Reported by Niels Thykier <niels@thykier.net>. Closes: #743687
 
   [ Updated dpkg translations ]
   * German (Sven Joachim).

+ 2 - 1
dpkg-deb/build.c

@@ -599,7 +599,8 @@ do_build(const char *const *argv)
     m_dup2(p2[1],1); close(p2[0]); close(p2[1]);
     if (chdir(dir))
       ohshite(_("failed to chdir to `%.255s'"), dir);
-    execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--null", "-T", "-", "--no-recursion", NULL);
+    execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--null", "--no-unquote",
+                       "-T", "-", "--no-recursion", NULL);
     ohshite(_("unable to execute %s (%s)"), "tar -cf", TAR);
   }
   close(p1[0]);