From owner-IPv6-jp@jp.freebsd.org  Thu Nov 11 04:47:23 1999
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id EAA56330;
	Thu, 11 Nov 1999 04:47:23 +0900 (JST)
	(envelope-from owner-IPv6-jp@jp.FreeBSD.org)
Received: from tortoise.jp.freebsd.org (root@tortoise.jp.FreeBSD.ORG [210.157.158.41])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id EAA56325
	for <IPv6-jp@jp.freebsd.org>; Thu, 11 Nov 1999 04:47:22 +0900 (JST)
	(envelope-from ume@mahoroba.org)
Received: from peace.mahoroba.org (IDENT:AdaGoGTHgDKAxwRxcasplacKJxyShElKmPvutOjdhPYX3X+NUyOxBe/F3OgLmn9v@peace.calm.imasy.or.jp [3ffe:505:2:0:200:f8ff:fe05:3eae])
	by tortoise.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP/IPv6 id EAA14509
	for <IPv6-jp@jp.freebsd.org>; Thu, 11 Nov 1999 04:46:49 +0900 (JST)
	(envelope-from ume@mahoroba.org)
Received: from localhost (IDENT:61LFaEErwb1dJefly8W1FO60HxNNhG7S0cgCaBwwUi++ua6UFIbP9IPBY4v5aJb3@localhost [::1])
	by peace.mahoroba.org (8.10.0.Beta6/3.7W-peace) with ESMTP id dAAJlD851493
	for <IPv6-jp@jp.freebsd.org>; Thu, 11 Nov 1999 04:47:13 +0900 (JST)
	(envelope-from ume@mahoroba.org)
Date: Thu, 11 Nov 1999 04:47:13 +0900 (JST)
Message-Id: <199911101947.dAAJlD851493@peace.mahoroba.org>
To: IPv6-jp@jp.freebsd.org
In-Reply-To: <19991109215232U.fujiwara@rcac.tdi.co.jp>
References: <19991109215232U.fujiwara@rcac.tdi.co.jp>
X-Mailer: xcite1.20> Mew version 1.95b3 on Emacs 20.4 / Mule 4.0
 =?iso-2022-jp?B?KBskQjJWMWMbKEIp?=
X-PGP-Public-Key: http://www.imasy.org/~ume/publickey.asc
X-PGP-Fingerprint: 6B 0C 53 FC 5D D0 37 91  05 D0 B3 EF 36 9B 6A BC
X-URL: http://www.imasy.org/~ume/
Mime-Version: 1.0
Content-Type: Multipart/Mixed;
 boundary="--Next_Part(Thu_Nov_11_04:47:09_1999_416)--"
Content-Transfer-Encoding: 7bit
From: Hajimu UMEMOTO (=?ISO-2022-JP?B?GyRCR19LXBsoQiA=?=
	=?ISO-2022-JP?B?GyRCSCUbKEI=?=) <ume@mahoroba.org>
X-Dispatcher: imput version 991025(IM133)
Lines: 77
Reply-To: IPv6-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+990727
X-Sequence: IPv6-jp 338
Subject: [IPv6-jp 338] Re: openssh6
Errors-To: owner-IPv6-jp@jp.freebsd.org
Sender: owner-IPv6-jp@jp.freebsd.org
X-Originator: ume@mahoroba.org

----Next_Part(Thu_Nov_11_04:47:09_1999_416)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit

  $BG_K\!w(BIMASY$B$G$9!#(B

>>> Tue, 09 Nov 1999 21:52:32 +0900 (JST) $B$N9o$K!V(Bfujiwara$B!W!"$9$J$o$A(B
>>> fujiwara@rcac.tdi.co.jp $B;a[)$/(B

fujiwara> http://www.rcac.tdi.co.jp/fujiwara/openssh6.tar.gz

  OpenSSH $B$G$O(B utmp $B$K%[%9%HL>$r$=$N$^$^F~$l$k$N$G!"$V$C$?@Z$l$?%[%9%H(B
$BL>$r(B DNS $B$K5a$a$K9T$/$N$G!"%@%$%"%k%"%C%W$@$HHa$7$$!#(B;_;
  $B$H$$$&$o$1$G!"$3$l$r2sHr$9$k%Q%C%A$G$9!#%[%9%HL>$N%I%a%$%sIt$,F1$8$@$C(B
$B$?>l9g$K!"%I%a%$%sIt$r<h$j=|$$$?$b$N$r(B utmp $B$K3JG<$7$^$9!#(BNetBSD $B$N(B 
ssh $B$N(B pkgsrc $B$+$i;}$C$FMh$^$7$?!#(B

----Next_Part(Thu_Nov_11_04:47:09_1999_416)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Description: patch-ca
Content-Disposition: attachment; filename=patch-ca

--- login.c.orig	Thu Nov 11 04:05:32 1999
+++ login.c	Thu Nov 11 03:57:36 1999
@@ -71,12 +71,27 @@
   struct utmp u;
   const char *utmp, *wtmp;
 
+  char myname[MAXHOSTNAMELEN];
+  char shost[MAXHOSTNAMELEN];
+  char *p = NULL, *q = NULL;
+
+  memset(shost, 0, sizeof(shost));
+  gethostname(myname, MAXHOSTNAMELEN);
+  if (((p = memchr(myname, '.', MAXHOSTNAMELEN)) != NULL)
+    && ((q = strchr(host, '.')) != NULL)
+    && (strncmp(p, q, MAXHOSTNAMELEN - (p - myname)) == 0)) {
+    strncpy(shost, host, q - host);
+  }
+
   /* Construct an utmp/wtmp entry. */
   memset(&u, 0, sizeof(u));
   strncpy(u.ut_line, ttyname + 5, sizeof(u.ut_line));
   u.ut_time = time(NULL);
   strncpy(u.ut_name, user, sizeof(u.ut_name));
-  strncpy(u.ut_host, host, sizeof(u.ut_host));
+  if ((*shost != '\0') && (strlen(shost) <= sizeof(u.ut_host)))
+    strncpy(u.ut_host, shost, sizeof(u.ut_host));
+  else
+    strncpy(u.ut_host, host, sizeof(u.ut_host));
 
   /* Figure out the file names. */
   utmp = _PATH_UTMP;
@@ -96,7 +111,10 @@
       /* Update lastlog. */
       ll.ll_time = time(NULL);
       strncpy(ll.ll_line, ttyname + 5, sizeof(ll.ll_line));
-      strncpy(ll.ll_host, host, sizeof(ll.ll_host));
+      if ((*shost != '\0') && (strlen(shost) <= sizeof(ll.ll_host)))
+        strncpy(ll.ll_host, shost, sizeof(ll.ll_host));
+      else
+        strncpy(ll.ll_host, host, sizeof(ll.ll_host));
       fd = open(lastlog, O_RDWR);
       if (fd >= 0)
 	{

----Next_Part(Thu_Nov_11_04:47:09_1999_416)--
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Content-Description: My signature

$BG_K\(B $BH%(B $B!w(B $B%$%s%?!<%M%C%H8_=u2q2#IM(B
ume@mahoroba.org  ume@bisd.hitachi.co.jp  http://www.imasy.org/~ume/
$B%W%m%0%i%`$O=q$$$??M$N0U?^$G$O$J$/=q$+$l$?DL$jF0$/(B

----Next_Part(Thu_Nov_11_04:47:09_1999_416)----
