]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add support for ENT
authorGrégory Oestreicher <greg@kamago.net>
Fri, 13 Oct 2017 21:34:05 +0000 (23:34 +0200)
committerGrégory Oestreicher <greg@kamago.net>
Tue, 10 Apr 2018 20:41:26 +0000 (22:41 +0200)
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
modules/ldapbackend/ldapbackend.hh

index 9a5441844d818ceb531fb80dbec1bcf8ebf8db40..1a4374f5ad122c66a64d39b4124367cb000fdade 100644 (file)
@@ -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 );
+  }
 }
 
 
index 5ccbb086f146719683cd9e5370d877d0130cb9d7..6ae55d9f09c373edef252348c31561b2cc22781d 100644 (file)
@@ -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<DNSResult> d_results_cache;