--------------------- PatchSet 8819 Date: 2006/12/19 19:32:29 Author: hno Branch: ntlm_ip_cache Tag: (none) Log: Fix bug #1792 proper, and a small fix for the authenticate_ip_shortcircuit_ttl directive which segfaulted if set to 0 (the default) Members: src/authenticate.c:1.34.8.3->1.34.8.4 Index: squid/src/authenticate.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/authenticate.c,v retrieving revision 1.34.8.3 retrieving revision 1.34.8.4 diff -u -r1.34.8.3 -r1.34.8.4 --- squid/src/authenticate.c 19 Dec 2006 02:03:19 -0000 1.34.8.3 +++ squid/src/authenticate.c 19 Dec 2006 19:32:29 -0000 1.34.8.4 @@ -1,6 +1,6 @@ /* - * $Id: authenticate.c,v 1.34.8.3 2006/12/19 02:03:19 hno Exp $ + * $Id: authenticate.c,v 1.34.8.4 2006/12/19 19:32:29 hno Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -289,7 +289,12 @@ static void authenticateAuthUserRequestUnlinkIp(const struct in_addr ipaddr) { - auth_user_request_ip_hash_t *hash_entry = hash_lookup(auth_user_request_ip_hash, &ipaddr); + auth_user_request_ip_hash_t *hash_entry; + + if (!auth_user_request_ip_hash) + return; + + hash_entry = hash_lookup(auth_user_request_ip_hash, &ipaddr); if (hash_entry) { hash_remove_link(auth_user_request_ip_hash, &hash_entry->hash); authenticateAuthUserRequestUnlock(hash_entry->auth_user_request); @@ -703,7 +708,10 @@ *auth_user_request = t; authenticateAuthUserRequestLock(*auth_user_request); } - /* Don't set request->auth_user_request here. It's done elsewhere */ + if (!request->auth_user_request && t->lastReply == AUTH_AUTHENTICATED) { + request->auth_user_request = t; + authenticateAuthUserRequestLock(request->auth_user_request); + } return t->lastReply; } /* ok, call the actual authenticator routine. */ @@ -880,7 +888,7 @@ if ((auth_user_request != NULL) && (auth_user_request->auth_user->auth_module > 0) && (authscheme_list[auth_user_request->auth_user->auth_module - 1].AddHeader)) authscheme_list[auth_user_request->auth_user->auth_module - 1].AddHeader(auth_user_request, rep, accelerated); - if (auth_user_request != NULL) + if (auth_user_request != NULL && auth_user_request->lastReply != AUTH_AUTHENTICATED) auth_user_request->lastReply = AUTH_ACL_CANNOT_AUTHENTICATE; }