From: Gergő Tisza Date: Sat, 23 Jun 2018 14:10:20 +0000 (+0200) Subject: shell.php: prevent permission error X-Git-Tag: 1.34.0-rc.0~4807^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=3f2db72083b0a02cc35afbbfb7a6a52244388098;p=lhc%2Fweb%2Fwiklou.git shell.php: prevent permission error Avoid bobthecow/psysh#443[1] (PsySH using XDG_RUNTIME_DIR as temp directory, which is inherited by the new user when doing sudo -E but is only writable by the old user) by using the MediaWiki temp dir. [1]: https://github.com/bobthecow/psysh/issues/443 Change-Id: Ica9344cdf23323d264f66df03b9d82ccc0582e45 --- diff --git a/maintenance/shell.php b/maintenance/shell.php index c8a8a4527f..a67417fc09 100644 --- a/maintenance/shell.php +++ b/maintenance/shell.php @@ -67,8 +67,12 @@ class MediaWikiShell extends Maintenance { // add this after initializing the code cleaner so all the default passes get added first $traverser->addVisitor( new CodeCleanerGlobalsPass() ); - $config = new \Psy\Configuration( [ 'codeCleaner' => $codeCleaner ] ); + $config = new \Psy\Configuration(); + $config->setCodeCleaner( $codeCleaner ); $config->setUpdateCheck( \Psy\VersionUpdater\Checker::NEVER ); + // prevent https://github.com/bobthecow/psysh/issues/443 when using sudo -E + $config->setRuntimeDir( wfTempDir() ); + $shell = new \Psy\Shell( $config ); if ( $this->hasOption( 'd' ) ) { $this->setupLegacy();