[Pdns-users] bind 9 zone to gmysql conversion problems (cont.)

Imre Gergely imre.gergely at astral.ro
Mon Mar 13 06:54:18 UTC 2006


i found another problem in this conversion tool, sorry if it was already reported.
if i try to convert a zone, in which the "IN"s are written with mixed case (ie
iN, In), it gives an error. when it's "in" (with all lowercase), it's ok. i
looked in the sources of the tool, and there are some string comparations:

bool ZoneParser::isClass(const string &s)
{
  return (s.size()==2 && (s=="IN" || s=="CH" || s=="HS" || s=="in" || s=="ch"
|| s=="hs"));
}

wouldn't it be better with first converting to all uppercase and doing compare
only on that one?
sorry if this belongs to pdns-devel. i didn't know where to send it.


[root at imi etc]# named-checkzone 1.1.1.in-addr.arpa test.rev
zone 1.1.1.in-addr.arpa/IN: loaded serial 2006011201
OK
named-checkzone 1.1.1.in-addr.arpa test.rev


[root at imi etc]# zone2sql --gmysql --zone=test.rev --verbose=no --slave=yes
--on-error-resume-next=no
Second SOA in zone, raised domain_id
insert into domains (name,type) values ('1.1.1.in-addr.arpa','NATIVE');

Fatal error: Unknown qtype 'In' on line 11 of file 'test.rev' <-------- !!!
insert into records (domain_id, name,type,content,ttl,prio) select id
,'1.1.1.in-addr.arpa', 'SOA', 'ns1.hr.astral.ro hostmaster.hr.astral.ro
2006011201 3600 900 1209600 86400', 7200, 0 from domains where
name='1.1.1.in-addr.arpa';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'1.1.1.in-addr.arpa', 'NS', 'ns1.hr.astral.ro', 7200, 0 from domains where
name='1.1.1.in-addr.arpa';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'1.1.1.in-addr.arpa', 'NS', 'ns2.hr.astral.ro', 7200, 0 from domains where
name='1.1.1.in-addr.arpa';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'18.1.1.1.in-addr.arpa', 'PTR', 'jucus.nextra.ro', 7200, 0 from domains where
name='1.1.1.in-addr.arpa';



[root at imi etc]# cat test.rev
$TTL 7200
$ORIGIN 1.1.in-addr.arpa.
1               IN      SOA     ns1.hr.astral.ro. hostmaster.hr.astral.ro. (
                2006011201 3600 900 1209600 86400 )
                IN      NS      ns1.hr.astral.ro.
                IN      NS      ns2.hr.astral.ro.

$TTL 7200
$ORIGIN 1.1.1.in-addr.arpa.
18              IN      PTR     jucus.nextra.ro.
19              In      PTR     aaa.nextra.ro.
                IN      TXT     "X-IPsec-Server10=1.1.1.1 foo foo"


-- 
Imre Gergely
SysAdmin NOCS-CJ
Astral Telecom S.A.
Plugarilor 28, Cluj-Napoca
http://www.astral.ro


More information about the Pdns-users mailing list