r21537 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21536‎ | r21537 | r21538 >
Date:18:09, 24 April 2007
Author:tstarling
Status:old
Tags:
Comment:
Use eval "$4" instead of "$@", so that shell metacharacters such as "(" are understood
Modified paths:
  • /trunk/phase3/bin/ulimit4.sh (added) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1820,14 +1820,14 @@
18211821 }
18221822
18231823 if ( php_uname( 's' ) == 'Linux' ) {
1824 - $time = ini_get( 'max_execution_time' );
 1824+ $time = intval( ini_get( 'max_execution_time' ) );
18251825 $mem = intval( $wgMaxShellMemory );
18261826 $filesize = intval( $wgMaxShellFileSize );
18271827
18281828 if ( $time > 0 && $mem > 0 ) {
1829 - $script = "$IP/bin/ulimit-tvf.sh";
 1829+ $script = "$IP/bin/ulimit4.sh";
18301830 if ( is_executable( $script ) ) {
1831 - $cmd = escapeshellarg( $script ) . " $time $mem $filesize $cmd";
 1831+ $cmd = escapeshellarg( $script ) . " $time $mem $filesize " . escapeshellarg( $cmd );
18321832 }
18331833 }
18341834 } elseif ( php_uname( 's' ) == 'Windows NT' ) {
Index: trunk/phase3/bin/ulimit4.sh
@@ -0,0 +1,4 @@
 2+#!/bin/bash
 3+
 4+ulimit -t $1 -v $2 -f $3
 5+eval "$4"
Property changes on: trunk/phase3/bin/ulimit4.sh
___________________________________________________________________
Added: svn:eol-style
16 + native
Added: svn:executable
27 + *