On Wed, May 11, 2005 at 02:00:16PM +0200, Henrik Nordstrom wrote:
> On Wed, 11 May 2005, Chris Knipe wrote:
>
> >Basically, what happens is that squid prompts for my username and
> >password, yet,
> >after I enter them, squid just sits there. Error log / access log shows
> >nothing,
> >and the browser eventually times out. This is with squid 2.5-STABLE9
>
> The usual cause to this is if you forgot to disable output buffering in
> your custom authenticator program. The UNIX libc by default buffers
> output.
>
> In perl:
>
> $|=1;
>
Hendrik,
You're not going to believe me, but I have tried that....
Originally, the script did have buffering off... Enabled / Disabled, still
the same.
The *entire* script with confidential stuff removed...
use Mysql;
use Sys::Syslog;
use strict;
use warnings;
###############################################################################
### Constants & Variables ###
###############################################################################
use constant DBHost => "DBHOST";
use constant DBName => "DBNAME";
use constant DBUser => "DBUSER";
use constant DBPass => "DBPASS";
###############################################################################
### Code Starts ###
###############################################################################
# Disable output buffering
$|=1;
my $GlobalDB = Mysql->connect(DBHost, DBName, DBUser, DBPass);
$GlobalDB->{'GlobalDB'}->{'PrintError'} = 0;
if ($GlobalDB) {
# This is the main loop for authentication requests
while (<STDIN>) {
syslog('info', 'Received: ', $_);
chop($_);
my @Info = split(/ /, $_);
my $SQL = $GlobalDB->query("SELECT CustData.isProxy AS Validated FROM CustData LEFT JOIN SquidUsers ON CustData.EntryID=SquidUsers.CustID WHERE SquidUsers.isActive='y' AND SquidUsers.Qouta > 100 AND CustData.isProxy='y' AND CustData.isActive='y' AND CustData.DebtCode='" . $Info[0] . "' AND CustData.Password='" . $Info[1] . "'");
if ($SQL->numrows != 1) {
print "ERR\n";
} else {
print "OK\n";
}
}
} else {
syslog('info', 'Dataconnection failed');
}
What is scaring, is that I have absolutely NOTHING reported by syslog....
-- Chris.Received on Wed May 11 2005 - 06:04:37 MDT
This archive was generated by hypermail pre-2.1.9 : Wed Jun 01 2005 - 12:00:02 MDT