r11801 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11800‎ | r11801 | r11802 >
Date:20:17, 26 November 2005
Author:vibber
Status:old
Tags:
Comment:
* Fix ulimit parameters for wfShellExec when memory_limit is specified in 'm'
With memory_limit of '50M', it got automatically turned into '50' in a
numeric context, which ended up passing *zero* kilobytes for ulimit.
This would make nothing able to run on Linux, things would just segfault.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1588,6 +1588,9 @@
15891589 if ( php_uname( 's' ) == 'Linux' ) {
15901590 $time = ini_get( 'max_execution_time' );
15911591 $mem = ini_get( 'memory_limit' );
 1592+ if( preg_match( '/^([0-9]+)[Mm]$/', trim( $mem ), $m ) ) {
 1593+ $mem = intval( $m[1] * (1024*1024) );
 1594+ }
15921595 if ( $time > 0 && $mem > 0 ) {
15931596 $script = "$IP/bin/ulimit.sh";
15941597 if ( is_executable( $script ) ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -254,7 +254,9 @@
255255 * Changed mail form to have a bigger message entry box (like for editing
256256 a page
257257 * Support <includeonly> in templates loaded through preload= parameter
 258+* Fix ulimit parameters for wfShellExec when memory_limit is specified in 'm'
258259
 260+
259261 === Caveats ===
260262
261263 Some output, particularly involving user-supplied inline HTML, may not

Status & tagging log