[squid-users] Re: Squid Authentification

From: Brett Lymn <blymn@dont-contact.us>
Date: Wed, 11 Sep 2002 23:19:16 +0930

On Wed, Sep 11, 2002 at 03:39:02PM +0200, Marcus Friede wrote:
>
> Can you give me an example how to write such a wrapper script?
> Squid starts some processes of the program which is quoted in squid.conf, authenticate_program.
> But how does squid forward the login, password to these processes?
> How can i forward such "parameters" to a process at all?
>

There is a script that I think comes with the distribution called
smb_auth.sh that you can feed the answers to in the right order. If
you look in the script you can see what it expects when. Squid sends
the username and password to the auth process over a pipe, so you just
need to read the username and password from stdin and then call
smb_auth.sh for each domain controller, providing the the username and
password at the right time. Check the return, if it is ok then print
out OK to stdout, otherwise continue to the next DC. If they all fail
then print a blank line (I think that is how the auth works).

Things to be wary of:

1) make sure line buffering is off on stdout
2) handling the password correctly is going to be really really hairy
   due to possible shell metachar interpretation.

The other alternative is you could hack on the source for smb_auth and
make that do the work for you :-)

-- 
Brett Lymn
Received on Wed Sep 11 2002 - 07:49:24 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:10:12 MST