[Reproducible-commits] [dpkg] 37/90: Dpkg::Source::Package::V2: Do not exclude pre-existing symlinks for debian/

Jérémy Bobbio lunar at moszumanska.debian.org
Sat Aug 29 18:26:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit a779ef95e8eef38b2cfc300d422aa54e900b4d64
Author: Guillem Jover <guillem at debian.org>
Date:   Thu Jul 9 01:54:18 2015 +0200

    Dpkg::Source::Package::V2: Do not exclude pre-existing symlinks for debian/
    
    This effectively reverts commit 867c88dadccff6e285c48dadccb61f9001b50d9b.
    
    There is no point in excluding pre-existing symlinks when unpacking the
    packaging tarball, as GNU tar will make sure to unlink any symlink
    before extracting an object replacing it. So there should be no danger
    of escaping the directory.
    
    Closes: #790073, #791535
---
 debian/changelog                  |  2 ++
 scripts/Dpkg/Source/Package/V2.pm | 14 +-------------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c72cee9..f7c900b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,8 @@ dpkg (1.18.2) UNRELEASED; urgency=low
       Regression introduced in dpkg 1.18.0. Closes: #789957
     - Make the BinaryFiles subpackage self-contained by explicitly importing
       File::Spec in Dpkg::Source::Package::V2.
+    - Do not exclude pre-existing symlinks when unpacking the debian/ tarball
+      in Dpkg::Source::Package::V2. Closes: #790073, #791535
   * Documentation:
     - Fix grammar in dpkg-architecture(1).
       Thanks to Chris Lamb <lamby at debian.org>. Closes: #787616
diff --git a/scripts/Dpkg/Source/Package/V2.pm b/scripts/Dpkg/Source/Package/V2.pm
index 741d0de..99fab9c 100644
--- a/scripts/Dpkg/Source/Package/V2.pm
+++ b/scripts/Dpkg/Source/Package/V2.pm
@@ -187,20 +187,8 @@ sub do_extract {
     # Extract debian tarball after removing the debian directory
     info(g_('unpacking %s'), $debianfile);
     erasedir("$newdirectory/debian");
-    # Exclude existing symlinks from extraction of debian.tar.gz as we
-    # don't want to overwrite something outside of $newdirectory due to a
-    # symlink
-    my @exclude_symlinks;
-    my $wanted = sub {
-        return if not -l;
-        my $fn = File::Spec->abs2rel($_, $newdirectory);
-        push @exclude_symlinks, '--exclude', $fn;
-    };
-    find({ wanted => $wanted, no_chdir => 1 }, $newdirectory);
     $tar = Dpkg::Source::Archive->new(filename => "$dscdir$debianfile");
-    $tar->extract($newdirectory, in_place => 1,
-                  options => [ '--anchored', '--no-wildcards',
-                  @exclude_symlinks ]);
+    $tar->extract($newdirectory, in_place => 1);
 
     # Apply patches (in a separate method as it might be overridden)
     $self->apply_patches($newdirectory, usage => 'unpack')

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list