sshd doesn't log hostname into utmp correctly [resend]

Hajimu UMEMOTO ume at FreeBSD.org
Sat Dec 14 01:37:11 EST 2002


Hi,

>>>>> On Tue, 20 Aug 2002 08:20:20 -0700
>>>>> Kevin Steves <kevin at atomicgears.com> said:

kevin> On Wed, Aug 21, 2002 at 12:05:45AM +0900, Hajimu UMEMOTO wrote:
> Ah yes, FreeBSD has some hack to store utmp entry by calling
> realhostname_sa().  Sorry for my lacking of consideration around
> FreeBSD hack.
> In anyway, it is a potential problem that record_login() copies addr
> just sizeof(struct sockaddr) regardless of actual size.  Please
> consider to fix it by applying my previous patch.

kevin> yes i agree, we should add your fix.  thanks again.

Thank you for merging the patch.  However, I realized that
unfortunately the merging is incomplete, and 3.5p1 still has the
problem.  Please apply the attached patch in your next release.

Index: sshlogin.c
diff -u sshlogin.c.orig sshlogin.c
--- sshlogin.c.orig	Wed Sep  4 15:45:11 2002
+++ sshlogin.c	Fri Dec 13 16:42:17 2002
@@ -70,7 +70,7 @@
   struct logininfo *li;
 
   li = login_alloc_entry(pid, user, host, ttyname);
-  login_set_addr(li, addr, sizeof(struct sockaddr));
+  login_set_addr(li, addr, addrlen);
   login_login(li);
   login_free_entry(li);
 }

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume at mahoroba.org  ume at bisd.hitachi.co.jp  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/



More information about the openssh-unix-dev mailing list