Changeset 809
- Timestamp:
- 11/24/20 17:11:26 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bind-import
r808 r809 33 33 my $zid; 34 34 35 if ($zname =~ /\.arpa $/ || $zname =~ m,^[\d./]+$,) {35 if ($zname =~ /\.arpa\.?$/ || $zname =~ m,^[\d./]+$,) { 36 36 $rev = 'y'; 37 $zname = _zone2cidr($zname) if $zname =~ /\.arpa $/;37 $zname = _zone2cidr($zname) if $zname =~ /\.arpa\.?$/; 38 38 $zid = $dnsdb->revID($zname,':ANY:'); 39 if ($zid) { 40 $zname = new NetAddr::IP $zname; 41 $zname = DNSDB::_ZONE($zname, 'ZONE', 'r', '.').($zname->{isv6} ? '.ip6.arpa' : '.in-addr.arpa'); 42 } 39 43 } else { 40 44 $zid = $dnsdb->domainID($zname,':ANY:'); … … 50 54 next if /^\s*;/; 51 55 my ($name) = /([\w_.-]+)\s/; 56 # append zone name to record name if missing AND not dot-terminated; 57 # this happens automagically for forward zones, but not reverse because Reasons. (fixme?) 58 # suck up and deal with the error if the dot-termiated name is out of zone; should be 59 # impossible with valid BIND zone file but... 60 $name .= ".$zname" if $name !~ /$zname$/ && $zname !~ /\.$/; 52 61 s/([\w_.-]+)\s+//; 53 62 my ($class) = /(IN|CS|CH|HS)\s/; … … 90 99 #;imap IN 900 CNAME deepnet.cx. 91 100 ##fixme: not sure how to handle the case where someone leaves off the class. 92 my ($code,$msg) = $dnsdb->addRec('n', $rev, $zid, \$name, \$itype, \$rdata, $ttl); 101 my ($code, $msg); 102 if ($rev eq 'n') { 103 ($code,$msg) = $dnsdb->addRec('n', $rev, $zid, \$name, \$itype, \$rdata, $ttl); 104 } else { 105 ($code,$msg) = $dnsdb->addRec('n', $rev, $zid, \$rdata, \$itype, \$name, $ttl); 106 } 93 107 print "$code: $msg\n"; 94 108 }
Note:
See TracChangeset
for help on using the changeset viewer.