From: Pieter Lexis Date: Mon, 16 Oct 2017 10:31:38 +0000 (+0200) Subject: Reuse UeberBackend in DNSSECKeeper::rectifyZone() X-Git-Tag: rec-4.1.0-rc2~36^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2e700d44d71aadb095d972e6da668fe79075abd;p=pdns Reuse UeberBackend in DNSSECKeeper::rectifyZone() But use a full UeberBackend when needed. --- diff --git a/pdns/dbdnsseckeeper.cc b/pdns/dbdnsseckeeper.cc index 76088ba8a..fe7570e8b 100644 --- a/pdns/dbdnsseckeeper.cc +++ b/pdns/dbdnsseckeeper.cc @@ -593,10 +593,19 @@ bool DNSSECKeeper::rectifyZone(const DNSName& zone, string& error) { return false; } - UeberBackend B("default"); + UeberBackend* B = d_keymetadb; + std::unique_ptr b; + + if (d_ourDB) { + // We don't have a *full* Ueberbackend, just a key-only one. + // Let's create one and use it + b = std::unique_ptr(new UeberBackend()); + B = b.get(); + } + SOAData sd; - if(!B.getSOAUncached(zone, sd)) { + if(!B->getSOAUncached(zone, sd)) { error = "No SOA known for '" + zone.toLogString() + "', is such a zone in the database?"; return false; }