Search squid archive

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux