On Wed, 2003-08-20 at 11:42, Daniel Fone wrote:
> > smb_auth is a script that tests a username and password somehow, then
> > returns OKAY or FAILED (something like that)
> YES or ERR to be exact.

:-)

> > All you have to do is write a program that does the same - take
> > username/password pairs as presented by squid, test it somehow and
> > return Yea or Naye to squid.
> Yes. A very nice theory but not so easy in practice.
> My programs work fine if I use them in a console but as soon as I give it to 
> squid, all hell breaks loose.
> I suspect it is something to do with the method squid sends/recieves the 
> information from sdtin/stdout.
> I have also read that I need to flush STDOUT after every return.
> a) is this true?

Sounds reasonable - you need to flush the buffers so that no
username/passwords are sitting waiting in a buffer...  the squid process
is waiting for a YES or ERR from the authenticator.

> b) what does it mean?

As above

> c) how do I do it?

Depends on what your authenticator is written in...  it'd be something
like fflush (3) or sync or whatever.

Your authenticator is not allowed to die either - it must sit looping
waiting for input then giving the ERR or YES output, then wait for the
next input.  I can't remember if squid respawns dead authenticators or
not.  Also, squid will spawn as many of these authenticators as is in
the squid config file, so there will be probably 5 running at once by
default.



Reply via email to