From 6e4bf73c3604e57ea0002a9866c25646aa5f6edf Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Tue, 24 Jun 2014 14:54:31 +0200 Subject: [PATCH] Compute config file paths properly fixes #6564 fixes #6534 --- library/Icinga/Application/ApplicationBootstrap.php | 3 +++ library/Icinga/Application/Config.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index 38bb11981..e9b6028bb 100644 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -152,6 +152,9 @@ abstract class ApplicationBootstrap } } $this->configDir = realpath($configDir); + if (!$this->configDir) { + $this->configDir = '/etc/icingaweb'; + } $this->setupAutoloader(); $this->setupZendAutoloader(); diff --git a/library/Icinga/Application/Config.php b/library/Icinga/Application/Config.php index 0336c588d..52d6ebfc6 100644 --- a/library/Icinga/Application/Config.php +++ b/library/Icinga/Application/Config.php @@ -169,7 +169,7 @@ class Config extends Zend_Config throw new ProgrammingError('Windows support has not yet been implemented'); } - if (strpos($path, DIRECTORY_SEPARATOR) === 0 || self::$configDir === false) { + if (strpos(pathinfo($path, PATHINFO_DIRNAME), DIRECTORY_SEPARATOR) === 0) { return $path; }