From: Amos Jeffries Date: Mon, 15 Feb 2016 12:33:03 +0000 (+1300) Subject: Fix %un logging external ACL username X-Git-Tag: SQUID_3_5_14~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08b9b192cea6a699ced5705c7f7712fcecce069f;p=thirdparty%2Fsquid.git Fix %un logging external ACL username --- diff --git a/src/format/Format.cc b/src/format/Format.cc index dcaccb7981..71e656a69f 100644 --- a/src/format/Format.cc +++ b/src/format/Format.cc @@ -810,8 +810,14 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS if (al->request && al->request->auth_user_request != NULL) out = strOrNull(al->request->auth_user_request->username()); #endif + if (!out && al->request && al->request->extacl_user.size()) { + if (const char *t = al->request->extacl_user.termedBuf()) + out = t; + } + if (!out) out = strOrNull(al->cache.extuser); + #if USE_OPENSSL if (!out) out = strOrNull(al->cache.ssluser); @@ -832,7 +838,13 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS break; case LFT_USER_EXTERNAL: - out = strOrNull(al->cache.extuser); + if (al->request && al->request->extacl_user.size()) { + if (const char *t = al->request->extacl_user.termedBuf()) + out = t; + } + + if (!out) + out = strOrNull(al->cache.extuser); break; /* case LFT_USER_REALM: */