Changeset 2067

Show
Ignore:
Timestamp:
03/16/11 20:11:15 (2 years ago)
Author:
ahu
Message:

add error checking for the Lua incoming AXFR filter script. jp_mens, pls update your blog ;-)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/slavecommunicator.cc

    r2065 r2067  
    115115    vector<string> scripts; 
    116116    if(B->getDomainMetadata(domain, "LUA-AXFR-SCRIPT", scripts) && !scripts.empty()) { 
    117       pdl.reset(new PowerDNSLua(scripts[0])); 
    118       L<<Logger::Info<<"Loaded Lua script '"<<scripts[0]<<"' to edit the incoming AXFR of '"<<domain<<"'"<<endl; 
     117      try { 
     118        pdl.reset(new PowerDNSLua(scripts[0])); 
     119        L<<Logger::Info<<"Loaded Lua script '"<<scripts[0]<<"' to edit the incoming AXFR of '"<<domain<<"'"<<endl; 
     120      } 
     121      catch(std::exception& e) { 
     122        L<<Logger::Error<<"Failed to load Lua editing script '"<<scripts[0]<<"' for incoming AXFR of '"<<domain<<"': "<<e.what()<<endl; 
     123        return; 
     124      } 
    119125    } 
    120126    AXFRRetriever retriever(raddr, domain.c_str(), tsigkeyname, tsigalgorithm, tsigsecret);