aports/community/nextcloud32/nextcloud-dont-chmod.patch
2025-09-29 11:05:59 +00:00

47 lines
1.9 KiB
Diff

commit d8f09abd65e5fd620b8b0d720daee293c355660c
Author: Leonardo Arena <rnalrd@alpinelinux.org>
Date: Mon Aug 31 06:59:15 2020 +0000
Don't chmod. The package takes care of setting the right permissions for directories and files
diff --git a/lib/private/Config.php b/lib/private/Config.php
index a9eb58a1866..c5ae123445d 100644
--- a/lib/private/Config.php
+++ b/lib/private/Config.php
@@ -282,9 +282,6 @@ class Config {
touch($this->configFilePath);
$filePointer = fopen($this->configFilePath, 'r+');
- // Prevent others not to read the config
- chmod($this->configFilePath, 0640);
-
// File does not exist, this can happen when doing a fresh install
if (!is_resource($filePointer)) {
throw new HintException(
diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php
index ba428ba185b..92a1b459084 100644
--- a/lib/private/Log/File.php
+++ b/lib/private/Log/File.php
@@ -51,9 +51,6 @@ 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 && is_file($this->logFile) && (fileperms($this->logFile) & 0777) != $this->logFileMode) {
- @chmod($this->logFile, $this->logFileMode);
- }
if ($handle) {
fwrite($handle, $entry."\n");
fclose($handle);
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index ebca1105838..fb2621dd238 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -517,7 +517,6 @@ class OC_Util {
. ' cannot be listed by other users.');
$perms = substr(decoct(@fileperms($dataDirectory)), -3);
if (substr($perms, -1) !== '0') {
- chmod($dataDirectory, 0770);
clearstatcache();
$perms = substr(decoct(@fileperms($dataDirectory)), -3);
if ($perms[2] !== '0') {