Protect device-table.pl realpath usage to allow relative directories.

git-svn-id: http://emdebian.org/svn/current@7861 563faec7-e20c-0410-992a-a66f704d0ccd
This commit is contained in:
codehelp 2011-02-28 16:26:16 +00:00
parent 28cdf889b7
commit 849b2f560f
2 changed files with 12 additions and 1 deletions

4
debian/changelog vendored
View file

@ -6,8 +6,10 @@ multistrap (2.1.13) unstable; urgency=low
* Fix device-table.pl to use correct minor device number in
iterative mode (Closes: #615819)
* Disable SecureApt if fakeroot is detected.
* Protect device-table.pl realpath usage to allow relative
directories.
-- Neil Williams <codehelp@debian.org> Mon, 28 Feb 2011 09:17:33 +0000
-- Neil Williams <codehelp@debian.org> Mon, 28 Feb 2011 16:25:53 +0000
multistrap (2.1.12) unstable; urgency=low

View file

@ -41,6 +41,13 @@ if ($e !~ /\nFAKEROOTKEY=[0-9]+\n/) {
} else {
$fakeroot="";
}
# cope with people getting things wrong from local SVN (not a translated string).
if (dirname($0) ne "/usr/sbin/") {
print "checking realpath\n";
my $realpath = `which realpath`;
chomp ($realpath);
die ("ERR: Please install realpath.\n") if (not -x ($realpath));
}
while( @ARGV ) {
$_= shift( @ARGV );
last if m/^--$/;
@ -54,6 +61,8 @@ while( @ARGV ) {
$file = shift(@ARGV);
} elsif (/^(-d|--dir)$/) {
$dir = shift(@ARGV);
$dir = `realpath $dir`;
chomp($dir);
} elsif (/^(-n|--dry-run)$/) {
$dry++;
} elsif (/^(--no-fakeroot)$/) {