Filesystem storage: set permission on folders and files
authorfabrixxm <fabrix.xm@gmail.com>
Tue, 29 Jan 2019 11:35:30 +0000 (12:35 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Tue, 29 Jan 2019 11:35:30 +0000 (12:35 +0100)
files are set 0660 and folders 0770.
fix #6545

src/Model/Storage/Filesystem.php

index bb68731..0ea3daf 100644 (file)
@@ -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;
        }