소스 검색

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 12 년 전
부모
커밋
14ba15362d
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  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]);