- Timestamp:
- 02/09/12 15:29:12 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r230 r231 345 345 # TXT record 346 346 sub _validate_16 { 347 # Could arguably put a WARN return here on very long (>512) records 347 348 return ('OK','OK'); 348 349 } # done TXT record … … 350 351 # RP record 351 352 sub _validate_17 { 353 # Probably have to validate these some day 352 354 return ('OK','OK'); 353 355 } # done RP record … … 377 379 # SRV record 378 380 sub _validate_33 { 381 my $dbh = shift; 382 383 my %args = @_; 384 385 # Not absolutely true but WTF use is an SRV record for a reverse zone? 386 return ('FAIL', 'Reverse zones cannot contain SRV records') if $args{revrec} eq 'y'; 387 388 return ('FAIL', "Distance is required for SRV records") unless defined(${$args{dist}}); 389 ${$args{dist}} =~ s/\s*//g; 390 return ('FAIL',"Distance is required, and must be numeric") unless ${$args{dist}} =~ /^\d+$/; 391 392 return ('FAIL',"SRV records must begin with _service._protocol [${$args{host}}]") 393 unless ${$args{host}} =~ /^_[A-Za-z]+\._[A-Za-z]+\.[a-zA-Z0-9-]+/; 394 return ('FAIL',"Port and weight are required for SRV records") 395 unless defined(${$args{weight}}) && defined(${$args{port}}); 396 ${$args{weight}} =~ s/\s*//g; 397 ${$args{port}} =~ s/\s*//g; 398 399 return ('FAIL',"Port and weight are required, and must be numeric") 400 unless ${$args{weight}} =~ /^\d+$/ && ${$args{port}} =~ /^\d+$/; 401 402 ${$args{fields}} = "distance,weight,port,"; 403 push @{$args{vallist}}, (${$args{dist}}, ${$args{weight}}, ${$args{port}}); 404 405 # Coerce all hostnames to end in ".DOMAIN" for group/default records, 406 # or the intended parent domain for live records. 407 my $pname = ($args{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$args{id})); 408 ${$args{host}} =~ s/\.*$/\.$pname/ if ${$args{host}} !~ /$pname$/; 409 379 410 return ('OK','OK'); 380 411 } # done SRV record
Note:
See TracChangeset
for help on using the changeset viewer.