diff options
author | duritong <peter.meier+github@immerda.ch> | 2017-01-29 00:55:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-29 00:55:39 +0100 |
commit | dbf4a4b844fa1e302b162bfbeea53bea229359f1 (patch) | |
tree | 093e34373add14ff4795ba55cd411a7f34bc4b3c /lib/private/Log | |
parent | b614547ff8c1c8c91853b82bf82b601b68933e3b (diff) | |
download | nextcloud-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.php | 4 |
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); |