summaryrefslogtreecommitdiff
path: root/source4/dns_server
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2015-10-14 11:59:26 +1300
committerAndrew Bartlett <abartlet@samba.org>2015-10-26 05:11:22 +0100
commitfff09dae6d299a2b45bda44264c98cfde2348880 (patch)
treeff4cbb982227135597641824e4cf14296dfe6f96 /source4/dns_server
parent27039a7b1cfe16f40e07c6179887d2ab4f4967a5 (diff)
downloadsamba-fff09dae6d299a2b45bda44264c98cfde2348880.tar.gz
dns_server: Give WERR_DNS_ERROR_NAME_DOES_NOT_EXIST on empty records
When not looking for tombstones, a record without a dnsRecord value may as well not be present, so just return WERR_DNS_ERROR_NAME_DOES_NOT_EXIST Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/dns_server')
-rw-r--r--source4/dns_server/dnsserver_common.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source4/dns_server/dnsserver_common.c b/source4/dns_server/dnsserver_common.c
index 7199ef721d8..19aa75aafd3 100644
--- a/source4/dns_server/dnsserver_common.c
+++ b/source4/dns_server/dnsserver_common.c
@@ -149,15 +149,15 @@ WERROR dns_common_lookup(struct ldb_context *samdb,
el = ldb_msg_find_element(msg, "dnsRecord");
if (el == NULL) {
TALLOC_FREE(msg);
+ /*
+ * records produced by older Samba releases
+ * keep dnsNode objects without dnsRecord and
+ * without setting dNSTombstoned=TRUE.
+ *
+ * We just pretend they're tombstones.
+ */
if (tombstoned != NULL) {
struct dnsp_DnssrvRpcRecord *recs;
- /*
- * records produced by older Samba releases
- * keep dnsNode objects without dnsRecord and
- * without setting dNSTombstoned=TRUE.
- *
- * We just pretend they're tombstones.
- */
recs = talloc_array(mem_ctx,
struct dnsp_DnssrvRpcRecord,
1);
@@ -179,8 +179,14 @@ WERROR dns_common_lookup(struct ldb_context *samdb,
*records = recs;
*num_records = 1;
return WERR_OK;
+ } else {
+ /*
+ * Because we are not looking for a tombstone
+ * in this codepath, we just pretend it does
+ * not exist at all.
+ */
+ return WERR_DNS_ERROR_NAME_DOES_NOT_EXIST;
}
- return DNS_ERR(NAME_ERROR);
}
werr = dns_common_extract(el, mem_ctx, records, num_records);