From 9393d11c0b1b698c89e3291d4801bb249de7cc4a Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 22 Apr 2015 16:44:00 +0200 Subject: [PATCH] Display an error message when enabled modules cannot be read because /etc/icingaweb2 is not readable resolves #9141 --- library/Icinga/Application/Modules/Manager.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/Icinga/Application/Modules/Manager.php b/library/Icinga/Application/Modules/Manager.php index 90e55f0b4..84ee5e650 100644 --- a/library/Icinga/Application/Modules/Manager.php +++ b/library/Icinga/Application/Modules/Manager.php @@ -101,6 +101,16 @@ class Manager */ private function detectEnabledModules() { + if (false === file_exists($parent = dirname($this->enableDir))) { + return; + } + if (false === is_readable($parent)) { + throw new NotReadableError( + 'Cannot read enabled modules. Module directory\'s parent directory "%s" is not readable', + $parent + ); + } + if (! file_exists($this->enableDir)) { return; }