]> granicus.if.org Git - pdns/commitdiff
add error checking for the Lua incoming AXFR filter script. jp_mens, pls update your...
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 16 Mar 2011 19:11:15 +0000 (19:11 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 16 Mar 2011 19:11:15 +0000 (19:11 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2067 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/slavecommunicator.cc

index fe85e1b956dba7a5085f462de84e56c7d8772d3e..53ac6615f9fada8ab08a9d9ab3aa794aa42c8ed7 100644 (file)
@@ -114,8 +114,14 @@ void CommunicatorClass::suck(const string &domain,const string &remote)
     scoped_ptr<PowerDNSLua> pdl;
     vector<string> scripts;
     if(B->getDomainMetadata(domain, "LUA-AXFR-SCRIPT", scripts) && !scripts.empty()) {
-      pdl.reset(new PowerDNSLua(scripts[0]));
-      L<<Logger::Info<<"Loaded Lua script '"<<scripts[0]<<"' to edit the incoming AXFR of '"<<domain<<"'"<<endl;
+      try {
+        pdl.reset(new PowerDNSLua(scripts[0]));
+        L<<Logger::Info<<"Loaded Lua script '"<<scripts[0]<<"' to edit the incoming AXFR of '"<<domain<<"'"<<endl;
+      }
+      catch(std::exception& e) {
+        L<<Logger::Error<<"Failed to load Lua editing script '"<<scripts[0]<<"' for incoming AXFR of '"<<domain<<"': "<<e.what()<<endl;
+        return;
+      }
     }
     AXFRRetriever retriever(raddr, domain.c_str(), tsigkeyname, tsigalgorithm, tsigsecret);