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

dns update: emit warnings upon unexpected occurrances

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall
2021-03-31 14:23:36 +13:00
committed by Andrew Bartlett
parent 1741a0667b
commit 6f9564425f

View File

@ -431,8 +431,18 @@ static WERROR handle_one_update(struct dns_server *dns,
if (tombstoned) {
/*
* we need to keep the existing tombstone record
* and ignore it
* and ignore it.
*
* There *should* only be a single record of type TOMBSTONE,
* but we don't insist.
*/
if (rcount != 1) {
DBG_WARNING("Tombstoned dnsNode has %u records, "
"expected 1\n", rcount);
if (DEBUGLVL(1)) {
NDR_PRINT_DEBUG(dns_res_rec, discard_const(update));
}
}
first = rcount;
}
@ -519,11 +529,20 @@ static WERROR handle_one_update(struct dns_server *dns,
mem_ctx, update, &recs[i], name_is_static);
W_ERROR_NOT_OK_RETURN(werror);
/*
* There should only be one SOA, which we have already
* found and replaced. We now check for and tombstone
* any others.
*/
for (i++; i < rcount; i++) {
if (recs[i].wType != DNS_TYPE_SOA) {
continue;
}
DBG_ERR("Duplicate SOA records found.\n");
if (DEBUGLVL(0)) {
NDR_PRINT_DEBUG(dns_res_rec,
discard_const(update));
}
recs[i] = (struct dnsp_DnssrvRpcRecord) {
.wType = DNS_TYPE_TOMBSTONE,
};