GNOME Bugzilla – Bug 319564
utmpx record incorrect when multiple users have the same uid
Last modified: 2006-02-14 09:01:23 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.
Created attachment 53812 [details] [review] getpwnam patch
Please also fix bug 317312 :-)
We accepted a similar change in glib too. I'm going to commit this one.
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.