]> granicus.if.org Git - pdns/commitdiff
Fix hang when PATCHing zone during rectify
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 17 Nov 2017 12:20:52 +0000 (13:20 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 17 Nov 2017 12:20:52 +0000 (13:20 +0100)
Before, we would spawn a new UeberBackend in the DNSSECKeeper, but there
was already a transaction going on, so the rectify would never finish,
as rectifyZone would not return.

pdns/dbdnsseckeeper.cc
pdns/ws-auth.cc

index aca1b38d38a15669740a96ad27933190d2b8ded8..d006bac02a87d647548ad2f7b6128682ceef3317 100644 (file)
@@ -626,6 +626,10 @@ bool DNSSECKeeper::rectifyZone(const DNSName& zone, string& error, string& info,
   std::unique_ptr<UeberBackend> b;
 
   if (d_ourDB) {
+    if (!doTransaction) {
+      error = "Can not rectify a zone with a new Ueberbackend inside a transaction.";
+      return false;
+    }
     // We don't have a *full* Ueberbackend, just a key-only one.
     // Let's create one and use it
     b = std::unique_ptr<UeberBackend>(new UeberBackend());
index 460952f6cfad6152425371390503a86e80acd547..d2d587afec1e7f1f9694dcf4a4f04bf9090310fc 100644 (file)
@@ -1709,7 +1709,7 @@ static void patchZone(HttpRequest* req, HttpResponse* resp) {
     throw;
   }
 
-  DNSSECKeeper dk;
+  DNSSECKeeper dk(&B);
   string api_rectify;
   di.backend->getDomainMetadataOne(zonename, "API-RECTIFY", api_rectify);
   if (dk.isSecuredZone(zonename) && !dk.isPresigned(zonename) && api_rectify == "1") {