Ignore:
Timestamp:
01/15/26 17:51:54 (11 days ago)
Author:
Kris Deugau
Message:

/branches/cname-collision

Grab bag of minor whitespace and docucomment cleanups, along with a minor
strftime de-oops

Location:
branches/cname-collision
Files:
2 edited

Legend:

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

    r989 r990  
    641641  foreach my $tcompare ('<>', '=') {
    642642    next if $tcompare eq '<>' && ${$args{rectype}} != 5;
    643     # First, check for non-CNAME collisions.
    644643    my $sql = "SELECT count(*) FROM "._rectable($args{defrec}, $args{revrec}).
    645644        " WHERE "._recparent($args{defrec}, $args{revrec})." = ? AND type $tcompare 5 AND $hfield = ?";
     
    664663    }
    665664
    666     # Check timestamps of pending active-after records.  Coerce expires-at fields to soonest match if found.
     665    # Check timestamps of pending active-after records.  Coerce expires-at timestamp down to soonest match if overlapping.
    667666    if ($args{defrec} eq 'n') {
    668667      $sql = "SELECT extract(epoch from stamp),stamp < now() FROM "._rectable($args{defrec}, $args{revrec}).
     
    690689          } else {
    691690            # coerce the expiry timestamp
    692             ${$args{stamp}} = strftime('Y-%m-%d %H:%M:%S', localtime($t[0]));
     691            ${$args{stamp}} = strftime('%Y-%m-%d %H:%M:%S', localtime($t[0]));
    693692            return ('WARN', "CNAME added with modified expiry time;  conflicting valid-after record found");
    694693          }
     
    17721771
    17731772  return ('WARN', join("\n", $errstr, $warnmsg) ) if $warnmsg;
    1774  
     1773
    17751774  return ('OK','OK');
    17761775} # done ALIAS record
  • branches/cname-collision/t/cname.t

    r989 r990  
    214214      }
    215215    };
    216 # this test arguably overkill, subsumed by earlier test for substantially the same thing
     216# this test arguably overkill, subsumed by earlier test for nonexpiring collision
    217217    subtest '  - collision with soon to expire record' => sub {
    218218      $newname = 'expired2.expiry1.test';
     
    288288        ok( $rcount == 2, " ... [$rcount] correct number of records for $newname" );
    289289        my ($newstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 5 AND host = '$newname' ".
    290                "AND stampactive = 't' AND expires = 't'");
     290                "AND stampactive = 't' AND expires = 't'");
    291291        my ($oldstamp) = $dbh->selectrow_array("SELECT extract(epoch from stamp) FROM records WHERE domain_id = 5 AND host = '$newname' ".
    292                "AND stampactive = 't' AND expires = 'f'");
     292                "AND stampactive = 't' AND expires = 'f'");
    293293        ok( $newstamp <= $oldstamp, " ... added record expires before existing active-after record goes active" );
    294294      } else {
Note: See TracChangeset for help on using the changeset viewer.