After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319564 - utmpx record incorrect when multiple users have the same uid
utmpx record incorrect when multiple users have the same uid
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.11.x
Other Solaris
: Normal minor
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-23 22:17 UTC by Laszlo (Laca) Peter
Modified: 2006-02-14 09:01 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
getpwnam patch (601 bytes, patch)
2005-10-23 22:18 UTC, Laszlo (Laca) Peter
committed Details | Review

Description Laszlo (Laca) Peter 2005-10-23 22:17:00 UTC
Distribution/Version: 5.x

A minor issue...

It's pretty normal on Unix systems to have multiple users with the same
user id.  For example I have a 'laca' and a 'laca-gtest' user for testing
GNOME builds but not sharing my HOME directory.

In a situation like this, vte always puts the same user name in the utmp/utmpx
record because it does a getpwuid lookup on the userid.

The attached patch uses getpwnam to look up $LOGNAME first and checks if the
returned uid matches getuid().  If either of these fails, it falls back to
getpwuid.
Comment 1 Laszlo (Laca) Peter 2005-10-23 22:18:25 UTC
Created attachment 53812 [details] [review]
getpwnam patch
Comment 2 Olav Vitters 2005-10-23 22:51:54 UTC
Please also fix bug 317312 :-)
Comment 3 Behdad Esfahbod 2006-02-14 07:08:40 UTC
We accepted a similar change in glib too.  I'm going to commit this one.
Comment 4 Behdad Esfahbod 2006-02-14 09:01:23 UTC
Thanks.  I committed a slightly modified version of your patch.

2006-02-14  Behdad Esfahbod  <behdad@gnome.org>

        * gnome-pty-helper/gnome-pty-helper.c (main): Use getpwnam to
        correctly log multiple users with the same UID. (bug #319564,
        patch from Laszlo (Laca) Peter.