s4-rpc: dnsserver: return DNS_RANK_NS_GLUE recors when explicitly asked for
authorStefan Metzmacher <metze@samba.org>
Thu, 4 Sep 2014 07:40:34 +0000 (09:40 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 4 Sep 2014 09:06:47 +0000 (11:06 +0200)
NS records should be included in the query for sub-domains.  NS records
got dropped when the rank for NS records was correctly set to NS_GLUE
from ZONE in commit 2036cbd9249c84d9b46370f0e8cd6a0264c737ba.

  samba-tool dns query 172.31.9.161 s4xdom.base @ ALL
  =>
  Name=glue, Records=0, Children=0

  samba-tool dns query 172.31.9.161 s4xdom.base glue ALL
  =>
    Name=, Records=1, Children=0
      NS: glue.dns.private. (flags=40000082, serial=21, ttl=900)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10751

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
source4/rpc_server/dnsserver/dnsdata.c

index 4866006cdf9492a7553c0820d68cfce58b93436b..f752490101a0663f18c7f1bea6aaaa5d35f0af17 100644 (file)
@@ -798,6 +798,15 @@ WERROR dns_fill_records_array(TALLOC_CTX *mem_ctx,
                        if (select_flag & DNS_RPC_VIEW_AUTHORITY_DATA) {
                                if (dnsp_rec.rank == DNS_RANK_ZONE) {
                                        found = true;
+                               } else if (dnsp_rec.rank == DNS_RANK_NS_GLUE) {
+                                       /*
+                                        * If branch_name is NULL, we're
+                                        * explicitly asked to also return
+                                        * DNS_RANK_NS_GLUE records
+                                        */
+                                       if (branch_name == NULL) {
+                                               found = true;
+                                       }
                                }
                        }
                        if (select_flag & DNS_RPC_VIEW_CACHE_DATA) {