mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
Manager: Ensure enableModule dir has correct permission when created
This commit is contained in:
parent
77060ed312
commit
c0d247613d
@ -280,13 +280,17 @@ class Manager
|
|||||||
$target = $this->installedBaseDirs[$name];
|
$target = $this->installedBaseDirs[$name];
|
||||||
$link = $this->enableDir . DIRECTORY_SEPARATOR . $name;
|
$link = $this->enableDir . DIRECTORY_SEPARATOR . $name;
|
||||||
|
|
||||||
if (! is_dir($this->enableDir) && !@mkdir($this->enableDir, 02770, true)) {
|
if (! is_dir($this->enableDir)) {
|
||||||
$error = error_get_last();
|
if (!@mkdir($this->enableDir, 0777, true)) {
|
||||||
throw new SystemPermissionException(
|
$error = error_get_last();
|
||||||
'Failed to create enabledModules directory "%s" (%s)',
|
throw new SystemPermissionException(
|
||||||
$this->enableDir,
|
'Failed to create enabledModules directory "%s" (%s)',
|
||||||
$error['message']
|
$this->enableDir,
|
||||||
);
|
$error['message']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
chmod($this->enableDir, 02770);
|
||||||
} elseif (! is_writable($this->enableDir)) {
|
} elseif (! is_writable($this->enableDir)) {
|
||||||
throw new SystemPermissionException(
|
throw new SystemPermissionException(
|
||||||
'Cannot enable module "%s". Check the permissions for the enabledModules directory: %s',
|
'Cannot enable module "%s". Check the permissions for the enabledModules directory: %s',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user