Subject: bin/5227: Identd dose not wait for its child processes.
To: None <gnats-bugs@gnats.netbsd.org>
From: Takahiro Kanbe <taca@sky.yamashina.kyoto.jp>
List: netbsd-bugs
Date: 03/29/1998 14:41:45
>Number:         5227
>Category:       bin
>Synopsis:       Identd dose not wait for its child processes.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 28 21:50:00 1998
>Last-Modified:
>Originator:     Takahiro Kanbe
>Organization:
>Release:        NetBSD 1.3.1
>Environment:
	
System: NetBSD ns.sky.yamashina.kyoto.jp 1.3.1 NetBSD 1.3.1 (NS) #8: Wed Mar 25 01:07:22 JST 1998 root@ns.sky.yamashina.kyoto.jp:/usr/src/sys/arch/i386/compile/NS i386


>Description:
	Identd process dose not wait for its child process, and zombie process
	remains until the process exit with timeout.
>How-To-Repeat:
	1. Enable ident lookup function of sendmail
	2. Send many mail to many receipts.
>Fix:

*** identd.c.ORIG	Wed Oct  8 20:19:28 1997
--- identd.c	Sat Mar 28 02:43:43 1998
***************
*** 103,108 ****
--- 103,109 ----
  
  char *clearmem __P((char *, int));
  static SIGRETURN_TYPE alarm_handler __P((int));
+ static SIGRETURN_TYPE child_handler __P((int));
  int main __P((int, char *[]));
  
  /*
***************
*** 167,179 ****
    exit(0);
  }
  
! #if !defined(hpux) && !defined(__hpux) && !defined(SVR4) && !defined(__NetBSD__) || defined(_CRAY)
  /*
  ** This is used to clean up zombie child processes
  ** if the -w or -b options are used.
  */
  static SIGRETURN_TYPE
! child_handler()
  {
  #if defined(IRIX) || defined(NeXT)
    union wait status;
--- 168,181 ----
    exit(0);
  }
  
! #if !defined(hpux) && !defined(__hpux) && !defined(SVR4) || defined(_CRAY)
  /*
  ** This is used to clean up zombie child processes
  ** if the -w or -b options are used.
  */
  static SIGRETURN_TYPE
! child_handler(dummy)
! 	int dummy;
  {
  #if defined(IRIX) || defined(NeXT)
    union wait status;
***************
*** 475,484 ****
      ** handshake.
      */
  #if (defined(SVR4) || defined(hpux) || defined(__hpux) || \
!      defined(__NetBSD__) || defined(_CRAY) || defined(_AUX_SOURCE))
      signal(SIGCHLD, SIG_IGN);
  #else
!     signal(SIGCHLD, (SIGRETURN_TYPE (*)()) child_handler);
  #endif
      
      /*
--- 477,486 ----
      ** handshake.
      */
  #if (defined(SVR4) || defined(hpux) || defined(__hpux) || \
!      defined(_CRAY) || defined(_AUX_SOURCE))
      signal(SIGCHLD, SIG_IGN);
  #else
!     signal(SIGCHLD, child_handler);
  #endif
      
      /*

>Audit-Trail:
>Unformatted: