]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix authentication headers sent on peer digest requests
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 8 Mar 2013 09:32:25 +0000 (02:32 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 8 Mar 2013 09:32:25 +0000 (02:32 -0700)
Cache digest fetches have been sending the cache_peer login= option
value without sanitizing it for special-case values used internally
by Squid. This causes authentication failure on peers which are checking
user credentials.

src/peer_digest.cc

index 973a1af4b687b2a46b15b0999504746a473c4d16..0304e3da8777f9a224e5f04eafeb9e31702ac068 100644 (file)
@@ -343,9 +343,14 @@ peerDigestRequest(PeerDigest * pd)
 
     req->header.putStr(HDR_ACCEPT, "text/html");
 
-    if (p->login)
+    if (p->login &&
+            p->login[0] != '*' &&
+            strcmp(p->login, "PASS") != 0 &&
+            strcmp(p->login, "PASSTHRU") != 0 &&
+            strcmp(p->login, "NEGOTIATE") != 0 &&
+            strcmp(p->login, "PROXYPASS") != 0) {
         xstrncpy(req->login, p->login, MAX_LOGIN_SZ);
-
+    }
     /* create fetch state structure */
     CBDATA_INIT_TYPE(DigestFetchState);