]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2655: passing wrong the username to the url_rewrite_program
authorOliver Dumschat <necromot@googlemail.com>
Fri, 5 Aug 2011 03:14:37 +0000 (21:14 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 5 Aug 2011 03:14:37 +0000 (21:14 -0600)
src/redirect.cc

index a66e0ebb47649be9fa70b6844809dbcb70ac1921..2227fa180cb1b37a37dfe5cb04b6dfd190786dc9 100644 (file)
@@ -146,7 +146,8 @@ redirectStart(ClientHttpRequest * http, RH * handler, void *data)
         debugs(61, 5, HERE << "auth-user=" << (r->client_ident?r->client_ident:"NULL"));
     }
 
-    if (!r->client_ident && http->request->extacl_user.defined()) {
+    // HttpRequest initializes with null_string. So we must check both defined() and size()
+    if (!r->client_ident && http->request->extacl_user.defined() && http->request->extacl_user.size()) {
         r->client_ident = http->request->extacl_user.termedBuf();
         debugs(61, 5, HERE << "acl-user=" << (r->client_ident?r->client_ident:"NULL"));
     }