Re: [squid-users] username in logformat and error template

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 02 Aug 2012 21:45:23 +1200

On 2/08/2012 9:02 p.m., Alan wrote:
> I am having trouble the username tags in logformat and error templates.
>
> The logformat documentation says that %ul is the username from
> authentication, but in my experience when there is an authentication
> failure this is filled with whatever the user tried to authenticate
> with instead of being empty, is this intended?

Yes. It is the username (note no space) provided by the auth headers ...
which just failed to verify.

> On the other hand, %ue is only filled when the user has been
> authenticated, which is what I want.

Strange %ue is the user name(note the space) received from the
external_acl_type helper. It is not authentication related.

> However it seems I am out of luck with custom errors substitutions,
> there is no equivalent to the %ue from logformat.

Right. Unfortunately the old log codes only allowed one character code
letters. A fix is underway to upgrade them to use the logformat set, but
that is taking a while.

> %a is replaced by the username even when authentication failed, just
> like %ul in logformat.
> I need to distinguish quickly (from the error screen as opposed to the
> logs) between authentication and authorization (acl) failures.

> BTW I am aware of the %m and %o tags, I am still looking for the %ue
> tag behavior.

Feel like patching?
   src/errorpage.cc function ErrorState::Convert() is where the macro
codes are expanded.

Amos
Received on Thu Aug 02 2012 - 09:45:36 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 02 2012 - 12:00:02 MDT