From: Peter van Dijk Date: Wed, 3 Nov 2021 13:00:30 +0000 (+0100) Subject: auth bindbackend: skip rejected zones during list and search, fixes #10885 X-Git-Tag: dnsdist-1.7.0-beta1~15^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10941%2Fhead;p=thirdparty%2Fpdns.git auth bindbackend: skip rejected zones during list and search, fixes #10885 --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index 54d9c612ba..2922798a9e 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -1301,6 +1301,10 @@ bool Bind2Backend::list(const DNSName& target, int id, bool include_disabled) d_handle.reset(); DLOG(g_log << "Bind2Backend constructing handle for list of " << id << endl); + if (!bbd.d_loaded) { + throw PDNSException("zone was not loaded, perhaps because of: " + bbd.d_status); + } + d_handle.d_records = bbd.d_records.get(); // give it a copy, which will stay around d_handle.d_qname_iter = d_handle.d_records->begin(); d_handle.d_qname_end = d_handle.d_records->end(); // iter now points to a vector of pointers to vector @@ -1437,6 +1441,10 @@ bool Bind2Backend::searchRecords(const string& pattern, int maxResults, vector rhandle = h.d_records.get(); for (recordstorage_t::const_iterator ri = rhandle->begin(); result.size() < static_cast::size_type>(maxResults) && ri != rhandle->end(); ri++) {