- Timestamp:
- 01/16/13 16:43:19 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns-rpc.cgi
r453 r454 443 443 my $zone = new NetAddr::IP $zonelist->[0]->{revnet}; 444 444 if ($zone->contains($args{cidr})) { 445 # We need to strip the CIDR mask on IPv4 /32 assignments, or we just add a new record all the time. 446 my $filt = ($args{cidr}->{isv6} || $args{cidr}->masklen != 32 ? "$args{cidr}" : $args{cidr}->addr); 445 447 my $reclist = DNSDB::getDomRecs($dbh, defrec => 'n', revrec => 'y', 446 id => $zonelist->[0]->{rdns_id}, filter => "$args{cidr}");448 id => $zonelist->[0]->{rdns_id}, filter => $filt); 447 449 if (scalar(@$reclist) == 0) { 448 450 # Aren't Magic Numbers Fun? See pseudotype list in dnsadmin. … … 452 454 } else { 453 455 foreach my $rec (@$reclist) { 454 next unless $rec->{type} == 65282 || $rec->{type} == 65283 || $rec->{type} == 65284; 456 # pure PTR plus composite types 457 next unless $rec->{type} == 12 || $rec->{type} == 65280 || $rec->{type} == 65281 458 || $rec->{type} == 65282 || $rec->{type} == 65283 || $rec->{type} == 65284; 459 next unless $rec->{val} eq $filt; # make sure we really update the record we want to update. 455 460 updateRec(defrec =>'n', revrec => 'y', id => $rec->{record_id}, 456 461 parent_id => $zonelist->[0]->{rdns_id}, %args); … … 473 478 } else { 474 479 foreach my $rec (@$reclist) { 480 # only the composite and/or template types; pure PTR or nontemplate composite 481 # types are nominally impossible here. 475 482 next unless $rec->{type} == 65282 || $rec->{type} == 65283 || $rec->{type} == 65284; 476 483 updateRec(defrec =>'n', revrec => 'y', id => $rec->{record_id},
Note:
See TracChangeset
for help on using the changeset viewer.