From: adrian <> Date: Tue, 7 Aug 2001 18:35:26 +0000 (+0000) Subject: * Commit fix to authenticateAuthUserRequestSetIp() X-Git-Tag: SQUID_3_0_PRE1~1456 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d57a7893cff060281b17e355068b78d7a4468c8d;p=thirdparty%2Fsquid.git * Commit fix to authenticateAuthUserRequestSetIp() * Tidy up comment (forced by the indent check :) Noticed by: Robin Garner Submitted by: rbcollins --- diff --git a/src/authenticate.cc b/src/authenticate.cc index 6c9a058a8a..0bd62a10cb 100644 --- a/src/authenticate.cc +++ b/src/authenticate.cc @@ -1,6 +1,6 @@ /* - * $Id: authenticate.cc,v 1.25 2001/08/03 15:13:03 adrian Exp $ + * $Id: authenticate.cc,v 1.26 2001/08/07 12:35:26 adrian Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -247,19 +247,23 @@ authenticateAuthUserRequestSetIp(auth_user_request_t * auth_user_request, struct auth_user_ip_t *ipdata, *tempnode; auth_user_t *auth_user; char *ip1; + int found = 0; CBDATA_INIT_TYPE(auth_user_ip_t); if (!auth_user_request->auth_user) return; auth_user = auth_user_request->auth_user; ipdata = (auth_user_ip_t *) auth_user->ip_list.head; - /* we walk the entire list to prevent the first item in the list preventing - * old entries being flushed and locking a user out after a timeout+reconfigure + /* + * we walk the entire list to prevent the first item in the list + * preventing old entries being flushed and locking a user out after + * a timeout+reconfigure */ while (ipdata) { tempnode = (auth_user_ip_t *) ipdata->node.next; /* walk the ip list */ if (ipdata->ipaddr.s_addr == ipaddr.s_addr) { /* This ip has alreadu been seen. */ + found = 1; /* update IP ttl */ ipdata->ip_expiretime = squid_curtime; } else if (ipdata->ip_expiretime + Config.authenticateIpTTL < squid_curtime) { @@ -273,6 +277,9 @@ authenticateAuthUserRequestSetIp(auth_user_request_t * auth_user_request, struct ipdata = tempnode; } + if (!found) + return; + /* This ip is not in the seen list */ ipdata = cbdataAlloc(auth_user_ip_t); ipdata->ip_expiretime = squid_curtime;