From: Grégory Oestreicher Date: Fri, 13 Oct 2017 21:34:05 +0000 (+0200) Subject: Add support for ENT X-Git-Tag: dnsdist-1.3.1~167^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a76210a17cae7ff7d261228b325cd308d4e424ef;p=thirdparty%2Fpdns.git Add support for ENT This actually requires that the layout under the zone entry follows a tree model. ENTs are entries for which no record could be found. --- diff --git a/modules/ldapbackend/ldapbackend.cc b/modules/ldapbackend/ldapbackend.cc index 9a5441844d..1a4374f5ad 100644 --- a/modules/ldapbackend/ldapbackend.cc +++ b/modules/ldapbackend/ldapbackend.cc @@ -257,6 +257,17 @@ void LdapBackend::extract_entry_results( const DNSName& domain, const DNSResult& } } } + + if ( !has_records ) { + // This is an ENT + DNSResult local_result = result_template; + local_result.qname = domain; + if ( !d_result.count( "PdnsRecordOrdername" ) || d_result["PdnsRecordOrdername"].empty() ) { + // An ENT with an order name is authoritative + local_result.auth = false; + } + d_results_cache.push_back( local_result ); + } } diff --git a/modules/ldapbackend/ldapbackend.hh b/modules/ldapbackend/ldapbackend.hh index 5ccbb086f1..6ae55d9f09 100644 --- a/modules/ldapbackend/ldapbackend.hh +++ b/modules/ldapbackend/ldapbackend.hh @@ -129,6 +129,11 @@ class LdapBackend : public DNSBackend std::string value; bool auth; std::string ordername; + + DNSResult() + : ttl( 0 ), lastmod( 0 ), value( "" ), auth( true ), ordername( "" ) + { + } }; std::list d_results_cache;