Changeset 990 for branches/cname-collision
- Timestamp:
- 01/15/26 17:51:54 (11 days ago)
- Location:
- branches/cname-collision
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/cname-collision/DNSDB.pm
r989 r990 641 641 foreach my $tcompare ('<>', '=') { 642 642 next if $tcompare eq '<>' && ${$args{rectype}} != 5; 643 # First, check for non-CNAME collisions.644 643 my $sql = "SELECT count(*) FROM "._rectable($args{defrec}, $args{revrec}). 645 644 " WHERE "._recparent($args{defrec}, $args{revrec})." = ? AND type $tcompare 5 AND $hfield = ?"; … … 664 663 } 665 664 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. 667 666 if ($args{defrec} eq 'n') { 668 667 $sql = "SELECT extract(epoch from stamp),stamp < now() FROM "._rectable($args{defrec}, $args{revrec}). … … 690 689 } else { 691 690 # 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])); 693 692 return ('WARN', "CNAME added with modified expiry time; conflicting valid-after record found"); 694 693 } … … 1772 1771 1773 1772 return ('WARN', join("\n", $errstr, $warnmsg) ) if $warnmsg; 1774 1773 1775 1774 return ('OK','OK'); 1776 1775 } # done ALIAS record -
branches/cname-collision/t/cname.t
r989 r990 214 214 } 215 215 }; 216 # this test arguably overkill, subsumed by earlier test for substantially the same thing216 # this test arguably overkill, subsumed by earlier test for nonexpiring collision 217 217 subtest ' - collision with soon to expire record' => sub { 218 218 $newname = 'expired2.expiry1.test'; … … 288 288 ok( $rcount == 2, " ... [$rcount] correct number of records for $newname" ); 289 289 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'"); 291 291 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'"); 293 293 ok( $newstamp <= $oldstamp, " ... added record expires before existing active-after record goes active" ); 294 294 } else {
Note:
See TracChangeset
for help on using the changeset viewer.
![[ DNS Administrator ]](/fx/dnsadmin-logo.png)