]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix authentication headers sent on peer digest requests
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 4 Mar 2013 20:08:47 +0000 (13:08 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 4 Mar 2013 20:08:47 +0000 (13:08 -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 e399c3c4d693ac519869804cd41840bfdcbbeaa2..6b0caf97f5a6af025b37584242b7be8ec1fceb39 100644 (file)
@@ -347,9 +347,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);