summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFrank Lichtenheld <djpig@debian.org>2006-01-18 12:41:11 +0000
committerFrank Lichtenheld <djpig@debian.org>2006-01-18 12:41:11 +0000
commit7a1004b0b974c2ae9659bbba7b0666f8ba1441b5 (patch)
treee8a98b15f97ab467caf9b69d97336f750c4b88b9 /scripts
parentc0d0233fb7a5a0cfde446ca3baf306f413444baa (diff)
downloaddpkg-7a1004b0b974c2ae9659bbba7b0666f8ba1441b5.tar.gz
dpkg-source -x now tries to chown all files extracted from
tar files. The temporary directory is now created with mode 0700, too. Together this should make it safer to run dpkg-source -x as root. Based on suggestions by Marcus Brinkmann and Colin Watson. Closes: #144571, #238460
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dpkg-source.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/dpkg-source.pl b/scripts/dpkg-source.pl
index 7548379fb..6798b2155 100755
--- a/scripts/dpkg-source.pl
+++ b/scripts/dpkg-source.pl
@@ -642,10 +642,11 @@ if ($opmode eq 'build') {
my $tmp = "$target.tmp-nest";
(my $t = $target) =~ s!.*/!!;
- mkdir($tmp,0755) || &syserr("unable to create `$tmp'");
+ mkdir($tmp,0700) || &syserr("unable to create `$tmp'");
system "chmod", "g-s", $tmp;
print("$progname: unpacking $tarfile\n");
extracttar("$dscdir/$tarfile",$tmp,$t);
+ system "chown", '-R', '-f', join(':',@fowner), "$tmp/$t";
rename("$tmp/$t",$target)
|| &syserr("unable to rename `$tmp/$t' to `$target'");
rmdir($tmp)