]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Don't replace forwards with broken config file 3619/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 23 Mar 2016 17:29:04 +0000 (18:29 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 23 Mar 2016 17:29:04 +0000 (18:29 +0100)
Closes #2072

pdns/reczones.cc

index 43c7d8277e120251f986af47b67a0112fe8df62a..1db3d6b362bd0e9e4f4cff2c721ffffffc3aef0e 100644 (file)
@@ -253,8 +253,8 @@ string reloadAuthAndForwards()
     string configname=::arg()["config-dir"]+"/recursor.conf";
     cleanSlashes(configname);
     
-    if(!::arg().preParseFile(configname.c_str(), "forward-zones")) 
-      L<<Logger::Warning<<"Unable to re-parse configuration file '"<<configname<<"'"<<endl;
+    if(!::arg().preParseFile(configname.c_str(), "forward-zones"))
+      throw runtime_error("Unable to re-parse configuration file '"+configname+"'");
     ::arg().preParseFile(configname.c_str(), "forward-zones-file");
     ::arg().preParseFile(configname.c_str(), "forward-zones-recurse");
     ::arg().preParseFile(configname.c_str(), "auth-zones");
@@ -268,7 +268,8 @@ string reloadAuthAndForwards()
     ::arg().gatherIncludes(extraConfigs);
 
     for(const std::string& fn :  extraConfigs) {
-      ::arg().preParseFile(fn.c_str(), "forward-zones", ::arg()["forward-zones"]);
+      if(!::arg().preParseFile(fn.c_str(), "forward-zones", ::arg()["forward-zones"]))
+        throw runtime_error("Unable to re-parse configuration file include '"+fn+"'");
       ::arg().preParseFile(fn.c_str(), "forward-zones-file", ::arg()["forward-zones-file"]);
       ::arg().preParseFile(fn.c_str(), "forward-zones-recurse", ::arg()["forward-zones-recurse"]);
       ::arg().preParseFile(fn.c_str(), "auth-zones",::arg()["auth-zones"]);