[BUGFIX] Check if lock directory is writable 88/28988/3
authorAlexander Opitz <opitz.alexander@googlemail.com>
Mon, 31 Mar 2014 15:34:59 +0000 (17:34 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 1 Apr 2014 19:05:35 +0000 (21:05 +0200)
We should check if directory is writable. Else fopen in acquireLock
would only fail with error after waiting time. Also we do not aspect
write permission issue here.

Resolves: #57463
Releases: 6.2
Change-Id: Ia767a2355aecf1e816d4c130b151443e50e1a311
Reviewed-on: https://review.typo3.org/28988
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/core/Classes/Locking/Locker.php

index e310926..0e12593 100644 (file)
@@ -500,6 +500,9 @@ class Locker {
                                throw new \RuntimeException('Cannot create directory ' . $path, 1395140007);
                        }
                }
+               if (!is_writable($path)) {
+                       throw new \RuntimeException('Cannot write to directory ' . $path, 1396278700);
+               }
                $this->resource = $path . $this->id;
        }
 }