+
+ # v4 and up
+ if (! compat(3)) {
+ # Programs in the bin and init.d dirs should be executable..
+ for my $dir (qw{usr/bin bin usr/sbin sbin usr/games etc/init.d}) {
+ if (-d "$tmp/$dir") {
+ complex_doit("find $tmp/$dir -type f $find_options -print0 2>/dev/null",
+ "| xargs -0r chmod a+x");
+ }
+ }
+ }
+
+ # ADA ali files should be mode 444 to avoid recompilation
+ complex_doit("find $tmp/usr/lib -type f",
+ "-name '*.ali' $find_options -print0",
+ "2>/dev/null | xargs -0r chmod uga-w");
+
+ # Lintian overrides should never be executable, too.
+ if (-d "$tmp/usr/share/lintian") {
+ complex_doit("find $tmp/usr/share/lintian/overrides",
+ "-type f $find_options -print0",
+ "2>/dev/null | xargs -0r chmod 644");
+ }
+
+ # Files in $tmp/etc/sudoers.d/ must be mode 440.
+ if (-d "$tmp/etc/sudoers.d") {
+ complex_doit("find $tmp/etc/sudoers.d",
+ "-type f ! -perm 440 $find_options -print0",
+ "2>/dev/null | xargs -0r chmod 440");
+ }