Re: [squid-users] Configuring authentication with ldap_auth and two domains?

From: Matthias Dettling <m-dettling@dont-contact.us>
Date: Mon, 11 Apr 2005 19:31:14 +0200

D & E Radel schrieb:
> Matthias Dettling wrote:
>
>
>>Hello grolschie,
>>
>>as I know %s isn't a variable that is passed to
>>/usr/lib/squid/ldap_auth, instead it is a
>
> variable from that program,
>
>>which tells it, that %s must be replaced with
>
> the username.
>
>>By the way parameters of a shell script can be
>
> found in $1, $2, ...
>
>>The name, password pair is passed to the script
>
> by the auth_param basic
>
>>program command. What you have to do is reading
>
> from stdin and pass it
>
>>to all of your /usr/lib/squid/ldap_auth commands
>
> in the script and then
>
>>evaluate the result.
>>
>>Reading from stdin, can be done by something
>
> like this:
>
>>--------------------
>>#!/bin/sh
>>
>># reading stdin
>>INP=`cat`
>>
>># pass stdin to /usr/lib/squid/ldap_auth
>>DOM1=`echo $INP | /usr/lib/squid/ldap_auth ...`
>>DOM2=`echo $INP | /usr/lib/squid/ldap_auth ...`
>>...
>>--------------------
>>
>>Now the only thing you have to do is evaluate
>
> DOM1, DOM2, ... if one of
>
>>it equals to "OK". And depending on this execute
>
> echo "OK" or echo "ERR".
>
>>I hope this helps.
>>
>>Regards
>>Matthias
>
>
> Wow! Thanks big time Matthias! :-)
>
> So the evaluation should be something like this?
>
> if [$DOM1="OK"]; then
> echo "OK"
> elif [$DOM2="OK"]; then
> echi "OK"
> else
> echo "ERR"
> fi
>
> I would never had got that " INP=`cat`" and "echo
> $INP" stuff. I would've feebly attempted something
> like this:
> DOM1=`/usr/lib/squid/ldap_auth ...`
> DOM2=`/usr/lib/squid/ldap_auth ...`
>
> ...followed by the above evaluation.
>
> Thanks alot for your help. I shall give this a
> blast tomorrow when I am in front of the box.
>
> Kind regards,
> grolschie
>
>
Hello grolschie,

yes, that's it, what I meant.
But note that there is a little typo.
Instead of echi you should of course write echo.
Then it should work.
Please tell me about the result of your attempt.

Regards
Matthias
Received on Mon Apr 11 2005 - 11:30:57 MDT

This archive was generated by hypermail pre-2.1.9 : Sun May 01 2005 - 12:00:03 MDT