]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix chmod on file descriptor 22207/head
authorJ0WI <J0WI@users.noreply.github.com>
Fri, 3 Jul 2020 18:53:54 +0000 (20:53 +0200)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Wed, 12 Aug 2020 01:26:05 +0000 (01:26 +0000)
Signed-off-by: J0WI <J0WI@users.noreply.github.com>
lib/private/Log/File.php

index eb7eedac83ec45d20cf29944dd279aa16de4f00a..c203673a8eb51268903c330a044e5e7115717ee2 100644 (file)
@@ -80,7 +80,7 @@ class File extends LogDetails implements IWriter, IFileBased {
        public function write(string $app, $message, int $level) {
                $entry = $this->logDetailsAsJSON($app, $message, $level);
                $handle = @fopen($this->logFile, 'a');
-               if ($this->logFileMode > 0 && (fileperms($this->logFile) & 0777) != $this->logFileMode) {
+               if ($this->logFileMode > 0 && is_file($this->logFile) && (fileperms($this->logFile) & 0777) != $this->logFileMode) {
                        @chmod($this->logFile, $this->logFileMode);
                }
                if ($handle) {