]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add logging to trust anchor management
authorPieter Lexis <pieter.lexis@powerdns.com>
Tue, 7 Jun 2016 09:29:54 +0000 (11:29 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Tue, 7 Jun 2016 09:29:54 +0000 (11:29 +0200)
pdns/rec_channel_rec.cc

index 5568712b3dbd8dc83badb79744cdc2c544a0bbf8..3e0b7c40e25c504d3cdb2eb1cef9cba7dca46cc9 100644 (file)
@@ -367,6 +367,7 @@ string doAddNTA(T begin, T end)
     if (begin != end)
       why += " ";
   }
+  L<<Logger::Warning<<"Adding Negative Trust Anchor for "<<who<<" with reason '"<<why<<"', requested via control channel"<<endl;
   g_luaconfs.modify([who, why](LuaConfigItems& lci) {
       lci.negAnchors[who] = why;
       });
@@ -381,6 +382,7 @@ string doClearNTA(T begin, T end)
     return "No Negative Trust Anchor specified, doing nothing.\n";
 
   if (begin + 1 == end && *begin == "*"){
+    L<<Logger::Warning<<"Clearing all Negative Trust Anchors, requested via control channel"<<endl;
     g_luaconfs.modify([](LuaConfigItems& lci) {
         lci.negAnchors.clear();
       });
@@ -408,6 +410,7 @@ string doClearNTA(T begin, T end)
   string removed("");
   bool first(true);
   for (auto const &who : toRemove) {
+    L<<Logger::Warning<<"Clearing Negative Trust Anchor for "<<who<<", requested via control channel"<<endl;
     g_luaconfs.modify([who](LuaConfigItems& lci) {
         lci.negAnchors.erase(who);
       });
@@ -455,13 +458,16 @@ string doAddTA(T begin, T end)
   }
 
   try {
+    L<<Logger::Warning<<"Adding Trust Anchor for "<<who<<" with data '"<<what<<"', requested via control channel";
     g_luaconfs.modify([who, what](LuaConfigItems& lci) {
       lci.dsAnchors[who] = *std::unique_ptr<DSRecordContent>(dynamic_cast<DSRecordContent*>(DSRecordContent::make(what)));
       });
     broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, who, true));
+    L<<Logger::Warning<<endl;
     return "Added Trust Anchor for " + who.toStringRootDot() + " with data " + what + "\n";
   }
   catch(std::exception &e) {
+    L<<Logger::Warning<<", failed: "<<e.what()<<endl;
     return "Unable to add Trust Anchor for " + who.toStringRootDot() + ": " + e.what() + "\n";
   }
 }
@@ -493,6 +499,7 @@ string doClearTA(T begin, T end)
   string removed("");
   bool first(true);
   for (auto const &who : toRemove) {
+    L<<Logger::Warning<<"Removing Trust Anchor for "<<who<<", requested via control channel"<<endl;
     g_luaconfs.modify([who](LuaConfigItems& lci) {
         lci.dsAnchors.erase(who);
       });