[robin.garner@iname.com: authenticateAuthUserRequestSetIp]

From: Adrian Chadd <adrian@dont-contact.us>
Date: Mon, 6 Aug 2001 13:25:12 +0800

----- Forwarded message from Robin Garner <robin.garner@iname.com> -----

X-Mailer: MIME-tools 5.41 (Entity 5.404)
From: "Robin Garner" <robin.garner@iname.com>
To: squid-bugs@squid-cache.org
Cc: robin.garner@crsrehab.gov.au
Date: Mon, 06 Aug 2001 11:22:41 +0800
Subject: authenticateAuthUserRequestSetIp

Hi,

I noticed lots of authenticateAuthUserRequestSetIp messages in the store.log, and it seems the logic of authenticateAuthUserRequestSetIp has been broken recently. The code following

/* This ip is not in the seen list */

actually gets executed every time.

The diffs of one fix are:

$ diff authenticate.c.old authenticate.c
249a250,251
> int found=0;
>
264a267
> found = 1;
276,281c279,285
< /* This ip is not in the seen list */
< ipdata = cbdataAlloc(auth_user_ip_t);
< ipdata->ip_expiretime = squid_curtime;
< ipdata->ipaddr = ipaddr;
< dlinkAddTail(ipdata, &ipdata->node, &auth_user->ip_list);
< auth_user->ipcount++;

---
>     if( !found) {
>         /* This ip is not in the seen list */
>         ipdata = cbdataAlloc(auth_user_ip_t);
>         ipdata->ip_expiretime = squid_curtime;
>         ipdata->ipaddr = ipaddr;
>         dlinkAddTail(ipdata, &ipdata->node, &auth_user->ip_list);
>         auth_user->ipcount++;
283,285c287,290
<     ip1 = xstrdup(inet_ntoa(ipaddr));
<     debug(29, 1) ("authenticateAuthUserRequestSetIp: user '%s' has been seen at a new IP
 address (%s, %s)\n ", authenticateUserUsername(auth_user), ip1);
<     safe_free(ip1);
---
>         ip1 = xstrdup(inet_ntoa(ipaddr));
>         debug(29, 1) ("authenticateAuthUserRequestSetIp: user '%s' has been seen at a ne
w IP address (%s)\n ", authenticateUserUsername(auth_user), ip1);
>         safe_free(ip1);
>     }
Cheers,
Robin Garner
-- 
_______________________________________________
Talk More, Pay Less with Net2Phone Direct(R), up to 1500 minutes free! 
http://www.net2phone.com/cgi-bin/link.cgi?143 
----- End forwarded message -----
-- 
Adrian Chadd			Yeah, for me its (XML) like the movie Titanic.
<adrian@creative.net.au>	  Everybody loves it.
				    I want to be different, so I hate it.
					--Duane Wessels
Received on Sun Aug 05 2001 - 23:25:21 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:09 MST