Skip to content
Snippets Groups Projects
Commit 49ddaf94 authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Try to read the file only instead of trying to touch

The permissions are already catched properly on the installation so we just have to check whether the file is readable to prevent fatal errors from happening.

Fixes https://github.com/owncloud/core/issues/12135
parent 5aaea696
No related branches found
No related tags found
No related merge requests found
...@@ -138,12 +138,12 @@ class Config { ...@@ -138,12 +138,12 @@ class Config {
// Include file and merge config // Include file and merge config
foreach ($configFiles as $file) { foreach ($configFiles as $file) {
if($file === $this->configFilePath && !@touch($file)) { $filePointer = @fopen($file, 'r');
// Writing to the main config might not be possible, e.g. if the wrong if($file === $this->configFilePath && $filePointer === false) {
// Opening the main config might not be possible, e.g. if the wrong
// permissions are set (likely on a new installation) // permissions are set (likely on a new installation)
continue; continue;
} }
$filePointer = fopen($file, 'r');
// Try to acquire a file lock // Try to acquire a file lock
if(!flock($filePointer, LOCK_SH)) { if(!flock($filePointer, LOCK_SH)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment