Fix quoting of args

This commit is contained in:
Jamie Cameron
2025-10-29 22:02:29 -07:00
parent 1c9e8b5a25
commit 1a52bf4d72

View File

@@ -14,6 +14,7 @@ my ($mgr) = glob($config{'cachemgr_path'});
if (&has_command($mgr)) { if (&has_command($mgr)) {
$| = 1; $| = 1;
my $temp; my $temp;
my $args = join(" ", map { quotemeta($_) } @ARGV);
if ($ENV{'REQUEST_METHOD'} eq 'POST') { if ($ENV{'REQUEST_METHOD'} eq 'POST') {
# Deal with POST data # Deal with POST data
my $post; my $post;
@@ -23,10 +24,10 @@ if (&has_command($mgr)) {
&open_tempfile($fh, ">$temp", 0, 1); &open_tempfile($fh, ">$temp", 0, 1);
&print_tempfile($fh, $post); &print_tempfile($fh, $post);
&close_tempfile($fh); &close_tempfile($fh);
open(MGR, "$mgr ".join(" ", @ARGV)." <$temp |"); open(MGR, "$mgr $args <$temp |");
} }
else { else {
open(MGR, "$mgr ".join(" ", @ARGV)." |"); open(MGR, "$mgr $args |");
} }
while(<MGR>) { while(<MGR>) {
print; print;