Bug 1405068: Don't use a shell for running subcommands in unwrap_full_update.pl. draft
authorTom Prince <mozilla@hocat.ca>
Mon, 02 Oct 2017 12:21:55 -0600
changeset 673750 1db6137fafd8452f66647456aa646dbd63bc16a7
parent 673749 735c2274b539ac9ef56dc07b1f5e3941fb33d5b2
child 673751 702502e7288038253f8bb5d48a5f4e1a8d1d0238
push id82629
push userbmo:mozilla@hocat.ca
push dateMon, 02 Oct 2017 18:32:33 +0000
bugs1405068
milestone58.0a1
Bug 1405068: Don't use a shell for running subcommands in unwrap_full_update.pl. MozReview-Commit-ID: JDhndUIhOT1
tools/update-packaging/unwrap_full_update.pl
--- a/tools/update-packaging/unwrap_full_update.pl
+++ b/tools/update-packaging/unwrap_full_update.pl
@@ -70,17 +70,17 @@ if (defined($opts{'h'}) || scalar(@ARGV)
     print_usage();
     exit 1;
 }
 
 $archive = $ARGV[0];
 @marentries = `"$MAR" -t "$archive"`;
 $? && die("Couldn't run \"$MAR\" -t");
 
-system("$MAR -x \"$archive\"") == 0 ||
+system($MAR, "-x", $archive) == 0 ||
   die "Couldn't run $MAR -x";
 
 # Try to determine if the mar file contains bzip2 compressed files and if not
 # assume that the mar file contains lzma compressed files. The updatev3.manifest
 # file is checked since a valid mar file must have this file in the root path.
 open(my $testfilename, "updatev3.manifest") or die $!;
 binmode($testfilename);
 read($testfilename, my $bytes, 3);
@@ -95,23 +95,23 @@ shift @marentries;
 
 foreach (@marentries) {
     tr/\n\r//d;
     my @splits = split(/\t/,$_);
     my $file = $splits[2];
 
     print "Decompressing: " . $file . "\n";
     if ($MAR_OLD_FORMAT) {
-      system("mv \"$file\" \"$file.bz2\"") == 0 ||
+      system("mv", $file, "$file.bz2") == 0 ||
         die "Couldn't mv \"$file\"";
-      system("\"$BZIP2\" -d \"$file.bz2\"") == 0 ||
+      system($BZIP2, "-d", "$file.bz2") == 0 ||
         die "Couldn't decompress \"$file\"";
     }
     else {
-      system("mv \"$file\" \"$file.xz\"") == 0 ||
+      system("mv", $file, "$file.xz") == 0 ||
         die "Couldn't mv \"$file\"";
-      system("\"$XZ\" -d \"$file.xz\"") == 0 ||
+      system($XZ, "-d", "$file.xz") == 0 ||
         die "Couldn't decompress \"$file\"";
     }
 }
 
 print "Finished\n";