Ignore:
Timestamp:
01/09/26 12:05:07 (3 weeks ago)
Author:
Kris Deugau
Message:

/branches/cname-collision

Revise/tighten normalization for $stamp and $expires in addRec() and
updateRec() so that they can be passed to the validators, so that CNAME
collision checking can account for record expiry/valid-after.
See #72

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/cname-collision/DNSDB.pm

    r970 r973  
    48694869
    48704870  my $expires = shift || '';
    4871   $expires = 1 if $expires eq 'until';  # Turn some special values into the appropriate booleans.
    4872   $expires = 0 if $expires eq 'after';
     4871  $expires = 't' if $expires eq 'until';        # Turn some special values into the appropriate booleans.
     4872  $expires = 'f' if $expires eq 'after';
     4873  $expires = 't' if $expires eq '1';
     4874  $expires = 'f' if $expires eq '0';
    48734875  my $stamp = shift;
    48744876  $stamp = '' if !$stamp;        # Timestamp should be a string at this point.
     
    48804882  return ('FAIL', "expires must be 1, 't', or 'until',  or 0, 'f', or 'after'")
    48814883        if ($stamp && !defined($expires))
    4882         || ($stamp && $expires ne '0' && $expires ne '1' && $expires ne 't' && $expires ne 'f');
     4884        || ($stamp && $expires ne 't' && $expires ne 'f');
    48834885
    48844886  # Spaces are evil.
     
    49204922        host => $host, rectype => $rectype, val => $val, addr => $addr,
    49214923        dist => \$dist, port => \$port, weight => \$weight,
     4924        stamp => \$stamp, expires => $expires,
    49224925        fields => \$fields, vallist => \@vallist);
    49234926
     
    50305033
    50315034  my $expires = shift || '';
    5032   $expires = 1 if $expires eq 'until';  # Turn some special values into the appropriate booleans.
    5033   $expires = 0 if $expires eq 'after';
     5035  $expires = 't' if $expires eq 'until';        # Turn some special values into the appropriate booleans.
     5036  $expires = 'f' if $expires eq 'after';
     5037  $expires = 't' if $expires eq '1';
     5038  $expires = 'f' if $expires eq '0';
    50345039  my $stamp = shift;
    50355040  $stamp = '' if !$stamp;        # Timestamp should be a string at this point.
     
    50405045  return ('FAIL', "expires must be 1, 't', or 'until',  or 0, 'f', or 'after'")
    50415046        if ($stamp && !defined($expires))
    5042         || ($stamp && $expires ne '0' && $expires ne '1' && $expires ne 't' && $expires ne 'f');
     5047        || ($stamp && $expires ne 't' && $expires ne 'f');
    50435048
    50445049  # Spaces are evil.
     
    50865091        host => $host, rectype => $rectype, val => $val, addr => $addr,
    50875092        dist => \$dist, port => \$port, weight => \$weight,
     5093        stamp => \$stamp, expires => $expires,
    50885094        fields => \$fields, vallist => \@vallist,
    50895095        update => $id);
Note: See TracChangeset for help on using the changeset viewer.