[debhelper-devel] Bug#862003: debhelper: Regression in dh_fixperms causing packages to be non-reproducible

Chris Lamb lamby at debian.org
Sun May 7 10:15:30 UTC 2017


Source: debhelper
Version: 10.3
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: umask toolchain
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

There is a regression in debhelper 10.3 which is making packages
unreproducible as dh_fixperms it no longer resets permissions with
respect to the current umask.

As debhelper "self-hosts", debhelper 10.3 is itself not reproducible.
For example:

│ │ │ │ --rwxr-xr-x   ./
│ │ │ │ +-rwxrwxr-x   ./
[…]
│ │ │ │ --rwxr-xr-x   ./usr/share/doc/debhelper/examples/rules.tiny
│ │ │ │ +-rwxrwxr-x   ./usr/share/doc/debhelper/examples/rules.tiny

The issue is that we are now generating invalid find(1) calls (ie.
`find … -a  -a`) — curiously we mask the resulting error with
`2>/dev/null` for some reason. I believe this was a regression in:

  https://anonscm.debian.org/git/debhelper/debhelper.git/commit/?id=8c29b1a738fc3a22ccf6fd6b2bbe5e9544a62199

Patch attached.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
       `-
-------------- next part --------------
diff --git a/dh_fixperms b/dh_fixperms
index 0e66a40..16c99eb 100755
--- a/dh_fixperms
+++ b/dh_fixperms
@@ -69,7 +69,7 @@ my @mode_0644_patterns = (
 my @mode_0755_patterns = (
 	# None for Debian
 );
-my $find_exclude_options='';
+my $find_exclude_options='-true';
 if (defined($dh{EXCLUDE_FIND}) && $dh{EXCLUDE_FIND} ne '') {
 	$find_exclude_options="! \\( $dh{EXCLUDE_FIND} \\)";
 }
@@ -86,7 +86,7 @@ sub find_and_reset_perm {
 	}
 	$dir_string = escape_shell(@dirs);
 	$raw_find_expr //= '';
-	$raw_find_expr_late //= '';
+	$raw_find_expr_late //= '-true';
 	complex_doit("find ${dir_string} ${raw_find_expr} -a ${find_exclude_options} -a ${raw_find_expr_late} -print0",
 		"2>/dev/null | xargs -0r chmod ${mode}");
 }


More information about the debhelper-devel mailing list