From: ephraim@think.com (Ephraim Vishniac)
Newsgroups: alt.wais
Subject: Re: Trouble with WAISSERVER on Sun Sparc
Date: 6 Nov 1992 18:51:20 GMT
Organization: Thinking Machines Corporation, Cambridge MA, USA
NNTP-Posting-Host: charon.think.com

In article <1992Nov6.173547.4522@elroy.jpl.nasa.gov> ann@euclid.jpl.nasa.gov writes:
>Does anyone have any experience with waisservers that commit suicide
>when contacted by remote clients?  I am running wais-8-b5 on a SUN
>Sparc.  Local clients have no problem.  Remote clients kill the server.
>Is this some kind of internet security type problem?  Or the waisserver
>software?

This is a popular problem. Here's the official patch:

0028744TMC
Mail to server-tmc
Jonny Goldman <jonathan@Think.COM>
920826
Message-Id: <9208261611.AA00383@philo.quake.think.com>
patch to server.c and sockets.c [Jonny Goldman <jonathan@Think.COM> Wed, 26 Aug 92 09:11:47
PDT]
Date: Wed, 26 Aug 92 09:11:47 PDT
From: Jonny Goldman <jonathan@Think.COM>
To: wais-talk@Think.COM

There is a bug in the code that resolves domain names from IP addresses in
the server.  If the name cannot be resolved, the server may dump core.

This patch fixes that problem:

*** server.c.orig	Sun May 10 14:47:38 1992
--- server.c	Wed Aug 26 09:00:36 1992
***************
*** 439,458 ****
  
        peer = gethostbyaddr(&source.sin_addr, 4, AF_INET);
  
!       if(peer != NULL)
  	sprintf(host_name, "%s", peer->h_name);
  
!       sprintf(host_address, "%s",
  #if defined(sparc) && defined(__GNUC__)
! 	      inet_ntoa(&source.sin_addr)
  #else
! 	      inet_ntoa(source.sin_addr)
! #endif /* sparc */
! 	      );
      }
      else sprintf(host_address, "Error getting socket: %d, %s.", errno, sys_errlist[errno]);
  
!     use_stdio = TRUE;
    }
  
    if (argc == 0){
--- 439,459 ----
  
        peer = gethostbyaddr(&source.sin_addr, 4, AF_INET);
  
!       if(peer != NULL) {
  	sprintf(host_name, "%s", peer->h_name);
  
! 	sprintf(host_address, "%s",
  #if defined(sparc) && defined(__GNUC__)
! 		inet_ntoa(&source.sin_addr)
  #else
! 		inet_ntoa(source.sin_addr)
! #endif				/* sparc */
! 		);
!       }
      }
      else sprintf(host_address, "Error getting socket: %d, %s.", errno, sys_errlist[errno]);
  
!    use_stdio = TRUE;
    }
  
    if (argc == 0){
*** sockets.c.orig	Wed May  6 17:34:00 1992
--- sockets.c	Wed Aug 26 09:01:42 1992
***************
*** 187,201 ****
  
      peer = gethostbyaddr(&source.sin_addr, 4, AF_INET);
  
!     waislog(WLOG_MEDIUM, WLOG_CONNECT,
! 	    "Accepted connection from: %s [%s]",
! 	    peer->h_name,
  #if defined(sparc) && defined(__GNUC__)
! 	    inet_ntoa(&source.sin_addr)
  #else
! 	    inet_ntoa(source.sin_addr)
! #endif /* sparc */
! 	    );
    }
    if (*fd < 0)
      panic("can't accept connection");
--- 187,213 ----
  
      peer = gethostbyaddr(&source.sin_addr, 4, AF_INET);
  
!     if(peer != NULL) {
!       waislog(WLOG_MEDIUM, WLOG_CONNECT,
! 	      "Accepted connection from: %s [%s]",
! 	      peer->h_name,
  #if defined(sparc) && defined(__GNUC__)
! 	      inet_ntoa(&source.sin_addr)
  #else
! 	      inet_ntoa(source.sin_addr)
! #endif				/* sparc */
! 	      );
!     }
!     else {
!       waislog(WLOG_MEDIUM, WLOG_CONNECT,
! 	      "Accepted connection from: [%s]",
! #if defined(sparc) && defined(__GNUC__)
! 	      inet_ntoa(&source.sin_addr)
! #else
! 	      inet_ntoa(source.sin_addr)
! #endif				/* sparc */
! 	      );
!     }
    }
    if (*fd < 0)
      panic("can't accept connection");

-- 
Ephraim Vishniac    ephraim@think.com   ThinkingCorp@applelink.apple.com
 Thinking Machines Corporation / 245 First Street / Cambridge, MA 02142
        One of the flaws in the anarchic bopper society was
        the ease with which such crazed rumors could spread.
Newsgroups: alt.wais