Re: [squid-users] external_acl_type with http request header question

From: Ryan Lamberton <ryan@dont-contact.us>
Date: Tue, 10 May 2005 18:28:41 -0700

OK I think I have something... This will give me the same result as
ident.sh when I enter a base64 string "OK user=name":

#!/usr/bin/perl -w
$|=1; # no buffering???
while (<>) {
        chop;
        ($u) = split;
use MIME::Base64 ();
    $u = MIME::Base64::decode($u);
        $ans = &check($u);
        print "$ans",$u,"\n";
}

sub check {
        local($u) = @_;
        return 'OK user=';
}

As you can see I took another auth script and modified it. Even thought I
get the same result as the sh script I tried to use this and it caused
problems. Some of the base64 strings have the @familink.net in them as part
of the username. Can Squid use that as a username? Just so you know, my
only programming was in fortran!

Ryan Lamberton
FamiLink Company
Family Safe Internet Access

----- Original Message -----
From: "Henrik Nordstrom" <hno@squid-cache.org>
To: "Ryan Lamberton" <ryan@familink.com>
Cc: "Henrik Nordstrom" <hno@squid-cache.org>; "Squid Users"
<squid-users@squid-cache.org>
Sent: Tuesday, May 10, 2005 1:54 PM
Subject: Re: [squid-users] external_acl_type with http request header
question

>
>
> On Tue, 10 May 2005, Ryan Lamberton wrote:
>
>> It works! Thank you! Just one more question (more in the programming
>> area). The accelerator sends the username in base64. Can I use the
>> ident.sh to convert it to "English" before echoing it back?
>
> Yes.
>
>> If so, what I would I use for the code to accomplish it.
>
> I leave that as an programming excersice for you to solve. Shell scripts
> is not the most suitable for this kind of transformations and the shell
> helper should be seen mostly as an illustration, not as the ultimate
> solution.
>
> redirector helpers to Squid is quite commonly written in perl, where this
> kind of transformations is rather trivial.
>
> Regards
> Henrik
Received on Tue May 10 2005 - 19:28:44 MDT

This archive was generated by hypermail pre-2.1.9 : Wed Jun 01 2005 - 12:00:02 MDT