summaryrefslogtreecommitdiffstats
path: root/python/samba
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2014-02-27 23:49:24 +0100
committerKai Blin <kai@samba.org>2014-03-04 13:46:34 +0100
commitd9829df13317b38677d92a499134727ab31fbb0e (patch)
tree5e9b59ab6615bdbb14260b742e0618cc22e15912 /python/samba
parent6f092cfd878a16db276238444f41d6218e66d12a (diff)
downloadsamba-d9829df13317b38677d92a499134727ab31fbb0e.tar.gz
samba-d9829df13317b38677d92a499134727ab31fbb0e.tar.xz
samba-d9829df13317b38677d92a499134727ab31fbb0e.zip
bug #10471: Don't respond with NXDOMAIN to records that exist with another type
DNS queries for records with the wrong type need to trigger an empty response with RCODE_OK instead of returning NXDOMAIN. This adds a test and fixes bug #10471 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba')
-rw-r--r--python/samba/tests/dns.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/python/samba/tests/dns.py b/python/samba/tests/dns.py
index 0ac9cf4b8b4..bac8deabddc 100644
--- a/python/samba/tests/dns.py
+++ b/python/samba/tests/dns.py
@@ -171,6 +171,22 @@ class TestSimpleQueries(DNSTest):
self.assertEquals(response.answers[0].rdata,
os.getenv('SERVER_IP'))
+ def test_one_mx_query(self):
+ "create a query packet causing an empty RCODE_OK answer"
+ p = self.make_name_packet(dns.DNS_OPCODE_QUERY)
+ questions = []
+
+ name = "%s.%s" % (os.getenv('SERVER'), self.get_dns_domain())
+ q = self.make_name_question(name, dns.DNS_QTYPE_MX, dns.DNS_QCLASS_IN)
+ print "asking for ", q.name
+ questions.append(q)
+
+ self.finish_name_packet(p, questions)
+ response = self.dns_transaction_udp(p)
+ self.assert_dns_rcode_equals(response, dns.DNS_RCODE_OK)
+ self.assert_dns_opcode_equals(response, dns.DNS_OPCODE_QUERY)
+ self.assertEquals(response.ancount, 0)
+
def test_two_queries(self):
"create a query packet containing two query records"
p = self.make_name_packet(dns.DNS_OPCODE_QUERY)