Search squid archive

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

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

 



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@xxxxxxxxxxxxxxx>
To: "Ryan Lamberton" <ryan@xxxxxxxxxxxx>
Cc: "Henrik Nordstrom" <hno@xxxxxxxxxxxxxxx>; "Squid Users" <squid-users@xxxxxxxxxxxxxxx>
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


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

  Powered by Linux