Bug 244807 - "who" doesn't show the logged in user
Summary: "who" doesn't show the logged in user
Status: CLOSED DUPLICATE of bug 222847
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xterm   
(Show other bugs)
Version: 5.0
Hardware: i686
OS: Linux
Target Milestone: ---
: ---
Assignee: Miroslav Lichvar
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2007-06-19 10:46 UTC by uludwig
Modified: 2007-11-30 22:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-07-31 10:42:11 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
small programm to read and print utmp (5.45 KB, application/octet-stream)
2007-06-19 10:49 UTC, uludwig
no flags Details

Description uludwig 2007-06-19 10:46:38 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv: Gecko/20070515 Firefox/

Description of problem:
When I am logged in with gnome and the only terminals open are xterm I do not get the correct information about me being logged in with the command "who" nor "w".

When I open one of the standard terminals"who" (or "w") prints out the correct information.

I assume there is a problem  with utmp. I have a little piece of code that reads the utmp with getutxent(). No USER_PROCESS is in the list if no standard terminal is open. When I open a terminal (not xterm) there is a USER_PROCESS in the list. When I close this terminal this entry changes to DEAD_PROCESS and will not disappear until the next reboot.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Login with gnome desktop. No terminal should open automatically.
2. Press Alt-F2 for a command line and enter xterm.
3. Launch who in the xterm. No output will appear.

Possibility 2:
1. Login with kde desktop. No terminal should open automatically.
2. Press Alt-F2 for a command line and enter xterm.
3. Launch who in the xterm. No outpur will appear.
4. Open a konsole and launch who. No output will appear.

Actual Results:
No output from "who". From "w" just the head line:

[uludwig@uranus ~]$ w
 12:44:37 up 19:44,  1 user,  load average: 0.06, 0.05, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT

[uludwig@uranus ~]$ who
[uludwig@uranus ~]$

Expected Results:

Additional info:
We use getutxent() to determine if a user logged in locally. Since Red Hat EL 5 this doesn't work anymore. We need this urgently!!

Comment 1 uludwig 2007-06-19 10:49:07 UTC
Created attachment 157359 [details]
small programm to read and print utmp

Comment 2 Jim Meyering 2007-06-20 05:52:02 UTC
Thanks for the report.  However, it sounds like you're reporting that who DOES
accurately report the contents of the utmp file.  If not, please include the
output who prints along with the corresponding utmp/wtmp file.

Have you read about xterm's -ls option?

Someone reported a similar mismatch between their expectations and who's behavior.
Here's the reply, in case it helps:


Comment 3 uludwig 2007-06-20 13:07:11 UTC
You are right. My report should be a different one. Sorry. 
More like: "No login information is written to utmp"

If I login (gnome or kde or fvwm) this is not logged into utmp correctly. The
corresponding entry appears if I open a gnome-terminal. But if I open a xterm no
entry is made. Even if I launch xterm -ls there is no entry in the utmp file.

I need to determine if a user is logged, who is logged in and if he is logged in
to :0 or remotely. This used to work with previous versions of RH EL.

Comment 4 Tim Waugh 2007-06-25 14:55:25 UTC
It sounds like your problem is about the xterm program.

Comment 5 Miroslav Lichvar 2007-06-25 15:13:39 UTC
It's a problem with xterm and utempter access permissions. The xterm binary
needs setgid utempter to make utmp entries.

Comment 7 Miroslav Lichvar 2007-07-31 10:42:11 UTC

*** This bug has been marked as a duplicate of 222847 ***

Comment 8 Steve Cleveland 2007-08-13 21:03:29 UTC
This bug is marked as a duplicate of 222847, but I don't have permission to view
that bug report, so I'm posting here.

From past experience, logging into gnome should update utmp.  That's where the
problem is.  It shouldn't require opening xterm or gnome-terminal.

Also, of note, if I do 'strings /var/log/wtmp | grep <user>', I see the user
listed.  But 'strings /var/run/utmp | grep <user>', I don't see them listed.

Comment 9 Miroslav Lichvar 2007-08-20 08:19:22 UTC
Steve, please file a bug report against a gnome component, this bug and bug
#222847 is for xterm.

Comment 10 Sigurd Mytting 2007-10-01 13:53:26 UTC
I don't have permission to view 222847, this problem still exits on a fully
updated RHEL5 client; setting group on the xterm-binary and making it sgid does
not work (hey, I've even tried suid to root on the xterm binary without success
- just like it used to be in the olden days:-)

Since this bug has been closed, could someone with access to 222847 either open
it for the rest of us or tell us what's going on?


Comment 11 Miroslav Lichvar 2007-10-02 12:50:48 UTC
The updated package should be in RHEL 5.1.

You can make the binary setgid utempter with:

chown root:utempter /usr/bin/xterm
chmod 2755 /usr/bin/xterm

Comment 12 Sigurd Mytting 2007-10-03 12:16:55 UTC
Thanks! :-)

Note You need to log in before you can comment on or make changes to this bug.