summaryrefslogtreecommitdiffstats
path: root/lib/private/Log
diff options
context:
space:
mode:
authorduritong <peter.meier+github@immerda.ch>2017-01-29 00:55:39 +0100
committerGitHub <noreply@github.com>2017-01-29 00:55:39 +0100
commitdbf4a4b844fa1e302b162bfbeea53bea229359f1 (patch)
tree093e34373add14ff4795ba55cd411a7f34bc4b3c /lib/private/Log
parentb614547ff8c1c8c91853b82bf82b601b68933e3b (diff)
downloadnextcloud-server-dbf4a4b844fa1e302b162bfbeea53bea229359f1.tar.gz
nextcloud-server-dbf4a4b844fa1e302b162bfbeea53bea229359f1.zip
only chmod logfile if necessary
otherwise e.g. on SELinux this will log an error, so we better avoid it if not necessary.
Diffstat (limited to 'lib/private/Log')
-rw-r--r--lib/private/Log/File.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php
index d41ab83c804..4f18023613e 100644
--- a/lib/private/Log/File.php
+++ b/lib/private/Log/File.php
@@ -116,7 +116,9 @@ class File {
);
$entry = json_encode($entry);
$handle = @fopen(self::$logFile, 'a');
- @chmod(self::$logFile, 0640);
+ if ((fileperms(self::$logFile) & 0777) != 0640) {
+ @chmod(self::$logFile, 0640);
+ }
if ($handle) {
fwrite($handle, $entry."\n");
fclose($handle);