For MediaWiki (recent comments | status changes | tags | authors | states | release notes | statistics)
Index: trunk/phase3/includes/GlobalFunctions.php =================================================================== --- trunk/phase3/includes/GlobalFunctions.php (revision 42135) +++ trunk/phase3/includes/GlobalFunctions.php (revision 42136) @@ -2145,7 +2145,7 @@ * @return collected stdout as a string (trailing newlines stripped) */ function wfShellExec( $cmd, &$retval=null ) { - global $IP, $wgMaxShellMemory, $wgMaxShellFileSize; + global $IP, $wgMaxShellMemory, $wgMaxShellFileSize, $wgMaxShellTime; if( wfIniGetBool( 'safe_mode' ) ) { wfDebug( "wfShellExec can't run in safe_mode, PHP's exec functions are too broken.\n" ); @@ -2155,7 +2155,7 @@ wfInitShellLocale(); if ( php_uname( 's' ) == 'Linux' ) { - $time = intval( ini_get( 'max_execution_time' ) ); + $time = intval( $wgMaxShellTime ); $mem = intval( $wgMaxShellMemory ); $filesize = intval( $wgMaxShellFileSize ); Index: trunk/phase3/includes/DefaultSettings.php =================================================================== --- trunk/phase3/includes/DefaultSettings.php (revision 42135) +++ trunk/phase3/includes/DefaultSettings.php (revision 42136) @@ -3257,6 +3257,11 @@ $wgMaxShellFileSize = 102400; /** + * Maximum CPU time in seconds for shell processes under linux + */ +$wgMaxShellTime = 180; + +/** * Executable name of PHP cli client (php/php5) */ $wgPhpCli = 'php'; Index: trunk/phase3/RELEASE-NOTES =================================================================== --- trunk/phase3/RELEASE-NOTES (revision 42135) +++ trunk/phase3/RELEASE-NOTES (revision 42136) @@ -166,6 +166,8 @@ * Added a call to the 'UnwatchArticleComplete' hook to the watchlist editor. This should make it so that ALL user-accessible methods of removing a page from a watchlist lead to this hook being called (it was previously only called from within Article.php +* Maximum execution time for shell processes on linux is now configured with + $wgMaxShellTime (180 seconds by default) === Bug fixes in 1.14 ===
The comment description refers to "linux", but I think we should change it to take into account that: first, the operating system is named "GNU/Linux", not "linux" (which is only the kernel); second, that this code may also apply to other operating systems not using the Linux kernel.