Re: [squid-users] TAG:deny_info - another question

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 26 Feb 2004 20:42:49 +0100 (CET)

On Thu, 26 Feb 2004, OTR Comm wrote:

> I am using squid-3.0 so I looked in errorpage.cc and found the
> errorConvert(char token, ErrorState * err) function.

Yes, this is where it all happens.

> I see how the URL is setup in the case for 'U'.
> I see that
>
> <snip>
> HttpRequest *r = err->request;
> <snip>

The important part of %U is found further down

    case 'U':
        p = r ? urlCanonicalClean(r) : err->url ? err->url : "[no URL]";
        break;

this calculates what %U should be replaced by. Translated to english the
above logics is

If there is a request then use the URL from the request
else if there is a URL registered in the ErrorState object use that url
else "[no URL]".

> Now, can I setup another case in errorConvert for the username (maybe
> 'C' for client ID) and reference 'r->extacl_user' to get the username?

extacl_user is maybe not what you are looking for. This is the username as
returned by external_acl_type, not the username from authentication.

There is quite many kinds of usernames in Squid. The current Squid-3.0
sources have the following different username concepts:

* Username from URL, as in ftp://user:password@host/

* Username from authentication

* Username from IDENT lookup

* Username from external acl lookup (external_acl_type)

* Username from SSL certificate

As each have somewhat different meaning each is accessed differently.

Examples on how most of these can be accessed can be found in
ClientHttpRequest::logRequest() and clientPrepareLogWithRequestDetails()
(both found in client_side.cc) where the information is prepared for
logging in access.log.

Regards
Henrik
Received on Thu Feb 26 2004 - 15:09:18 MST

This archive was generated by hypermail pre-2.1.9 : Mon Mar 01 2004 - 12:00:03 MST