]> granicus.if.org Git - icinga2/commitdiff
Fix that relative paths do not work with include_zones
authorMichael Friedrich <michael.friedrich@netways.de>
Fri, 11 Dec 2015 15:58:43 +0000 (16:58 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 23 Feb 2016 08:09:20 +0000 (09:09 +0100)
fixes #10828

lib/config/configcompiler.cpp

index 9c0916f0e2a27411f615547aa70b812e42e8871b..d8e606425fbe51fb23dce4438bc8ce5ad7d7b369 100644 (file)
@@ -212,14 +212,17 @@ Expression *ConfigCompiler::HandleIncludeZones(const String& relativeBase, const
     const String& path, const String& pattern, const String& package, const DebugInfo&)
 {
        String ppath;
+       String newRelativeBase = relativeBase;
 
        if (path.GetLength() > 0 && path[0] == '/')
                ppath = path;
-       else
+       else {
                ppath = relativeBase + "/" + path;
+               newRelativeBase = ".";
+       }
 
        std::vector<Expression *> expressions;
-       Utility::Glob(ppath + "/*", boost::bind(&ConfigCompiler::HandleIncludeZone, relativeBase, tag, _1, pattern, package, boost::ref(expressions)), GlobDirectory);
+       Utility::Glob(ppath + "/*", boost::bind(&ConfigCompiler::HandleIncludeZone, newRelativeBase, tag, _1, pattern, package, boost::ref(expressions)), GlobDirectory);
        return new DictExpression(expressions);
 }