Changeset 661


Ignore:
Timestamp:
12/29/14 17:52:03 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Backmerge minor RPC fixes from /branches/stable r610

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/cgi-bin/IPDB.pm

    r660 r661  
    2525@EXPORT_OK    = qw(
    2626        %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist
    27         %IPDBacl %aclmsg %rpcacl
     27        %IPDBacl %aclmsg %rpcacl $maxfcgi
    2828        $errstr
    2929        &initIPDBGlobals &connectDB &finish &checkDBSanity
     
    4040%EXPORT_TAGS    = ( ALL => [qw(
    4141                %disp_alloctypes %list_alloctypes %def_custids @citylist @poplist
    42                 %IPDBacl %aclmsg %rpcacl
     42                %IPDBacl %aclmsg %rpcacl $maxfcgi
    4343                $errstr
    4444                &initIPDBGlobals &connectDB &finish &checkDBSanity
     
    7272
    7373our %rpcacl;
     74our $maxfcgi = 3;
    7475
    7576# error reporting
  • trunk/cgi-bin/MyIPDB.pm

    r660 r661  
    2929#       devel => ['10.0.10.5'],
    3030#       );
     31# Only you can prevent memory leaks!
     32#$IPDB::maxfcgi = 100;
    3133
    3234# Quick workaround for fixed web path.  Set this to the absolute web path to
  • trunk/cgi-bin/ipdb-rpc.cgi

    • Property svn:keywords set to Date Rev Author Id
    r660 r661  
    3737}
    3838
    39 syslog "debug", "$authuser active, $ENV{'REMOTE_ADDR'}";
    40 
    4139# Why not a global DB handle?  (And a global statement handle, as well...)
    4240# Use the connectDB function, otherwise we end up confusing ourselves
     
    5755# main FCGI loop.
    5856while (FCGI::accept >= 0) {
     57  # done here to a) prevent $ENV{'REMOTE_ADDR'} from being empty and b) to collect
     58  # the right user for the individual call (since we may be running with FCGI)
     59  syslog "debug", "$authuser active, $ENV{'REMOTE_ADDR'}";
     60
    5961  # don't *think* we need any of these...
    6062  # %disp_alloctypes, %def_custids, %list_alloctypes
     
    7476    print $res->answer;
    7577  }
    76 #  last if $reqcnt++ > $IPDB::maxfcgi;
     78  last if $reqcnt++ > $IPDB::maxfcgi;
    7779} # while FCGI::accept
    7880
     
    8789sub _aclcheck {
    8890  my $subsys = shift;
    89   return 1;
    90   return 1 if grep /$ENV{REMOTE_ADDR}/, $IPDB::rpcacl{$subsys};
     91  return 1 if grep /$ENV{REMOTE_ADDR}/, @{$IPDB::rpcacl{$subsys}};
    9192  warn "$subsys/$ENV{REMOTE_ADDR} not in ACL\n";        # a bit of logging
    9293  return 0;
Note: See TracChangeset for help on using the changeset viewer.