[Lock] fix lock file permissions

This commit is contained in:
fritzmg 2018-07-09 11:10:55 +02:00 committed by Nicolas Grekas
parent 4c7f29fefe
commit 23481a112e
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ class FlockStore implements StoreInterface
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
if (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) {
if ($handle = fopen($fileName, 'x')) {
chmod($fileName, 0444);
chmod($fileName, 0644);
} elseif (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) {
usleep(100); // Give some time for chmod() to complete
$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r');