Changeset 72 for trunk


Ignore:
Timestamp:
07/20/18 11:58:21 (6 years ago)
Author:
Kris Deugau
Message:

/trunk/dnsbl

Another couple of missed minor fixes around exclusion behaviours

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/DNSBL.pm

    r71 r72  
    313313  my $orgid = shift;
    314314  my $level = shift;
    315   my $exclude = shift;
     315  my $exclude = shift || 'n';
    316316  my $comment = shift;
    317317  $blockin =~ s/^\s+//;
     
    332332    }
    333333    $sth = $dbh->prepare("INSERT INTO blocks (block,orgid,level,parent,exclude,comments,ipcount) VALUES (?,?,?,?,?,?,".
    334         "(SELECT count(*) FROM iplist WHERE ip << ? AND exclude='n'))");
     334        "(SELECT count(*) FROM iplist i JOIN blocks b ON b.block=i.parent WHERE i.ip << ? AND i.exclude='n' AND b.exclude='n'))");
    335335    $sth->execute("$block",$orgid,$level,$parent,$exclude,$comment,"$block");
    336336    $sth = $dbh->prepare("UPDATE iplist SET parent=? WHERE parent=? AND ip << ?");
     
    354354  my $orgid = shift;
    355355  my $level = shift;
    356   my $exclude = shift;
     356  my $exclude = shift || 'n';
    357357  my $comment = shift;
    358358  $blockin =~ s/^\s+//;
     
    387387  }
    388388  # nb: no need to return anything, since the CIDR block is the key
    389 }
     389} # updateblock()
    390390
    391391
Note: See TracChangeset for help on using the changeset viewer.