From: hno <> Date: Thu, 27 Feb 2003 15:23:55 +0000 (+0000) Subject: Bug #553: Assertion failed: auth_user_request != NULL, w/external acls X-Git-Tag: SQUID_3_0_PRE1~306 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8e7608c8d62690b00752581aca80d7813ce3734;p=thirdparty%2Fsquid.git Bug #553: Assertion failed: auth_user_request != NULL, w/external acls The first fix was not sufficient. Also need to make sure the checklist is authenticated when doing external acl lookups via the acl helper.. --- diff --git a/src/external_acl.cc b/src/external_acl.cc index a56ba80c54..b49f14afeb 100644 --- a/src/external_acl.cc +++ b/src/external_acl.cc @@ -1,6 +1,6 @@ /* - * $Id: external_acl.cc,v 1.31 2003/02/25 13:47:43 hno Exp $ + * $Id: external_acl.cc,v 1.32 2003/02/27 08:23:55 hno Exp $ * * DEBUG: section 82 External ACL * AUTHOR: Henrik Nordstrom, MARA Systems AB @@ -918,10 +918,20 @@ ACLExternal::ExternalAclLookup(ACLChecklist * ch, ACLExternal * me, EAH * callba MemBuf buf; external_acl_data *acl = static_cast(me->data); external_acl *def = acl->def; - const char *key = makeExternalAclKey(ch, acl); - external_acl_entry *entry = static_cast(hash_lookup(def->cache, key)); externalAclState *state; - debug(82, 2) ("externalAclLookup: lookup in '%s' for '%s'\n", def->name, key); + + if (acl->def->require_auth) { + int ti; + /* Make sure the user is authenticated */ + + if ((ti = ch->authenticated()) != 1) { + debug(82, 1) ("externalAclLookup: %s user authentication failure (%d)\n", acl->def->name, ti); + callback(callback_data, NULL); + return; + } + } + + const char *key = makeExternalAclKey(ch, acl); if (!key) { debug(82, 1) ("externalAclLookup: lookup in '%s', prerequisit failure\n", def->name); @@ -929,6 +939,9 @@ ACLExternal::ExternalAclLookup(ACLChecklist * ch, ACLExternal * me, EAH * callba return; } + debug(82, 2) ("externalAclLookup: lookup in '%s' for '%s'\n", def->name, key); + external_acl_entry *entry = static_cast(hash_lookup(def->cache, key)); + state = cbdataAlloc(externalAclState); state->def = cbdataReference(def); state->callback = callback;