Use eval "$4" instead of "$@", so that shell metacharacters such as "(" are understood

This commit is contained in:
Tim Starling 2007-04-24 18:09:53 +00:00
parent 83cc91de5b
commit 4405aaf040
2 changed files with 7 additions and 3 deletions

4
bin/ulimit4.sh Executable file
View file

@ -0,0 +1,4 @@
#!/bin/bash
ulimit -t $1 -v $2 -f $3
eval "$4"

View file

@ -1820,14 +1820,14 @@ function wfShellExec( $cmd, &$retval=null ) {
}
if ( php_uname( 's' ) == 'Linux' ) {
$time = ini_get( 'max_execution_time' );
$time = intval( ini_get( 'max_execution_time' ) );
$mem = intval( $wgMaxShellMemory );
$filesize = intval( $wgMaxShellFileSize );
if ( $time > 0 && $mem > 0 ) {
$script = "$IP/bin/ulimit-tvf.sh";
$script = "$IP/bin/ulimit4.sh";
if ( is_executable( $script ) ) {
$cmd = escapeshellarg( $script ) . " $time $mem $filesize $cmd";
$cmd = escapeshellarg( $script ) . " $time $mem $filesize " . escapeshellarg( $cmd );
}
}
} elseif ( php_uname( 's' ) == 'Windows NT' ) {