mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Set umask(0077) by default to prevent any access to the _data_ dir
This commit is contained in:
parent
89f0e81194
commit
3945ab1349
2 changed files with 226 additions and 221 deletions
|
|
@ -16,6 +16,7 @@ class CKEditorPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
// Apache AH00037: Symbolic link not allowed or link target not accessible
|
// Apache AH00037: Symbolic link not allowed or link target not accessible
|
||||||
// That's why we clone the source
|
// That's why we clone the source
|
||||||
if (!\is_dir($path)/* && !\is_link($path)*/) {
|
if (!\is_dir($path)/* && !\is_link($path)*/) {
|
||||||
|
$old_mask = umask(0022);
|
||||||
// $active = \symlink(__DIR__ . '/src', $path);
|
// $active = \symlink(__DIR__ . '/src', $path);
|
||||||
\mkdir($path, 0755);
|
\mkdir($path, 0755);
|
||||||
$iterator = new \RecursiveIteratorIterator(
|
$iterator = new \RecursiveIteratorIterator(
|
||||||
|
|
@ -29,6 +30,7 @@ class CKEditorPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||||||
\copy($item, $path . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
|
\copy($item, $path . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
umask($old_mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\is_file("{$path}/ckeditor.js")) {
|
if (\is_file("{$path}/ckeditor.js")) {
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
if (defined('APP_VERSION'))
|
if (defined('APP_VERSION'))
|
||||||
{
|
{
|
||||||
|
// revoke permissions
|
||||||
|
umask(0077);
|
||||||
|
|
||||||
if (!defined('APP_VERSION_ROOT_PATH'))
|
if (!defined('APP_VERSION_ROOT_PATH'))
|
||||||
{
|
{
|
||||||
if (function_exists('sys_getloadavg')) {
|
if (function_exists('sys_getloadavg')) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue