]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3412: External ACL Uses Invalid Cache Entry
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 11 Nov 2011 10:22:02 +0000 (03:22 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 11 Nov 2011 10:22:02 +0000 (03:22 -0700)
src/external_acl.cc

index 5c286c4d1d88af07a4d7416fbf1409ee48fd5e60..5da8e9930e62bbdd9be5faef92b198c369dae07b 100644 (file)
@@ -756,7 +756,14 @@ aclMatchExternal(external_acl_data *acl, ACLFilledChecklist *ch)
 
     if (entry) {
         if (cbdataReferenceValid(entry) && entry->def == acl->def) {
-            /* Ours, use it.. */
+            /* Ours, use it.. if the key matches */
+            key = makeExternalAclKey(ch, acl);
+            if (strcmp(key, (char*)entry->key) != 0) {
+                debugs(82, 9, HERE << "entry key='" << (char *)entry->key << "', our key='" << key << "' dont match. Discarded.");
+                // too bad. need a new lookup.
+                cbdataReferenceDone(ch->extacl_entry);
+                entry = NULL;
+            }
         } else {
             /* Not valid, or not ours.. get rid of it */
             debugs(82, 9, HERE << "entry " << entry << " not valid or not ours. Discarded.");