Subject: pkg/10676: skkserv core dumps
To: None <gnats-bugs@gnats.netbsd.org>
From: None <yyamano@uis.tyo.otc.ogis-ri.co.jp>
List: netbsd-bugs
Date: 07/25/2000 06:35:12
>Number:         10676
>Category:       pkg
>Synopsis:       skkserv core dumps when gethostbyname() failed.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 25 06:36:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Yuji Yamano
>Release:        1.5_ALPHA
>Organization:
>Environment:
System: NetBSD bigfoot 1.5_ALPHA NetBSD 1.5_ALPHA (BIGFOOT) #3: Sat Jul 15 00:23:42 JST 2000 yyamano@bigfoot:/usr/src/sys/arch/i386/compile/BIGFOOT i386

>Description:
skkserv core dumps when gethostbyname() failed. 
I think it is caused by misconfiguration of nsswitch.conf or hosts,
but core dump is not good.

>How-To-Repeat:

Replace the `hosts:' line in nsswitch.conf with `hosts: files'.
Remove your host name in hosts.
Run /usr/pkg/etc/rc.d/skkserv.sh.

>Fix:
Here is the patch.

--- /tmp/skkserv.c	Tue Jul 25 00:46:44 2000
+++ skkserv.c	Tue Jul 25 00:56:06 2000
@@ -774,6 +774,10 @@
     exit(1);
   }
   hentry = gethostbyname(hname);
+  if (hentry == NULL) {
+    fprintf(errout, "%s:gethostbyname(%s) failed\n", pgmnm, hname);
+    exit(1);
+  }
 #ifdef NO_ADDR_LIST
   strcat(hname, ":");
   strcat(hname, hentry->h_addr);

>Release-Note:
>Audit-Trail:
>Unformatted: