[PATCH] s4:dns_server: bind_dlz make b9_has_soa check dc=@ node

mike at mwsys.mine.bz mike at mwsys.mine.bz
Tue Mar 19 14:16:43 UTC 2019


From: Michael Saxl <mike at mwsys.mine.bz>

the zone node does not hold the dnsRecord values, so for the zone level
the node dc=@,dc=zonename has to be queried

regression introduced with 28e2a518ff32, BUG: https://bugzilla.samba.org/show_bug.cgi?id=13466

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13841
---
 source4/dns_server/dlz_bind9.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 82c72111a00..b46dec6cb35 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -1276,6 +1276,17 @@ static bool b9_has_soa(struct dlz_bind9_data *state, struct ldb_dn *dn, const ch
 		return false;
 	}
 
+	/*
+	 * The SOA record is alwas stored under DC=@,DC=zonename
+	 * This can probably be removed when dns_common_lookup makes a fallback
+	 * lookup on @ pseudo record
+	 */
+
+	if (!ldb_dn_add_child_fmt(dn,"DC=@")) {
+		talloc_free(tmp_ctx);
+		return false;
+	}
+
 	werr = dns_common_lookup(state->samdb, tmp_ctx, dn,
 				 &records, &num_records, NULL);
 	if (!W_ERROR_IS_OK(werr)) {
-- 
2.19.1




More information about the samba-technical mailing list