diff options
-rw-r--r-- | source4/rpc_server/dnsserver/dnsdata.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/rpc_server/dnsserver/dnsdata.c b/source4/rpc_server/dnsserver/dnsdata.c index 535996036d..b2ab2d9ff5 100644 --- a/source4/rpc_server/dnsserver/dnsdata.c +++ b/source4/rpc_server/dnsserver/dnsdata.c @@ -617,6 +617,11 @@ struct dns_tree *dns_build_tree(TALLOC_CTX *mem_ctx, const char *name, struct ld goto failed; } + /* If the node is on leaf, then add record data */ + if (match_count+1 == ncount) { + tree->data = res->msgs[i]; + } + /* Add missing name components */ for (level=match_count+1; level<ncount; level++) { if (tree->level == rootcount+1) { @@ -754,6 +759,11 @@ WERROR dns_fill_records_array(TALLOC_CTX *mem_ctx, return WERR_OK; } + /* Do not return RR records, if the node has children */ + if (branch_name != NULL && num_children > 0) { + return WERR_OK; + } + ptr = ldb_msg_find_attr_as_string(msg, "name", NULL); el = ldb_msg_find_element(msg, "dnsRecord"); if (el == NULL || el->values == 0) { |