Changeset 938 for branches/cname-collision
- Timestamp:
- 12/11/25 16:08:08 (24 hours ago)
- File:
-
- 1 edited
-
branches/cname-collision/DNSDB.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cname-collision/DNSDB.pm
r937 r938 614 614 # Check for name collisions relating to CNAMEs. Needs to be called from all other validators. 615 615 sub _cname_collision { 616 #my $self = shift;617 #my $dbh = $self->{dbh};618 # 619 #my %args = @_;620 my ($hcheck,$defrec,$revrec) = @_;621 622 #my $hcheck = ($args{revrec} eq 'y' ? ${$args{val}} : ${$args{host}});616 my $self = shift; 617 my $dbh = $self->{dbh}; 618 619 my %args = @_; 620 #my ($hcheck,$rectype,$zid,$defrec,$revrec) = @_; 621 622 my $hcheck = ($args{revrec} eq 'y' ? ${$args{val}} : ${$args{host}}); 623 623 my $hfield = ($args{revrec} eq 'y' ? 'val' : 'host'); 624 624 #my $hcheck = $hname; … … 626 626 # $hcheck should be normalized by the time this sub is called. Convert to the formal .arpa name for error reporting in reverse zones. 627 627 my $arpaname = ''; 628 if ($ revreceq 'y') {628 if ($args{revrec} eq 'y') { 629 629 $arpaname = NetAddr::IP->new($hcheck); 630 630 ##fixme: more voodoo if global and/or per-user ARPA display mode flag set this way or that … … 641 641 undef, $args{id}, $hcheck); 642 642 if ($t[0] > 0) { 643 $errstr = "One or more non-CNAME records already exist for ".($ revreceq 'y' ? $arpaname : $hcheck).643 $errstr = "One or more non-CNAME records already exist for ".($args{revrec} eq 'y' ? $arpaname : $hcheck). 644 644 ". CNAME records cannot use the same name as other records."; 645 645 return; … … 652 652 undef, $args{id}, $hcheck); 653 653 if ($t[0] > 1) { 654 $errstr = "There is already a CNAME present for ".($ revreceq 'y' ? $arpaname : $hcheck).654 $errstr = "There is already a CNAME present for ".($args{revrec} eq 'y' ? $arpaname : $hcheck). 655 655 ". Only one CNAME may be present for a given name."; 656 656 return; … … 739 739 return ('FAIL',"A record must be a valid IPv4 address") 740 740 unless $args{addr} && !$args{addr}->{isv6}; 741 742 return ('FAIL', $errstr) unless $self->_cname_collision(%args); 743 741 744 # coerce IP/value to normalized form for storage 742 745 ${$args{val}} = $args{addr}->addr;
Note:
See TracChangeset
for help on using the changeset viewer.
![[ DNS Administrator ]](/fx/dnsadmin-logo.png)