s4:dlz make b9_has_soa check dc=@ node
authorMichael Saxl <mike@mwsys.mine.bz>
Thu, 21 Mar 2019 17:22:38 +0000 (18:22 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 26 Mar 2019 03:03:23 +0000 (03:03 +0000)
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

Signed-off-by: Michael Saxl <mike@mwsys.mine.bz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/knownfail.d/bind9-dlz [deleted file]
source4/dns_server/dlz_bind9.c

diff --git a/selftest/knownfail.d/bind9-dlz b/selftest/knownfail.d/bind9-dlz
deleted file mode 100644 (file)
index 84fc82f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-^samba4.dlz_bind9.configure.configure.*
-^samba4.dlz_bind9.multipleconfigure.multipleconfigure.*
index 070990db3cff6d3951dc40b000d4e6cc730c966d..0e7fcfc2c2556c8b0baaf37a9ff6dce2dd59310f 100644 (file)
@@ -1280,6 +1280,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)) {