From 9064ec1bd38dedbacab157d3d4841e3315b5e5d9 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 18 Aug 2010 23:20:56 +0000 Subject: [PATCH] Run ulimit4.sh using /bin/bash to avoid noexec Panora200 on IRC reported the error "/bin/bash: bad interpreter: Permission denied", which we tracked down to the fact that /var/www (or whatever) was mounted noexec. Prepending '/bin/bash ' to the command line should fix it. Not heavily tested -- I only checked that wfShellExec() seemed to work from eval.php for trivial uses. --- RELEASE-NOTES | 1 + includes/GlobalFunctions.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2e72a5cbcb..08bfc52373 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -294,6 +294,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN longer pollutes the parser cache. * (bug 17031) Correct which characters the parser allows in tag attributes. * Save 200 useless queries on each category page view +* Shell commands will now work on Linux in filesystems mounted noexec === API changes in 1.17 === * (bug 22738) Allow filtering by action type on query=logevent. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 6a2139c1d8..08b8c609a5 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2454,7 +2454,7 @@ function wfShellExec( $cmd, &$retval = null ) { if ( $time > 0 && $mem > 0 ) { $script = "$IP/bin/ulimit4.sh"; if ( is_executable( $script ) ) { - $cmd = escapeshellarg( $script ) . " $time $mem $filesize " . escapeshellarg( $cmd ); + $cmd = '/bin/bash ' . escapeshellarg( $script ) . " $time $mem $filesize " . escapeshellarg( $cmd ); } } } elseif ( php_uname( 's' ) == 'Windows NT' && @@ -3472,4 +3472,4 @@ function wfGetRepository() { } return $wgRepository; -} \ No newline at end of file +} -- 2.20.1