]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
make sure that if we can't reload our configuration file on reload-acls, we don't...
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 25 Sep 2014 11:37:57 +0000 (13:37 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 25 Sep 2014 11:37:57 +0000 (13:37 +0200)
to the built-in defaults, but retain the old configuration. Closes #1728. Thanks to Andreas Jakum for spotting this issue.

pdns/pdns_recursor.cc

index c4660fc1881278f8f44e92297711736a8b7e6134..1a9e797fa8e6edea57dac05a348679cbe583af1a 100644 (file)
@@ -1674,7 +1674,7 @@ void parseACLs()
     cleanSlashes(configname);
     
     if(!::arg().preParseFile(configname.c_str(), "allow-from-file")) 
-      L<<Logger::Warning<<"Unable to re-parse configuration file '"<<configname<<"'"<<endl;
+      throw runtime_error("Unable to re-parse configuration file '"+configname+"'");
     ::arg().preParseFile(configname.c_str(), "allow-from", LOCAL_NETS);
     ::arg().preParseFile(configname.c_str(), "include-dir");
     ::arg().preParse(g_argc, g_argv, "include-dir");
@@ -1684,8 +1684,10 @@ void parseACLs()
     ::arg().gatherIncludes(extraConfigs);
 
     BOOST_FOREACH(const std::string& fn, extraConfigs) {
-      ::arg().preParseFile(fn.c_str(), "allow-from-file", ::arg()["allow-from-file"]);
-      ::arg().preParseFile(fn.c_str(), "allow-from", ::arg()["allow-from"]);
+      if(!::arg().preParseFile(fn.c_str(), "allow-from-file", ::arg()["allow-from-file"]))
+       throw runtime_error("Unable to re-parse configuration file include '"+fn+"'");
+      if(!::arg().preParseFile(fn.c_str(), "allow-from", ::arg()["allow-from"]))
+       throw runtime_error("Unable to re-parse configuration file include '"+fn+"'");
     }
 
     ::arg().preParse(g_argc, g_argv, "allow-from-file");