Use eval "$4" instead of "$@", so that shell metacharacters such as "(" are understood
This commit is contained in:
parent
83cc91de5b
commit
4405aaf040
2 changed files with 7 additions and 3 deletions
4
bin/ulimit4.sh
Executable file
4
bin/ulimit4.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
ulimit -t $1 -v $2 -f $3
|
||||
eval "$4"
|
||||
|
|
@ -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' ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue