Merge pull request #99154 from TredwellGit/generate-expr-from-tarballs.pl
generate-expr-from-tarballs.pl: fix insecure temporary file
This commit is contained in:
commit
6c282a2c61
@ -11,8 +11,7 @@ use warnings;
|
|||||||
|
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
use File::Spec::Functions;
|
use File::Spec::Functions;
|
||||||
|
use File::Temp;
|
||||||
my $tmpDir = "/tmp/xorg-unpack";
|
|
||||||
|
|
||||||
|
|
||||||
my %pkgURLs;
|
my %pkgURLs;
|
||||||
@ -93,8 +92,7 @@ while (<>) {
|
|||||||
$pkgHashes{$pkg} = $hash;
|
$pkgHashes{$pkg} = $hash;
|
||||||
|
|
||||||
print "\nunpacking $path\n";
|
print "\nunpacking $path\n";
|
||||||
system "rm -rf '$tmpDir'";
|
my $tmpDir = File::Temp->newdir();
|
||||||
mkdir $tmpDir, 0700;
|
|
||||||
system "cd '$tmpDir' && tar xf '$path'";
|
system "cd '$tmpDir' && tar xf '$path'";
|
||||||
die "cannot unpack `$path'" if $? != 0;
|
die "cannot unpack `$path'" if $? != 0;
|
||||||
print "\n";
|
print "\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user