summaryrefslogtreecommitdiff
path: root/FS/bin/freeside-paymentech-upload
diff options
context:
space:
mode:
authorivan <ivan>2009-11-03 19:56:48 +0000
committerivan <ivan>2009-11-03 19:56:48 +0000
commit9102acbdaba15cdd4daaa13020be6a4750c5fbb4 (patch)
tree58b82be27ef4a109178e099001a62393ff842663 /FS/bin/freeside-paymentech-upload
parent9c0ad034690f987506ee0fa8f32e210538963f3c (diff)
check for zip and unzip commands, use multi-arg version of system to prevent the shell getting its hands on things (metacharacters in pw or whatnot), RT#5650
Diffstat (limited to 'FS/bin/freeside-paymentech-upload')
-rwxr-xr-xFS/bin/freeside-paymentech-upload5
1 files changed, 4 insertions, 1 deletions
diff --git a/FS/bin/freeside-paymentech-upload b/FS/bin/freeside-paymentech-upload
index 08a59c5dc..985095e68 100755
--- a/FS/bin/freeside-paymentech-upload
+++ b/FS/bin/freeside-paymentech-upload
@@ -25,6 +25,8 @@ sub usage { "
my $user = shift or die &usage;
adminsuidsetup $user;
+my $zip_check = `which zip` or die "can't find zip executable\n";
+
my @batches;
if($opt_a) {
@@ -60,7 +62,8 @@ foreach my $pay_batch (@batches) {
print OUT $text;
close OUT;
- system("zip -P $password -q -j $tmpdir/$filename.zip $tmpdir/$filename.xml");
+ system('zip', '-P', '$password', '-q', '-j',
+ "$tmpdir/$filename.zip", "$tmpdir/$filename.xml");
die "failed to create zip file\n" if (! -f "$tmpdir/$filename.zip" );
push @filenames, $filename;