Changeset 233


Ignore:
Timestamp:
02/14/12 18:01:43 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Checkpoint - special type validation for 65280 and 65281 should
be complete, but testing is behaving a bit strangely

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r232 r233  
    469469  if ($args{defrec} eq 'n') {
    470470    # live record;  revrec determines whether we validate the PTR or A component first.
     471
    471472    if ($args{revrec} eq 'y') {
    472473      ($code,$msg) = _validate_12($dbh, %args);
     
    491492      # Check if the requested reverse zone exists - note, an IP fragment won't
    492493      # 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.
    493495      my ($revid) = $dbh->selectrow_array("SELECT rdns_id FROM revzones WHERE revnet >> ?".
    494496        " ORDER BY masklen(revnet) DESC", undef, (${$args{val}}));
     
    513515    }
    514516
    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    }
    517537  }
    518538
Note: See TracChangeset for help on using the changeset viewer.