]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth api: after a db lookup, always finish the get cycle 8568/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 15 Nov 2019 14:29:51 +0000 (15:29 +0100)
committermind04 <mind04@monshouwer.org>
Thu, 21 Nov 2019 23:10:49 +0000 (00:10 +0100)
pdns/ws-auth.cc

index 3f23ca0156f0d8923731abca2d15742c108f8bca..3fc805135e782a85371a39cf2481a65e958e32cf 100644 (file)
@@ -2036,6 +2036,11 @@ static void patchZone(UeberBackend& B, HttpRequest* req, HttpResponse* resp) {
             if (qtype.getCode() != rr.qtype.getCode()
               && (exclusiveEntryTypes.count(qtype.getCode()) != 0
                 || exclusiveEntryTypes.count(rr.qtype.getCode()) != 0)) {
+
+              // leave database handle in a consistent state
+              while (di.backend->get(rr))
+                ;
+
               throw ApiException("RRset "+qname.toString()+" IN "+qtype.getName()+": Conflicts with pre-existing RRset");
             }
           }