From: Peter van Dijk Date: Fri, 15 Nov 2019 14:29:51 +0000 (+0100) Subject: auth api: after a db lookup, always finish the get cycle X-Git-Tag: auth-4.3.0-alpha1~38^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e8ca30296ab43921782b382ee9f4c00e5bf0ad;p=thirdparty%2Fpdns.git auth api: after a db lookup, always finish the get cycle --- diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 54f4e0b178..de11fdf336 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -2025,6 +2025,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"); } }