Changeset 360
- Timestamp:
- 07/09/12 17:51:58 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tiny-import.pl
r359 r360 125 125 my $nodefer = shift || 0; 126 126 127 $errstr = $rec; # this way at least we have some idea what went <splat> 128 127 129 if ($rec =~ /^=/) { 128 130 $cnt{APTR}++; … … 155 157 $host =~ s/^C//; 156 158 $host =~ s/\.$//; 159 $host =~ s/^\\052/*/; 157 160 $ttl = 0 if !$ttl; 158 161 $stamp = '' if !$stamp; … … 249 252 $host =~ s/^\+//; 250 253 $host =~ s/\.$//; 254 $host =~ s/^\\052/*/; 251 255 $ttl = 0 if !$ttl; 252 256 $stamp = '' if !$stamp; … … 290 294 $zone =~ s/^\@//; 291 295 $zone =~ s/\.$//; 296 $zone =~ s/^\\052/*/; 292 297 $host =~ s/\.$//; 293 298 $host = "$host.mx.$zone" if $host !~ /\./; … … 314 319 my ($fqdn, $rdata, $ttl, $stamp, $loc) = split /:/, $rec, 5; 315 320 $fqdn =~ s/^'//; 321 $fqdn =~ s/^\\052/*/; 316 322 _deoctal(\$rdata); 317 323 $ttl = 0 if !$ttl; … … 320 326 $loc = '' if $loc =~ /^:+$/; 321 327 322 my $domid = DNSDB::_hostparent($dbh, $fqdn); 323 if ($domid) { 324 $recsth->execute($domid, 0, $fqdn, 16, $rdata, 0, 0, 0, $ttl); 325 } else { 326 push @deferred, $rec unless $nodefer; 328 if ($fqdn =~ /\.arpa$/) { 329 ($code,$msg) = DNSDB::_zone2cidr($fqdn); 330 my ($rparent) = $dbh->selectrow_array("SELECT rdns_id FROM revzones WHERE revnet >> ?", undef, ($msg)); 331 $recsth->execute(0, $rparent, $rdata, 16, "$msg", 0, 0, 0, $ttl); 332 } else { 333 my $domid = DNSDB::_hostparent($dbh, $fqdn); 334 if ($domid) { 335 $recsth->execute($domid, 0, $fqdn, 16, $rdata, 0, 0, 0, $ttl); 336 } else { 337 push @deferred, $rec unless $nodefer; 338 } 327 339 } 328 340 … … 383 395 384 396 my (undef, $fqdn, $type, $rdata, $ttl, $stamp, $loc) = split /:/, $rec, 7; 397 $fqdn =~ s/\.$//; 398 $fqdn =~ s/^\\052/*/; 385 399 $ttl = 0 if !$ttl; 386 400 $stamp = '' if !$stamp; … … 430 444 my $val = NetAddr::IP->new(join(':', @v6)); 431 445 432 my ($rdns) = $dbh->selectrow_array("SELECT rdns_id FROM revzones WHERE revnet >> ?", undef, ("$val"));433 if ($ rdns) {434 $recsth->execute( 0, $rdns, $fqdn, 28, $val->addr, 0, 0, 0, $ttl);446 my $fparent = DNSDB::_hostparent($dbh, $fqdn); 447 if ($fparent) { 448 $recsth->execute($fparent, 0, $fqdn, 28, $val->addr, 0, 0, 0, $ttl); 435 449 } else { 436 450 push @deferred, $rec unless $nodefer;
Note:
See TracChangeset
for help on using the changeset viewer.