From a2e700d44d71aadb095d972e6da668fe79075abd Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 16 Oct 2017 12:31:38 +0200 Subject: [PATCH] Reuse UeberBackend in DNSSECKeeper::rectifyZone() But use a full UeberBackend when needed. --- pdns/dbdnsseckeeper.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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; } -- 2.40.0