Ignore:
Timestamp:
02/05/26 12:24:47 (3 days ago)
Author:
Kris Deugau
Message:

/branches/cname-collision

Refine one subbranch of the collision check logic; while in general an
expiring record can have its expiry time coerced to match a conflicting
valid-after record, it makes little sense to allow adding a record that
expires in the past to match a valid-after record with a timestamp in the
past.

The inverse case of a new/updated valid-after record conflicting with an
expired record with a timestamp in the past at least makes sense to allow
as the new record will be active immediately.

See #72

File:
1 edited

Legend:

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

    r1013 r1018  
    729729        } else {
    730730          if ($self->{coerce_cname_timestamp} eq 'adjust') {
    731             # coerce the valid-after timestamp
    732             ${$args{stamp}} = strftime('%Y-%m-%d %H:%M:%S', localtime($t[0]));
    733             return ('WARN', $typemap{${$args{rectype}}}." ".($args{update} ? 'updated' : 'added').
     731            if ($t[2] == 1) {
     732              # found a valid-after, but it's in the past, so adding an expiring record to match doesn't make
     733              # sense since it's effectively expired.
     734##fixme:  should probably remove this case once we get around to stripping valid-after timestamps once exported as active
     735              return ('FAIL', "Cannot ".($args{update} ? 'update' : 'add')." ".$typemap{${$args{rectype}}}.
     736                ", an existing valid-after record is already active for this name");
     737            } else {
     738              # coerce the expiry timestamp
     739              ${$args{stamp}} = strftime('%Y-%m-%d %H:%M:%S', localtime($t[0]));
     740              return ('WARN', $typemap{${$args{rectype}}}." ".($args{update} ? 'updated' : 'added').
    734741                " with modified valid-after time;  conflicting expiring record found");
     742            }
    735743          } else {
    736744            # New valid-after overlaps existing expiry, and not configured to adjust it
Note: See TracChangeset for help on using the changeset viewer.