From 7b5eb60ab0dca6d002c0ef00ee236129307ba4e8 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Fri, 15 Nov 2019 15:29:51 +0100 Subject: [PATCH] auth api: after a db lookup, always finish the get cycle --- pdns/ws-auth.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 3f23ca0156..3fc805135e 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -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"); } } -- 2.47.2