]> 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, 29 Jul 2011 05:53:35 +0000 (23:53 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 29 Jul 2011 05:53:35 +0000 (23:53 -0600)
src/redirect.cc

index 6b827ef532deb2bce1d908a63840629af905e529..05d36f4061837371d6120340bb45a2abde6fd949 100644 (file)
@@ -154,7 +154,8 @@ redirectStart(ClientHttpRequest * http, RH * handler, void *data)
     }
 #endif
 
-    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"));
     }