Changeset 944 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
09/19/23 10:40:24 (8 months ago)
Author:
Kris Deugau
Message:

/trunk

Fix an edge case updating rDNS on a netblock. If all but one per-IP field
is blank, and the remaining field is cleared, the removal wouldn't be sent
to dnsadmin because the hash wouldn't have that IP as a key.

Fixed with an extra flag field indicating "this IP had a DNS name", so we
can explicitly set the hash value to so it'll be cleared when passed
down the chain.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r939 r944  
    13571357  # collect per-IP rDNS fields.  only copy over the ones that actually have something in them.
    13581358  my %iprev;
    1359   foreach (keys %webvar) {
    1360     $iprev{$_} = $webvar{$_} if /host_[\d.a-fA-F:]+/ && $webvar{$_};
     1359  foreach (sort keys %webvar) {
     1360    # skip all but the host_* fields
     1361    next unless /^host_[\d.a-fA-F:]+/;
     1362    # propagate the per-IP rDNS if present
     1363    $iprev{$_} = $webvar{$_} if $webvar{$_};
     1364    # set the rDNS to be cleared if there was a value before (was_host_* field),
     1365    # but there's no value in the matching visible form field now (host_*)
     1366    $iprev{$_} = '' if $webvar{"was_$_"} && !$webvar{$_};
    13611367  }
    13621368
Note: See TracChangeset for help on using the changeset viewer.