mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 18:11:02 -04:00
only chmod logfile if necessary
otherwise e.g. on SELinux this will log an error, so we better avoid it if not necessary.
This commit is contained in:
parent
b614547ff8
commit
dbf4a4b844
1 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue