Refuse to enable modules prefixed w/ icingaweb2-module-

fixes #10870
This commit is contained in:
Eric Lippmann 2016-11-16 16:21:35 +01:00
parent 1cdef234a1
commit 39a5b3f64a
1 changed files with 9 additions and 0 deletions

View File

@ -249,6 +249,15 @@ class Manager
);
}
if (strtolower(substr($name, 0, 18)) === 'icingaweb2-module-') {
throw new ConfigurationError(
'Cannot enable module "%s": Directory name does not match the module\'s name.'
. ' Please rename the module to "%s" before enabling.',
$name,
substr($name, 18)
);
}
clearstatcache(true);
$target = $this->installedBaseDirs[$name];
$link = $this->enableDir . DIRECTORY_SEPARATOR . $name;