- Timestamp:
- 05/14/14 17:15:16 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r631 r632 627 627 my $revzone = new NetAddr::IP $self->revName($args{id}, 'y'); 628 628 return ('FAIL', $errstr) if !$self->_inrev($args{val}, $revzone); 629 # CNAMEs can not be used for parent nodes; just leaf nodes with no other record types 630 # note that this WILL probably miss some edge cases. 631 if (${$args{val}} =~ /^[\d.\/]+$/) { 632 # convert IP "hostname" to .arpa 633 my $tmphn = _ZONE(NetAddr::IP->new(${$args{val}}), 'ZONE', 'r', '.'); 634 my $tmpz = _ZONE($revzone, 'ZONE', 'r', '.'); 635 return ('FAIL', "The bare zone may not be a CNAME") if $tmphn eq $tmpz; 636 } 629 637 } 630 638 … … 644 652 my $pname = ($args{defrec} eq 'y' ? 'DOMAIN' : $self->domainName($args{id})); 645 653 ${$args{host}} =~ s/\.*$/\.$pname/ if ${$args{host}} !~ /$pname$/; 654 655 # CNAMEs can not be used for parent nodes; just leaf nodes with no other record types 656 # Enforce this for the zone name 657 return ('FAIL', "The bare zone name may not be a CNAME") if ${$args{host}} eq $pname; 646 658 647 659 ##enhance: Look up the passed value to see if it exists. Ooo, fancy.
Note:
See TracChangeset
for help on using the changeset viewer.