diff --git a/debian/changelog b/debian/changelog index a57dd79..b76f6c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 28 Feb 2011 09:17:33 +0000 + -- Neil Williams Mon, 28 Feb 2011 16:25:53 +0000 multistrap (2.1.12) unstable; urgency=low diff --git a/device-table.pl b/device-table.pl index af57790..e53f258 100755 --- a/device-table.pl +++ b/device-table.pl @@ -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)$/) {