From lindholm@ucs.ubc.ca Thu Mar  3 23:17:16 1994
Flags: 000000000001
Received: from hub.ubc.ca (hub.ubc.ca [137.82.1.1]) by godot.lysator.liu.se (8.6.6.Beta2/8.6.6.Beta2) with SMTP id XAA00777 for <pen@lysator.liu.se>; Thu, 3 Mar 1994 23:17:03 +0100
Received: by hub.ubc.ca (4.1/1.14)
	id AA20074; Thu, 3 Mar 94 14:16:58 PST
Date:  3 Mar 94 14:15 -0800
From: George Lindholm <lindholm@ucs.ubc.ca>
To: Peter Eriksson <pen@lysator.liu.se>
Message-Id: <2619*lindholm@ucs.ubc.ca>
Subject: libident patch
Return-Receipt-To: George Lindholm <lindholm@ucs.ubc.ca>

Hi,
 a while ago I changed inn to use libident for auditing purposes. Recently
I discovered that when I tried to use inews on the new-server machine (which
does not run identd) that inews would complain due to the perror() calls that
libident does (the error message threw inews because they weren't expected).
The following patch does two things: 1) identifies that the error messages
are coming from the library (for a while there I was very confused over
where the messages that inews were seeing came from) and, 2) if the remote
site is not running identd, then no error message is produced.  
My inn patch is been accepted by Rich Salz for inn-1.5 so if these patches
could be incorporated it would save a lot of confusion in the future :-)
Thanks.

   George
George Lindholm                                  phone:    (604) 822-4375
University Computing Services, UBC               fax:      (604) 822-5116
6356 Agricultural Road, Vancouver, B.C., Canada  internet: lindholm@ucs.ubc.ca
V6T 1Z2

*** 1.1	1994/03/01 00:30:42
--- libident-0.11/id_open.c	1994/03/01 00:42:33
***************
*** 105,111 ****
      
      if (bind(id->fd, (struct sockaddr *) &sin_laddr, sizeof(sin_laddr)) < 0)
      {
! 	perror("bind");
  	goto ERROR;
      }
      
--- 105,111 ----
      
      if (bind(id->fd, (struct sockaddr *) &sin_laddr, sizeof(sin_laddr)) < 0)
      {
! 	perror("libident: bind");
  	goto ERROR;
      }
      
***************
*** 117,123 ****
      res = connect(id->fd, (struct sockaddr *) &sin_faddr, sizeof(sin_faddr));
      if (res < 0 && errno != EINPROGRESS)
      {
! 	perror("connect");
  	goto ERROR;
      }
      
--- 117,125 ----
      res = connect(id->fd, (struct sockaddr *) &sin_faddr, sizeof(sin_faddr));
      if (res < 0 && errno != EINPROGRESS)
      {
! 	if (errno != EADDRNOTAVAIL && errno != ECONNREFUSED) { /* Nobody there */
! 	    perror("libident: connect");
! 	}
  	goto ERROR;
      }
      
***************
*** 132,138 ****
  	
  	if ((res = select(FD_SETSIZE, &rs, &ws, &es, timeout)) < 0)
  	{
! 	    perror("select");
  	    goto ERROR;
  	}
  	
--- 134,140 ----
  	
  	if ((res = select(FD_SETSIZE, &rs, &ws, &es, timeout)) < 0)
  	{
! 	    perror("libident: select");
  	    goto ERROR;
  	}
  	



