[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

numeric I lines.



This is a small fix to 2.9.* which I copied from Taner's version of 2.8.

>From his ChangeLog:

"Fixed numeric I-lines so that they show hostname rather than IP..."

As I'm lazy I just copied it but if you check closer you'll find out
that it can be written in a more efficient way (there is extra code now).

The problem was with get_sockhost().

--- s_conf.c.orig	Mon Apr 21 23:35:28 1997
+++ s_conf.c	Sun Apr 27 01:04:42 1997
@@ -109,6 +109,7 @@
 	Reg	char	*hname;
 	Reg	int	i;
 	static	char	uhost[HOSTLEN+USERLEN+3];
+	static	char	uhost2[HOSTLEN+USERLEN+3];
 	static	char	fullname[HOSTLEN+1];
 
 	for (aconf = conf; aconf; aconf = aconf->next)
@@ -134,12 +135,20 @@
 				    {
 					(void)strcpy(uhost, cptr->username);
 					(void)strcat(uhost, "@");
+					(void)strcpy(uhost2, cptr->username);
+					(void)strcat(uhost2, "@");
 				    }
 				else
+				    {
 					*uhost = '\0';
+					*uhost2 = '\0';
+				    }
 				(void)strncat(uhost, fullname,
 					sizeof(uhost) - strlen(uhost));
-				if (!match(aconf->name, uhost))
+				(void)strncat(uhost2, sockhost,
+					sizeof(uhost2) - strlen(uhost2));
+				if ((!match(aconf->name, uhost)) ||
+				    (!match(aconf->name, uhost2)))
 					goto attach_iline;
 			    }
 
-- 
		Eilon Gishri, Tel-Aviv University Computation Center
		Home 03-5078671 /* on a matter of national security */
		E-mail: eilon@xxxxxxxxxxxxxxxx