From: wessels <> Date: Thu, 4 Jan 2001 11:01:17 +0000 (+0000) Subject: proxy_auth usernames with leading whitespace were handled inconsistently. X-Git-Tag: SQUID_3_0_PRE1~1703 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c12392a31c64171279cb265f261b661be604ac43;p=thirdparty%2Fsquid.git proxy_auth usernames with leading whitespace were handled inconsistently. 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. --- diff --git a/src/acl.cc b/src/acl.cc index cc7083e8cf..fae076aea3 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -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';