From ec94318a353b662ddc1075c73986096218cbf3e1 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Tue, 29 Jan 2019 12:35:30 +0100 Subject: [PATCH 1/2] Filesystem storage: set permission on folders and files files are set 0660 and folders 0770. fix #6545 --- src/Model/Storage/Filesystem.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Model/Storage/Filesystem.php b/src/Model/Storage/Filesystem.php index bb68731cd..0ea3dafab 100644 --- a/src/Model/Storage/Filesystem.php +++ b/src/Model/Storage/Filesystem.php @@ -69,10 +69,13 @@ class Filesystem implements IStorage if (!is_file($path . '/index.html')) { file_put_contents($path . '/index.html', ''); } + chmod($path . '/index.html', 0660); + chmod($path, 0770); $path = dirname($path); } if (!is_file($path . '/index.html')) { file_put_contents($path . '/index.html', ''); + chmod($path . '/index.html', 0660); } } @@ -100,6 +103,7 @@ class Filesystem implements IStorage Logger::log('Failed to write data to ' . $file); throw new StorageException(L10n::t('Filesystem storage failed to save data to "%s". Check your write permissions', $file)); } + chmod($file, 0660); return $ref; } From a7d45682e79427784f13ef1685fd2764c8e4c103 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Tue, 29 Jan 2019 12:36:23 +0100 Subject: [PATCH 2/2] Filesystem storage: handle basepath with trailing slash --- src/Model/Storage/Filesystem.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/Storage/Filesystem.php b/src/Model/Storage/Filesystem.php index 0ea3dafab..e21e13ccd 100644 --- a/src/Model/Storage/Filesystem.php +++ b/src/Model/Storage/Filesystem.php @@ -28,7 +28,8 @@ class Filesystem implements IStorage private static function getBasePath() { - return Config::get('storage', 'filesystem_path', self::DEFAULT_BASE_FOLDER); + $path = Config::get('storage', 'filesystem_path', self::DEFAULT_BASE_FOLDER); + return rtrim($path, '/'); } /**