From a76210a17cae7ff7d261228b325cd308d4e424ef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9gory=20Oestreicher?= Date: Fri, 13 Oct 2017 23:34:05 +0200 Subject: [PATCH] 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. --- modules/ldapbackend/ldapbackend.cc | 11 +++++++++++ modules/ldapbackend/ldapbackend.hh | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/modules/ldapbackend/ldapbackend.cc b/modules/ldapbackend/ldapbackend.cc index 9a5441844..1a4374f5a 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 5ccbb086f..6ae55d9f0 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; -- 2.40.0