]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
proxy_auth usernames with leading whitespace were handled inconsistently.
authorwessels <>
Thu, 4 Jan 2001 11:01:17 +0000 (11:01 +0000)
committerwessels <>
Thu, 4 Jan 2001 11:01:17 +0000 (11:01 +0000)
The authenticator probably allows the name, but the name gets logged
with the leading space encoded, which affects logfile analysis.  This
patch strips leading spaces before storing the name and passing it
to an authenticator.

src/acl.cc

index cc7083e8cf195cd92dc2e7fa9e25e28c8935eba2..fae076aea35258e642d39e8776d1abebf09a9d72 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: acl.cc,v 1.229 2001/01/04 03:42:34 wessels Exp $
+ * $Id: acl.cc,v 1.230 2001/01/04 04:01:17 wessels Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -1055,6 +1055,9 @@ aclDecodeProxyAuth(const char *proxy_auth, char **user, char **password, char *b
     debug(28, 6) ("aclDecodeProxyAuth: cleartext = '%s'\n", cleartext);
     xstrncpy(buf, cleartext, bufsize);
     xfree(cleartext);
+    /* Trim leading whitespace after decoding */
+    while (xisspace(*buf))
+       buf++;
     *user = buf;
     if ((*password = strchr(*user, ':')) != NULL)
        *(*password)++ = '\0';