[squid-users] Re: custom auth handlers...

From: Adam Aube <aaube01@dont-contact.us>
Date: Wed, 23 Jun 2004 14:46:11 -0400

Chris Knipe wrote:

> Simple question I think... It's more than likely a error with a 3 line
> bash script... But ja

> I have squid.conf:
> auth_param basic program /usr/local/libexec/squid/auth.pl

> then...
>
> auth.pl is really simple:
> echo $1 $2 > /usr/local/libexec/squid/auth.log
> echo OK
>
> This work... Any username / password gets authenticated and are allowed
> access though the proxy. However, according to auth.log, $1 and $2 is
> empty...

I see 3 problems here:

1) You are reading the username and password from Squid incorrectly. Squid
passes them on stdin, not as command line arguments.

2) Squid auth helpers are designed to run in an endless loop. Your script
does not loop.

3) By using > instead of >> to write the username and password to a file,
you are overwriting ("clobbering") the file each time you log a username
and password - only the last username and password used will be kept.

(1) and (2) are documented in the Squid FAQ:

"How does proxy authentication work in Squid?"

http://www.squid-cache.org/Doc/FAQ/FAQ-23.html#ss23.1

(3) is a basic shell scripting concept - overwriting vs appending.

Adam
Received on Wed Jun 23 2004 - 12:50:10 MDT

This archive was generated by hypermail pre-2.1.9 : Thu Jul 01 2004 - 12:00:03 MDT