diff options
author | Frank Lichtenheld <djpig@debian.org> | 2006-01-18 12:41:11 +0000 |
---|---|---|
committer | Frank Lichtenheld <djpig@debian.org> | 2006-01-18 12:41:11 +0000 |
commit | 7a1004b0b974c2ae9659bbba7b0666f8ba1441b5 (patch) | |
tree | e8a98b15f97ab467caf9b69d97336f750c4b88b9 /scripts | |
parent | c0d0233fb7a5a0cfde446ca3baf306f413444baa (diff) | |
download | dpkg-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-x | scripts/dpkg-source.pl | 3 |
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) |