From: bert hubert Date: Wed, 12 Jun 2013 17:36:46 +0000 (+0200) Subject: add new test for SRV records pointing at ., fix error within zoneparser that got... X-Git-Tag: rec-3.6.0-rc1~668 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ab6b614771f16ef3f8d0da4ae3d10521aee091a;p=thirdparty%2Fpdns.git add new test for SRV records pointing at ., fix error within zoneparser that got confused by such root records --- diff --git a/pdns/zoneparser-tng.cc b/pdns/zoneparser-tng.cc index f14f60be1f..1a44229b15 100644 --- a/pdns/zoneparser-tng.cc +++ b/pdns/zoneparser-tng.cc @@ -388,7 +388,8 @@ bool ZoneParserTNG::get(DNSResourceRecord& rr) case QType::SRV: stringtok(recparts, rr.content); if(recparts.size()==4) { - recparts[3] = stripDot(toCanonic(d_zonename, recparts[3])); + if(recparts[3]!=".") + recparts[3] = stripDot(toCanonic(d_zonename, recparts[3])); rr.content=recparts[0]+" "+recparts[1]+" "+recparts[2]+" "+recparts[3]; } break; diff --git a/regression-tests/root-srv/command b/regression-tests/root-srv/command new file mode 100755 index 0000000000..d2e4853b5e --- /dev/null +++ b/regression-tests/root-srv/command @@ -0,0 +1,3 @@ +#!/bin/sh +cleandig _root._tcp.dc.test.com SRV + diff --git a/regression-tests/root-srv/description b/regression-tests/root-srv/description new file mode 100644 index 0000000000..9b4180c7ba --- /dev/null +++ b/regression-tests/root-srv/description @@ -0,0 +1 @@ +This test makes sure an SRV record pointing at the root works diff --git a/regression-tests/root-srv/expected_result b/regression-tests/root-srv/expected_result new file mode 100644 index 0000000000..edc2b5a8ae --- /dev/null +++ b/regression-tests/root-srv/expected_result @@ -0,0 +1,3 @@ +0 _root._tcp.dc.test.com. IN SRV 3600 0 0 0 . +Rcode: 0, RD: 0, QR: 1, TC: 0, AA: 1, opcode: 0 +Reply to question for qname='_root._tcp.dc.test.com.', qtype=SRV diff --git a/regression-tests/test.com b/regression-tests/test.com index 2e8cffb99c..1f7f1c63de 100644 --- a/regression-tests/test.com +++ b/regression-tests/test.com @@ -24,6 +24,7 @@ counter IN A 1.1.1.5 _ldap._tcp.dc IN SRV 0 100 389 server2.example.net. _double._tcp.dc IN SRV 0 100 389 server1 _double._tcp.dc IN SRV 1 100 389 server1 +_root._tcp.dc IN SRV 0 0 0 . blah IN NS blah blah IN A 192.168.6.1 ;images IN URL "http://www.ds9a.nl"