NetBSD Problem Report #17803

Received: (qmail 24667 invoked by uid 605); 2 Aug 2002 03:16:58 -0000
Message-Id: <20020802031656.18229.qmail@qmail.endersgame.net>
Date: 2 Aug 2002 03:16:56 -0000
From: dive@endersgame.net
Sender: gnats-bugs-owner@netbsd.org
Reply-To: dive@endersgame.net
To: gnats-bugs@gnats.netbsd.org
Subject: logout() does not log out a tty logged in with login()
X-Send-Pr-Version: 3.95

>Number:         17803
>Category:       lib
>Synopsis:       logout() does not seem to log out a tty logged in with login()
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 02 03:17:00 +0000 2002
>Closed-Date:    
>Last-Modified:  
>Originator:     dive
>Release:        NetBSD 1.6E
>Organization:
>Environment:
System: NetBSD eros.endersgame.net 1.6E NetBSD 1.6E (EROS) #360: Sat Jul 27 06:51:10 EDT 2002 dive@eros.endersgame.net:/disk2/a/cvs/netbsd/current/src/sys/arch/i386/compile/EROS i386
Architecture: i386
Machine: i386
>Description:
ssh.com's ssh 3.2.0 sshd2 server uses libutil login() and logout() to log
users in and out of utmp. For as long as I have been running ssh.com's
sshd2, utmp hasn't been updated right (or at all)
at first, up to today, users never got entered into utmp at all when logging
in over ssh. a user could log in, and would never show up in w. this changed
after updating this morning, i believe due to the utmpx stuff. Now when a
user logs in to ssh, they show up in w/who correctly, but when they log out,
they leave a stale utmp entry, and w complains as such. I have tested with a
hand-rolled program to call logout("ttyXX"), and logout never logs out a
tty, no matter what it is called with. For example, I had 'ttyp2' with a
stale utmp entry, and tried logout("ttyp2") which returned 0, logout("p2")
returned 0, logout("/dev/ttyp2") returned 0.
I strings'd /var/run/utmpx and found ttyp2 with a '2' nearby, so tried
logoutx("ttyp2",2,2) (I am almost positive that the second and third
arguments aren't technically right, but there is no man page for logoutx)
and it worked.
To summarize, logout() should log out a tty if it was logged in with
login(). I checked through the ssh 3.2.0 server source, and it does *not*
use loginx, so there is no reason it should have to use logoutx to log the
tty out.
>How-To-Repeat:
install ssh 3.2.0 from ssh.com on a -current machine. observe problems with
utmp when users log in/out.
>Fix:
a workaround, albiet a kludgy one, is to make lib/sshsession/wtmp.c call
logoutx((char *)line,2,2) instead of logout((char *)line)
>Release-Note:
>Audit-Trail:
>Unformatted:
 current as of 20020801

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.