s4-dnsserver: Check for too many DNS results
authorAndrew Bartlett <abartlet@samba.org>
Tue, 29 Aug 2017 02:19:22 +0000 (14:19 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 20 Sep 2017 06:15:21 +0000 (08:15 +0200)
If we had this check in when the wildcard DNS tests were written, we would have
noticed that the name needed to be escaped (see previous commit).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12994
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
source4/rpc_server/dnsserver/dnsdb.c

index 15fe5657d3ac33af6ef9438ebc90cdf2c29765e6..81a2d2070a03b963e23677ce6176720deb13ce98 100644 (file)
@@ -657,6 +657,9 @@ WERROR dnsserver_db_delete_record(TALLOC_CTX *mem_ctx,
        if (res->count == 0) {
                return WERR_DNS_ERROR_RECORD_DOES_NOT_EXIST;
        }
+       if (res->count > 1) {
+               return WERR_DNS_ERROR_RCODE_SERVER_FAILURE;
+       }
 
        el = ldb_msg_find_element(res->msgs[0], "dnsRecord");
        if (el == NULL || el->num_values == 0) {