MarkAHershberger has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/307875

Change subject: FSLockManager should throw an exception if the lock dir isn't 
writable
......................................................................

FSLockManager should throw an exception if the lock dir isn't writable

This will help people who are setting up the wiki for the first time
as well as idiots (like me) who forget to run maintenance scripts
under the apache user.

Bug: T144446
Change-Id: I80f3d6c5327857c2700e7f45f4e32c0a74892f63
---
M includes/filebackend/lockmanager/FSLockManager.php
1 file changed, 9 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/75/307875/1

diff --git a/includes/filebackend/lockmanager/FSLockManager.php 
b/includes/filebackend/lockmanager/FSLockManager.php
index 2b660ec..89f96da 100644
--- a/includes/filebackend/lockmanager/FSLockManager.php
+++ b/includes/filebackend/lockmanager/FSLockManager.php
@@ -228,13 +228,15 @@
        /**
         * Get the path to the lock file for a key
         * @param string $path
-        * @return string
-        */
-       protected function getLockPath( $path ) {
-               return "{$this->lockDir}/{$this->sha1Base36Absolute( $path 
)}.lock";
-       }
-
-       /**
+        * @return string
+        */
+       protected function getLockPath( $path ) {
+               if ( is_writable( $this->lockDir ) ) {
+                       return "{$this->lockDir}/{$this->sha1Base36Absolute( 
$path )}.lock";
+               }
+               throw new MWException( "Lockdir isn't writable: 
$this->lockDir\n" );
+       }
+        /**
         * Make sure remaining locks get cleared for sanity
         */
        function __destruct() {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80f3d6c5327857c2700e7f45f4e32c0a74892f63
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <m...@nichework.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to