Subject: Re: ssh.com oddity
To: Tero Kivinen <email@example.com>
From: Sean Davis <firstname.lastname@example.org>
Date: 10/07/2002 00:20:58
On Mon, Oct 07, 2002 at 05:48:32AM +0300, Tero Kivinen wrote:
> email@example.com (Sean Davis) writes:
> > 2) has anyone else running ssh.com ssh 3.2.0's sshd2 on -current noticed
> > that when a user logs in, it is not recorded in utmp/wtmp, and thus does not
> > show up on w/who or related utilities? if so, any ideas on how to fix? (I am
> > trying something I extrapolated from the patches to the 1.x version, but i
> > don't have much confidence in it working.)
> The configure detects that the netbsd now haves utmpx file and only
> writes stuff to there. I do not know if it should write stuff to only
> to utmp or only to utmpx or to both. The following patch will modify
> it so that lib/sshsession/wtmp.c writes to both files, and that seems
> to fix the not seeing users on netbsd 1.6 problem.
> The code has another problem caused by the patch, as now the utmpx.h
> defines the DEAD_PROCESS and the utmp code thinks that if that symbol
> exists then the utmp will have ut_type field. I fixed it by adding
> defined(HAVE_UT_TYPE_IN_UTMP) there which will never be defined (as
> there is no matching test in configure.in), but in netbsd that is ok
> and everything seems to work.
This patch works for logging in, but not logging out. As soon as i logout, w
w: Stale utmp entry: dive ttyp7 localhost
I had fixed (kludged?) this before by replacing logout((char *)line)) on
line 588 of lib/sshsession/wtmp.c with
logoutx((char *)line,0,DEAD_PROCESS), which worked. I got that usage from
looking at what OpenSSH does...
/~\ The ASCII
\ / Ribbon Campaign Sean Davis
X Against HTML aka dive
/ \ Email!