Merge pull request #1858 from connortechnology/fix_1849

fixes escaping
pull/1562/merge
Andrew Bauer 2017-04-18 19:54:28 -05:00 committed by GitHub
commit f3e22689ac
1 changed files with 7 additions and 5 deletions

View File

@ -832,12 +832,13 @@ function packageControl( $command ) {
function daemonControl( $command, $daemon=false, $args=false ) {
$string = ZM_PATH_BIN."/zmdc.pl $command";
if ( $daemon ) {
$string .= escapeshellarg(" $daemon");
$string .= ' ' . $daemon;
if ( $args ) {
$string .= escapeshellarg(" $args");
$string .= ' ' . $args;
}
}
$string .= " 2>/dev/null >&- <&- >/dev/null";
$string = escapeshellcmd( $string );
$string .= ' 2>/dev/null >&- <&- >/dev/null';
exec( $string );
}
@ -944,10 +945,11 @@ function zmaStatus( $monitor ) {
function daemonCheck( $daemon=false, $args=false ) {
$string = ZM_PATH_BIN."/zmdc.pl check";
if ( $daemon ) {
$string .= escapeshellarg(" $daemon");
$string .= ' ' . $daemon;
if ( $args )
$string .= escapeshellarg(" $args");
$string .= ' '. $args;
}
$string = escapeshellcmd( $string );
$result = exec( $string );
return( preg_match( '/running/', $result ) );
}