Set umask(0077) by default to prevent any access to the _data_ dir

This commit is contained in:
djmaze 2021-10-22 17:42:58 +02:00
parent 89f0e81194
commit 3945ab1349
2 changed files with 226 additions and 221 deletions

View file

@ -16,6 +16,7 @@ class CKEditorPlugin extends \RainLoop\Plugins\AbstractPlugin
// Apache AH00037: Symbolic link not allowed or link target not accessible
// That's why we clone the source
if (!\is_dir($path)/* && !\is_link($path)*/) {
$old_mask = umask(0022);
// $active = \symlink(__DIR__ . '/src', $path);
\mkdir($path, 0755);
$iterator = new \RecursiveIteratorIterator(
@ -29,6 +30,7 @@ class CKEditorPlugin extends \RainLoop\Plugins\AbstractPlugin
\copy($item, $path . DIRECTORY_SEPARATOR . $iterator->getSubPathName());
}
}
umask($old_mask);
}
if (\is_file("{$path}/ckeditor.js")) {

View file

@ -1,7 +1,10 @@
<?php
if (defined('APP_VERSION'))
{
if (defined('APP_VERSION'))
{
// revoke permissions
umask(0077);
if (!defined('APP_VERSION_ROOT_PATH'))
{
if (function_exists('sys_getloadavg')) {
@ -269,4 +272,4 @@
{
exit(0);
}
}
}