summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/dns_server/dns_update.c5
-rw-r--r--source4/scripting/python/samba/tests/dns.py12
2 files changed, 17 insertions, 0 deletions
diff --git a/source4/dns_server/dns_update.c b/source4/dns_server/dns_update.c
index a8c49998f7..55589d227a 100644
--- a/source4/dns_server/dns_update.c
+++ b/source4/dns_server/dns_update.c
@@ -142,6 +142,11 @@ WERROR dns_server_process_update(struct dns_server *dns,
zone = &in->questions[0];
+ if (zone->question_class != DNS_QCLASS_IN &&
+ zone->question_class != DNS_QCLASS_ANY) {
+ return DNS_ERR(NOT_IMPLEMENTED);
+ }
+
if (zone->question_type != DNS_QTYPE_SOA) {
return DNS_ERR(FORMAT_ERROR);
}
diff --git a/source4/scripting/python/samba/tests/dns.py b/source4/scripting/python/samba/tests/dns.py
index c95148b70e..60003fcf7a 100644
--- a/source4/scripting/python/samba/tests/dns.py
+++ b/source4/scripting/python/samba/tests/dns.py
@@ -204,6 +204,18 @@ class DNSTest(TestCase):
response = self.dns_transaction_udp(p)
self.assert_dns_rcode_equals(response, dns.DNS_RCODE_FORMERR)
+ def test_update_wrong_qclass(self):
+ "create update with DNS_QCLASS_NONE"
+ p = self.make_name_packet(dns.DNS_OPCODE_UPDATE)
+ updates = []
+
+ name = self.get_dns_domain()
+ u = self.make_name_question(name, dns.DNS_QTYPE_A, dns.DNS_QCLASS_NONE)
+ updates.append(u)
+
+ self.finish_name_packet(p, updates)
+ response = self.dns_transaction_udp(p)
+ self.assert_dns_rcode_equals(response, dns.DNS_RCODE_NOTIMP)
if __name__ == "__main__":
import unittest