summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-11-12 15:56:02 +0100
committerLukas Reschke <lukas@owncloud.com>2014-11-12 15:57:19 +0100
commit49ddaf9489d3c9ce75f965dcbacf7e8017a84e08 (patch)
tree339a36fe194306f80ba6063129a6402810b5b237
parent5aaea6961c6507d3f716dcbd6a34ed453df5c3f2 (diff)
downloadnextcloud-server-49ddaf9489d3c9ce75f965dcbacf7e8017a84e08.tar.gz
nextcloud-server-49ddaf9489d3c9ce75f965dcbacf7e8017a84e08.zip
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
-rw-r--r--lib/private/config.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/config.php b/lib/private/config.php
index f0548442ab5..cc07d6a1ed1 100644
--- a/lib/private/config.php
+++ b/lib/private/config.php
@@ -138,12 +138,12 @@ class Config {
// Include file and merge config
foreach ($configFiles as $file) {
- if($file === $this->configFilePath && !@touch($file)) {
- // Writing to the main config might not be possible, e.g. if the wrong
+ $filePointer = @fopen($file, 'r');
+ 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)
continue;
}
- $filePointer = fopen($file, 'r');
// Try to acquire a file lock
if(!flock($filePointer, LOCK_SH)) {