[Pkg-owncloud-commits] [owncloud] 54/74: Try to read the file only instead of trying to touch
David Prévot
taffit at moszumanska.debian.org
Tue Dec 2 22:04:38 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit d815638f7b086fad627dbbd22c10a068acfcae6c
Author: Lukas Reschke <lukas at owncloud.com>
Date: Wed Nov 12 15:56:02 2014 +0100
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
Conflicts:
lib/private/config.php
---
lib/private/config.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/private/config.php b/lib/private/config.php
index 7bf3863..cc07d6a 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(!@touch($file) && $file === $this->configFilePath) {
- // 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)) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list