Changeset 69 for trunk


Ignore:
Timestamp:
07/19/18 17:03:38 (6 years ago)
Author:
Kris Deugau
Message:

/trunk/dnsbl

  • Accumulated fixes and tweaks from production
  • Add FindBin to a couple of scripts to make them more portable; they no longer need to be run from the directory they're in, or have system-specific paths hardcoded in either "use lib" or a -I argument
Location:
trunk/dnsbl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/DNSBL.pm

    r67 r69  
    184184        "WHERE b.block >>= ? ".
    185185        "GROUP BY b.block,b.level,b.listme,o.listme ORDER BY b.block");
    186   $sthmoron = $dbh->prepare("SELECT ip,s4list,white FROM iplist WHERE parent = ?");
     186  $sthmoron = $dbh->prepare("SELECT ip,s4list,exclude FROM iplist WHERE parent = ?");
    187187}
    188188
     
    217217        $sth = $dbh->prepare("INSERT INTO iplist (ip,parent,exclude) VALUES ".
    218218                "(?,(SELECT block FROM blocks WHERE block >> ? ORDER BY level DESC LIMIT 1),?)");
    219         $sth->execute($rep,$rep,$exclude) or die "couldn't add entry for $rep: ".$dbh->errstr."\n";
     219        $sth->execute($rep,$rep,($exclude ? 'y' : 'n')) or die "couldn't add entry for $rep: ".$dbh->errstr."\n";
    220220      } elsif ($rows == 1) {
    221221        $sth = $dbh->prepare("UPDATE iplist SET count=count+1,".
  • trunk/dnsbl/browse.cgi

    r67 r69  
    2525use CGI::Simple;
    2626use HTML::Template;
     27
     28# push "the directory the script is in" into @INC
     29use FindBin;
     30use lib "$FindBin::RealBin/";
    2731
    2832use DNSBL 2.2;
  • trunk/dnsbl/dnsbl.cgi

    r67 r69  
    2727use Net::DNS;
    2828
     29# push "the directory the script is in" into @INC
     30use FindBin;
     31use lib "$FindBin::RealBin/";
     32
    2933use DNSBL 2.2;
    3034use DNSBLweb;
     
    189193    }
    190194    if (!$dnsbl->blockexists($webvar{$blockn})) {
    191       my $ret = $dnsbl->addblock($webvar{$blockn}, $orgid, $i, $webvar{$excln});
     195      my $ret = $dnsbl->addblock($webvar{$blockn}, $orgid, $i, $webvar{$excln}, $webvar{$commentn});
    192196      $err .= "error adding $webvar{$blockn}: $ret<br>\n" if $ret;
    193197      $page->param($blockn => $webvar{$blockn});
  • trunk/dnsbl/export-dnsbl

    r67 r69  
    2222use warnings;
    2323use DBI;
     24
     25# push "the directory the script is in" into @INC
     26use FindBin;
     27use lib "$FindBin::RealBin/";
    2428
    2529use DNSBL 2.2;
Note: See TracChangeset for help on using the changeset viewer.