Changeset 233
- Timestamp:
- 02/14/12 18:01:43 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r232 r233 469 469 if ($args{defrec} eq 'n') { 470 470 # live record; revrec determines whether we validate the PTR or A component first. 471 471 472 if ($args{revrec} eq 'y') { 472 473 ($code,$msg) = _validate_12($dbh, %args); … … 491 492 # Check if the requested reverse zone exists - note, an IP fragment won't 492 493 # work here since we don't *know* which parent to put it in. 494 # ${$args{val}} has been validated as a valid IP by now, in one of the above calls. 493 495 my ($revid) = $dbh->selectrow_array("SELECT rdns_id FROM revzones WHERE revnet >> ?". 494 496 " ORDER BY masklen(revnet) DESC", undef, (${$args{val}})); … … 513 515 } 514 516 515 } else { 516 # defrec eq 'y' 517 } else { # defrec eq 'y' 518 if ($args{revrec} eq 'y') { 519 ($code,$msg) = _validate_12($dbh, %args); 520 return ($code,$msg) if $code eq 'FAIL'; 521 if (${$args{rectype}} == 65280) { 522 return ('FAIL',"A+PTR record must be a valid IPv4 address or fragment") 523 if ${$args{val}} =~ /:/; 524 ${$args{val}} =~ s/^ZONE,/ZONE./; # Clean up after uncertain IP-fragment-type from _validate_12 525 } elsif (${$args{rectype}} == 65281) { 526 return ('FAIL',"AAAA+PTR record must be a valid IPv6 address or fragment") 527 if ${$args{val}} =~ /\./; 528 ${$args{val}} =~ s/^ZONE,/ZONE::/; # Clean up after uncertain IP-fragment-type from _validate_12 529 } 530 } else { 531 # This is easy. I also can't see a real use-case for A/AAAA+PTR in *all* forward 532 # domains, since you wouldn't be able to substitute both domain and reverse zone 533 # sanely, and you'd end up with guaranteed over-replicated PTR records that would 534 # confuse the hell out of pretty much anything that uses them. 535 return ('FAIL', "$typemap{${$args{rectype}}} records not allowed in default domains"); 536 } 517 537 } 518 538
Note:
See TracChangeset
for help on using the changeset viewer.