Subject: bin/31072: w doesn't update ownership of tty
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <zafer@gmx.org>
List: netbsd-bugs
Date: 08/25/2005 22:34:00
>Number:         31072
>Category:       bin
>Synopsis:       w  doesn't update ownership of tty
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 25 22:34:00 +0000 2005
>Originator:     Zafer Aydogan
>Release:        3.99.8
>Organization:
>Environment:
i386
>Description:
When logging in as a user and then relogin as a different user command 'w' shows wrong ownership of tty and time.

Login as a user on console:

$ tty
/dev/console

$ w
USER TTY FROM LOGIN IDLE WHAT
zafer console - 2:10AM 0 w

now use login to relogin as another user.

$ login root
Password:

Welcome to NetBSD!
# tty
/dev/console

# w
USER TTY FROM LOGIN IDLE WHAT
zafer console - 2:10AM 0 w

^^^ this should be root

# ls -l `tty`
crw------- 1 root tty 0,0,Aug 26 02:23 /dev/console

utmp is updated. w shows wrong info. and wrong time.

# date
Fri Aug 26 02:22:27 CEST 2005

# w
USER TTY FROM LOGIN IDLE WHAT
zafer console - 2:10AM 0 w

time is always 2:10AM


This does not happen, if you log in as root first:

Login as root on console:
# tty
/dev/console
# w
USER TTY FROM LOGIN@ IDLE WHAT
root console - 2:25AM 0 w

Now use login to relogin as another user

# login zafer
Password:

Welcome to NetBSD!

$ tty
/dev/console

$ w
USER TTY FROM LOGIN IDLE WHAT
zafer console - 2:27AM 0 w

But here also time stands still. it is always 2:27AM


>How-To-Repeat:

>Fix: