1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

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>
This commit is contained in:
Andrew Bartlett 2015-10-14 11:59:26 +13:00
parent 27039a7b1c
commit fff09dae6d

View File

@ -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);