summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrank Lichtenheld <djpig@debian.org>2006-01-18 14:27:39 +0000
committerFrank Lichtenheld <djpig@debian.org>2006-01-18 14:27:39 +0000
commit3c5ae80199cb3683412bbb8e66699ce60a4f58cc (patch)
tree71eb16a32e00a3f2a97d24437040b76bb152c03e /scripts
parentd928c5be1b568139c1d717bed34199437c4b110b (diff)
downloaddpkg-3c5ae80199cb3683412bbb8e66699ce60a4f58cc.tar.gz
Let dpkg-source -b warn about special permissions of files added
in the diff since these will get lost. Closes: #306125
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dpkg-source.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index edbbd8eb9..2c52a46d5 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -34,6 +34,7 @@ $def_dscformat = "1.0"; # default format for -b
use POSIX;
use POSIX qw (:errno_h :signal_h);
+use Fcntl qw (:mode);
use strict 'refs';
@@ -405,6 +406,7 @@ if ($opmode eq 'build') {
next file if $fn =~ m/$diff_ignore_regexp/o;
$fn =~ s,^\./,,;
lstat("$dir/$fn") || &syserr("cannot stat file $dir/$fn");
+ my $mode = S_IMODE((lstat(_))[2]);
if (-l _) {
$type{$fn}= 'symlink';
&checktype('-l') || next;
@@ -418,6 +420,13 @@ if ($opmode eq 'build') {
if (!lstat("$origdir/$fn")) {
$! == ENOENT || &syserr("cannot stat orig file $origdir/$fn");
$ofnread= '/dev/null';
+ if( $mode & ( S_IXUSR | SIXGRP | S_IXOTH ) ) {
+ &warn( sprintf( "executable mode %04o of `$fn' will not be represented in diff", $mode ) )
+ unless $fn eq 'debian/rules';
+ }
+ if( $mode & ( S_ISUID | S_IGID | S_ISVTX ) ) {
+ &warn( sprintf( "special mode %04o of `$fn' will not be represented in diff", $mode ) );
+ }
} elsif (-f _) {
$ofnread= "$origdir/$fn";
} else {