summaryrefslogtreecommitdiff
path: root/source4/dns_server
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2021-06-18 15:31:42 +1200
committerAndrew Bartlett <abartlet@samba.org>2021-07-05 04:16:34 +0000
commit54b9271eb5e90c214c7009778ab22d60f9ee88eb (patch)
tree00adc25665c3fb2747acd36afd9f5fa05d22a3c1 /source4/dns_server
parent26bb958af80199eda54e84d6ae427385d1843052 (diff)
downloadsamba-54b9271eb5e90c214c7009778ab22d60f9ee88eb.tar.gz
s4/dns_common_replace: add comments about tombstones
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dns_server')
-rw-r--r--source4/dns_server/dnsserver_common.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source4/dns_server/dnsserver_common.c b/source4/dns_server/dnsserver_common.c
index ef582a471c8..5c5ec1f9ebd 100644
--- a/source4/dns_server/dnsserver_common.c
+++ b/source4/dns_server/dnsserver_common.c
@@ -1012,6 +1012,25 @@ WERROR dns_common_replace(struct ldb_context *samdb,
enum ndr_err_code ndr_err;
if (records[i].wType == DNS_TYPE_TOMBSTONE) {
+ /*
+ * There are two things that could be going on here.
+ *
+ * 1. We use a tombstone with EntombedTime == 0 for
+ * passing deletion messages through the stack, and
+ * this is the place we filter them out to perform
+ * that deletion.
+ *
+ * 2. This node is tombstoned, with no records except
+ * for a single tombstone, and it is just waiting to
+ * disappear. In this case, unless the caller has
+ * added a record, rec_count should be 1, and
+ * el->num_values will end up at 0, and we will make
+ * no changes. But if the caller has added a record,
+ * we need to un-tombstone the node.
+ *
+ * It is not possible to add an explicit tombstone
+ * record.
+ */
if (records[i].data.EntombedTime != 0) {
was_tombstoned = true;
}
@@ -1065,6 +1084,10 @@ WERROR dns_common_replace(struct ldb_context *samdb,
}
if (el->num_values == 0) {
+ /*
+ * We get here if there are no records or all the records were
+ * tombstones.
+ */
struct dnsp_DnssrvRpcRecord tbs;
struct ldb_val *v = &el->values[el->num_values];
enum ndr_err_code ndr_err;