Changeset 623
- Timestamp:
- 04/29/14 16:16:33 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r622 r623 834 834 my %args = @_; 835 835 836 if ($args{revrec} eq ' y') {836 if ($args{revrec} eq 'n') { 837 837 # Coerce all hostnames to end in ".DOMAIN" for group/default records, 838 838 # or the intended parent domain for live records. 839 839 my $pname = ($args{defrec} eq 'y' ? 'DOMAIN' : $self->domainName($args{id})); 840 840 ${$args{host}} =~ s/\.*$/\.$pname/ if ${$args{host}} !~ /$pname$/; 841 return ('FAIL', $errstr) if ! _check_hostname_form(${$args{host}}, ${$args{rectype}}, $args{defrec}, $args{revrec}); 842 } else { 843 # We don't coerce reverse "hostnames" into the zone, mainly because we store most sane 844 # records as IP values, not .arpa names. 845 if ($args{defrec} eq 'n') { 846 # Get the revzone, so we can see if ${$args{val}} is in that zone 847 my $revzone = new NetAddr::IP $self->revName($args{id}, 'y'); 848 return ('FAIL', $errstr) if !$self->_inrev($args{val}, $revzone); 849 } 850 851 ##enhance or ##fixme 852 # convert well-formed .arpa names to IP addresses to match old "strict" validation design 853 return ('FAIL', $errstr) if ! _check_hostname_form(${$args{val}}, ${$args{rectype}}, $args{defrec}, $args{revrec}) && 854 ${$args{val}} =~ /\.arpa$/; 841 855 } 842 856 … … 847 861 # RP record 848 862 sub _validate_17 { 849 # Probably have to validate these some day 850 return ('OK','OK'); 863 # Probably have to validate these separately some day. Call _validate_16() above since 864 # they're otherwise very similar 865 return _validate_16(@_); 851 866 } # done RP record 852 867
Note:
See TracChangeset
for help on using the changeset viewer.