Tim Starling has submitted this change and it was merged.

Change subject: Don't use stdout of mergeMessageFileList.php
......................................................................


Don't use stdout of mergeMessageFileList.php

We recently had an incident where the output of
mergeMessageFileList.php was polluted by display_errors, causing the
resulting error text to be displayed for all requests to the relevant
wikis (the error was before the <?php).

In general, it's not so easy to ensure that stdout is clean, when you
are sharing code with web requests, and it's only a few extra lines of
shell script to use the pre-existing --output option.

Change-Id: I037a1f5e5fcea627f7f3ca75528bca18cdbfab1a
---
M files/scap/mw-update-l10n
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  Tim Starling: Verified; Looks good to me, approved



diff --git a/files/scap/mw-update-l10n b/files/scap/mw-update-l10n
index 079dead..8bad411 100755
--- a/files/scap/mw-update-l10n
+++ b/files/scap/mw-update-l10n
@@ -40,9 +40,12 @@
        mwVerNum=${i%=*}
        mwDbName=${i#*=}
        echo "Updating ExtensionMessages-$mwVerNum.php..."
+       mwTempDest=$(sudo -u apache mktemp)
        sudo -u apache $BINDIR/mwscript mergeMessageFileList.php 
--wiki="$mwDbName" \
-               --list-file=$SOURCE/wmf-config/extension-list $QUIET \
-               > $SOURCE/wmf-config/ExtensionMessages-"$mwVerNum".php
+               --list-file=$SOURCE/wmf-config/extension-list $QUIET 
--output="$mwTempDest"
+       sudo -u apache chmod a+r "$mwTempDest"
+       cp "$mwTempDest" $SOURCE/wmf-config/ExtensionMessages-"$mwVerNum".php
+       sudo -u apache rm "$mwTempDest"
 
        # Update ExtensionMessages-*.php in the local copy
        sudo -u mwdeploy cp 
$SOURCE/wmf-config/ExtensionMessages-"$mwVerNum".php $DEST/wmf-config/

-- 
To view, visit https://gerrit.wikimedia.org/r/57697
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I037a1f5e5fcea627f7f3ca75528bca18cdbfab1a
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Tim Starling <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: Tim Starling <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to