From owner-freebsd-current Thu Jan 27 3:49:41 2000 Delivered-To: freebsd-current@freebsd.org Received: from fgwmail6.fujitsu.co.jp (fgwmail6.fujitsu.co.jp [192.51.44.36]) by hub.freebsd.org (Postfix) with ESMTP id 58B0214DF4 for ; Thu, 27 Jan 2000 03:49:34 -0800 (PST) (envelope-from shin@nd.net.fujitsu.co.jp) Received: from m3.gw.fujitsu.co.jp by fgwmail6.fujitsu.co.jp (8.9.3/3.7W-MX9912-Fujitsu Gateway) id UAA05228 for ; Thu, 27 Jan 2000 20:49:27 +0900 (JST) (envelope-from shin@nd.net.fujitsu.co.jp) Received: from chisato.nd.net.fujitsu.co.jp by m3.gw.fujitsu.co.jp (8.9.3/3.7W-9912-Fujitsu Domain Master) id UAA25874; Thu, 27 Jan 2000 20:49:26 +0900 (JST) Received: from localhost (dhcp7194.nd.net.fujitsu.co.jp [10.18.7.194]) by chisato.nd.net.fujitsu.co.jp (8.8.5+2.7Wbeta5/3.3W8chisato-970826) with ESMTP id UAA23991 for ; Thu, 27 Jan 2000 20:49:25 +0900 (JST) To: freebsd-current@freebsd.org Subject: realhostname_sa bug X-Mailer: Mew version 1.94 on Emacs 20.4 / Mule 4.0 (HANANOEN) X-Prom-Mew: Prom-Mew 1.93.4 (procmail reader for Mew) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000127205008V.shin@nd.net.fujitsu.co.jp> Date: Thu, 27 Jan 2000 20:50:08 +0900 From: Yoshinobu Inoue X-Dispatcher: imput version 990905(IM130) Lines: 47 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG There was a bug in realhostname_sa() in lib/libutil and sometime daemon using it dies, such as telnetd. I think following patch will fix it, but now checking make world before actually committing it. If anyone experienced same problem, please try following patch. Sorry for your troubles. Yoshinobu Inoue Index: realhostname.c =================================================================== RCS file: /home/ncvs/src/lib/libutil/realhostname.c,v retrieving revision 1.4 diff -u -r1.4 realhostname.c --- realhostname.c 2000/01/25 14:51:57 1.4 +++ realhostname.c 2000/01/27 11:37:08 @@ -122,8 +122,10 @@ port = ((struct sockinet *)addr)->si_port; ((struct sockinet *)addr)->si_port = 0; if (!memcmp(sa, addr, sa->sa_len)) { - strncpy(host, res->ai_canonname, - hsize); + if (res->ai_canonname != 0) + strncpy(host, + res->ai_canonname, + hsize); result = HOSTNAME_FOUND; ((struct sockinet *)addr)->si_port = port; @@ -146,8 +148,10 @@ if (IN6_IS_ADDR_V4MAPPED(in6) && !memcmp(&in6->s6_addr[12], in, sizeof(*in))) { - strncpy(host, res->ai_canonname, - hsize); + if (res->ai_canonname != 0) + strncpy(host, + res->ai_canonname, + hsize); result = HOSTNAME_FOUND; break; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message