Skip to content

Commit

Permalink
Merge pull request #22208 from nextcloud/backport/21676/stable19
Browse files Browse the repository at this point in the history
[stable19] Fix chmod on file descriptor
  • Loading branch information
rullzer authored Aug 13, 2020
2 parents baa6482 + 9b028a6 commit fe8ea53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Log/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function __construct(string $path, string $fallbackPath = '', SystemConfi
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) {
Expand Down

0 comments on commit fe8ea53

Please sign in to comment.