Changeset 829 for trunk


Ignore:
Timestamp:
12/07/21 18:10:58 (3 years ago)
Author:
Kris Deugau
Message:

/trunk

Mostly fix an edge case deleting a CIDR range from a large revzone via RPC.
If a revzone has enough unique entries, the CIDR range to be cleared may be
more than $perpage entries down the list retrieved from a call to
getRecList() without "offset => 'all'". See #77.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-rpc.cgi

    r797 r829  
    16301630      if ($args{delsubs}) {
    16311631        # Delete ALL EVARYTHING!!one11!! in $args{cidr}
    1632         my $reclist = $dnsdb->getRecList(rpc => 1, defrec => 'n', revrec => 'y', id => $zonelist->[0]->{rdns_id});
     1632
     1633        # Use offset => 'all' to make sure we actually find all the records we need to remove,
     1634        # otherwise the record(s) that need to be deleted may be more than 75 records down the
     1635        # list and won't get caught.  We also do a crude filter based on the /24 of $args{cidr}
     1636        # to reduce the remote's cost for the operation - if the revzone is large, it'll iterate
     1637        # over a Very Large Number(TM) of records, just to delete a small handful.  Bad juju.
     1638        my $filt = $args{cidr};
     1639        $filt =~ s,\.\d+(?:/\d+)?$,,;
     1640        my $reclist = $dnsdb->getRecList(rpc => 1, defrec => 'n', revrec => 'y', id => $zonelist->[0]->{rdns_id},
     1641            filter => $filt, offset => 'all');
     1642
    16331643        foreach my $rec (@$reclist) {
    16341644          my $reccidr = new NetAddr::IP $rec->{val};
Note: See TracChangeset for help on using the changeset viewer.