Permalink
Browse files

Shell-escape the pretty name so we can use special shell characters i…

…n it (like parentheses)
  • Loading branch information...
1 parent a19e5d4 commit 93f4e0de15c3bdc9caef8dacef22cd5022bf5f29 @russss russss committed Dec 15, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 poller.php
View
@@ -20,7 +20,8 @@
if ($thishost['enabled'] == true) {
logline("MASTER: Spawing polling child for {$thishost['prettyname']}", 1, $verbose);
$cwd = dirname(__FILE__);
- $command = "nohup /usr/bin/env php -f {$cwd}/poller_child.php {$thishost['prettyname']} >> {$cwd}/poller.log 2>&1 & echo $!";
+ $prettyname = escapeshellarg($thishost['prettyname']);
+ $command = "nohup /usr/bin/env php -f {$cwd}/poller_child.php {$prettyname} >> {$cwd}/poller.log 2>&1 & echo $!";
$pid = shell_exec($command);
logline("MASTER: Child spawned, PID is {$pid}", 1, $verbose);
} else {

0 comments on commit 93f4e0d

Please sign in to comment.