summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-06-21 12:14:24 +0200
committerGitHub <noreply@github.com>2016-06-21 12:14:24 +0200
commit097cba8b38331b578895cacb8cce9d2458a765cd (patch)
tree6784b9d45741d76230c24499abb3f97e533a24aa
parente6895cb3b5f991a3949db8eee1465166a1205135 (diff)
parent191a6c65d9caecea5db540c898468e631e7b2444 (diff)
downloadnextcloud-server-097cba8b38331b578895cacb8cce9d2458a765cd.tar.gz
nextcloud-server-097cba8b38331b578895cacb8cce9d2458a765cd.zip
Merge pull request #185 from nextcloud/fix-permission-issue
Show error message if config file is not readable
-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 3cff3ca960d..4b7497decd9 100644
--- a/lib/private/Config.php
+++ b/lib/private/Config.php
@@ -184,10 +184,10 @@ class Config {
// Include file and merge config
foreach ($configFiles as $file) {
- $filePointer = file_exists($file) ? fopen($file, 'r') : false;
+ $fileExistsAndIsReadable = file_exists($file) && is_readable($file);
+ $filePointer = $fileExistsAndIsReadable ? fopen($file, 'r') : false;
if($file === $this->configFilePath &&
- $filePointer === false &&
- @!file_exists($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;