From: Tim Starling Date: Tue, 24 Apr 2007 18:09:53 +0000 (+0000) Subject: Use eval "$4" instead of "$@", so that shell metacharacters such as "(" are understood X-Git-Tag: 1.31.0-rc.0~53245 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=4405aaf040b9e1f6974dd3264fadecb5f4f525a3;p=lhc%2Fweb%2Fwiklou.git Use eval "$4" instead of "$@", so that shell metacharacters such as "(" are understood --- diff --git a/bin/ulimit4.sh b/bin/ulimit4.sh new file mode 100755 index 0000000000..2a840d2f7f --- /dev/null +++ b/bin/ulimit4.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +ulimit -t $1 -v $2 -f $3 +eval "$4" diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 291224b832..1ffde741b8 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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' ) {