[icinga-checkins] icinga.org: icinga2/master: Fix: include_recursive should gracefully handle inaccessible files

git at icinga.org git at icinga.org
Tue Jul 5 15:44:52 CEST 2016


Module: icinga2
Branch: master
Commit: 5836b5b8683fe6afe7f260a7041f193fdd6a55b1
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=5836b5b8683fe6afe7f260a7041f193fdd6a55b1

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Tue Jul  5 15:40:49 2016 +0200

Fix: include_recursive should gracefully handle inaccessible files

fixes #12098

---

 lib/config/configcompiler.cpp |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/config/configcompiler.cpp b/lib/config/configcompiler.cpp
index 7e76e98..209b1bd 100644
--- a/lib/config/configcompiler.cpp
+++ b/lib/config/configcompiler.cpp
@@ -113,7 +113,14 @@ String ConfigCompiler::GetPackage(void) const
 void ConfigCompiler::CollectIncludes(std::vector<Expression *>& expressions,
     const String& file, const String& zone, const String& package)
 {
-	expressions.push_back(CompileFile(file, zone, package));
+	try {
+		Expression *expr = CompileFile(file, zone, package);
+		expressions.push_back(expr);
+	} catch (const std::exception& ex) {
+		Log(LogWarning, "ConfigCompiler")
+		    << "Cannot compile file '"
+		    << file << "': " << DiagnosticInformation(ex);
+	}
 }
 
 /**



More information about the icinga-checkins mailing list