[Reproducible-commits] [dpkg] 05/12: dpkg-deb: Normalize file permissions when creating control.tar

Niko Tyni ntyni at moszumanska.debian.org
Tue May 3 19:36:15 UTC 2016


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

ntyni pushed a commit to branch ntyni/reproducible_builds
in repository dpkg.

commit dba139bb088c1e127b8b7c61beed4e407b4bc864
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Thu Jun 4 18:48:28 2015 +0200

    dpkg-deb: Normalize file permissions when creating control.tar
    
    Permissions of file in control.tar will likely be affected by a different
    umask. While `dh_fixperms` already normalizes permissions for most
    packages, debhelper is not used by everywhere. As there is no use cases
    for having different permissions for control files than 644 or 755,
    we can normalize them directly in dpkg.
    
    This helps packages to build reproducibly when built with different umasks.
    
    Closes: #787980
---
 dpkg-deb/build.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
index b8a00d8..28c227d 100644
--- a/dpkg-deb/build.c
+++ b/dpkg-deb/build.c
@@ -464,11 +464,11 @@ tarball_pack(const char *dir, filenames_feed_func *tar_filenames_feeder,
       char mtime_option[30];
       snprintf(mtime_option, sizeof(mtime_option), "--mtime=@%ld", build_timestamp);
       mtime_option[29] = '\0';
-      execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--null", "--no-unquote",
+      execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--mode=go=rX,u+rw,a-s", "--null", "--no-unquote",
                          mtime_option, "--clamp-mtime", "--no-recursion",
                          "-T", "-", NULL);
     } else {
-      execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--null", "--no-unquote",
+      execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--mode=go=rX,u+rw,a-s", "--null", "--no-unquote",
                          "--no-recursion", "-T", "-", NULL);
     }
     ohshite(_("unable to execute %s (%s)"), "tar -cf", TAR);

-- 
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