summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2021-03-31 14:23:36 +1300
committerAndrew Bartlett <abartlet@samba.org>2021-07-05 04:16:34 +0000
commit6f9564425f4b6796034c8db7974e70e33df054dc (patch)
treeef20581b52d9099b567a522b230b3c684316c5c0
parent1741a0667bb0a282ec51d57e130aa128aa750d1a (diff)
downloadsamba-6f9564425f4b6796034c8db7974e70e33df054dc.tar.gz
dns update: emit warnings upon unexpected occurrances
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source4/dns_server/dns_update.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/source4/dns_server/dns_update.c b/source4/dns_server/dns_update.c
index 10dfb1160d6..4ec55d471de 100644
--- a/source4/dns_server/dns_update.c
+++ b/source4/dns_server/dns_update.c
@@ -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,
};