Changeset 794 for trunk/dns-rpc.cgi


Ignore:
Timestamp:
10/22/20 14:05:25 (4 years ago)
Author:
Kris Deugau
Message:

/trunk

Commit critical-failure-shortstopping fix from production around RPC delete.

If an RPC request is made to delete a nested subzone, records outside of that
range in the "parent" could be deleted as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-rpc.cgi

    r765 r794  
    16831683    # Overlapping reverse zones shouldn't be possible, so if we're here we've got a CIDR
    16841684    # that spans multiple reverse zones (eg, /23 CIDR -> 2 /24 rzones)
     1685    # 2018/09/18 found an edge case, of course;  if you've hacked IPDB to allow branched master
     1686    # blocks you *can* end up with nested reverse zones, in which case deleting a record in one
     1687    # may axe records in the other.  dunno if it affects cidr-in-large axes recs-in-smaller, but
     1688    # I have an active failure for cidr-in-smaller axes recs-in-larger.  eeep.
    16851689    foreach my $zdata (@$zonelist) {
    16861690      my $reclist = $dnsdb->getRecList(rpc => 1, defrec => 'n', revrec => 'y', id => $zdata->{rdns_id});
     
    16971701          # Template types are only useful when attached to a reverse zone.
    16981702##fixme  ..... or ARE THEY?
     1703          # edge case:  if we have nested zones, make sure that we do not delete records outside of
     1704          # the passed $cidr.  This is horrible-ugly-bad, especially when said out-of-scope records
     1705          # constitute key core network names...
     1706##fixme:  should this check be moved into getRecList as a search restriction of some kind?
     1707#  cf args{filter}, but we really need to leverage the DB's IP type handling for this to be worthwhile
     1708          my $rcidr = new NetAddr::IP $rec->{val};
     1709          next unless $cidr->contains($rcidr);
    16991710          if ($args{delforward} ||
    17001711              $rec->{type} == 12 || $rec->{type} == 65282 ||
Note: See TracChangeset for help on using the changeset viewer.