Commit 226ba9f3 authored by Behdad Esfahbod's avatar Behdad Esfahbod Committed by Behdad Esfahbod

Use getpwnam to correctly log multiple users with the same UID. (bug

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.
parent 46cdab5b
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.
2006-02-13 Behdad Esfahbod <behdad@gnome.org>
* src/vte.c (update_timeout): Only discontinue timer if nothing
......
......@@ -670,10 +670,24 @@ main (int argc, char *argv [])
int res, n;
void *tag;
GnomePtyOps op;
const char *logname;
sanity_checks ();
pwent = getpwuid (getuid ());
pwent = NULL;
logname = getenv ("LOGNAME");
if (logname != NULL) {
pwent = getpwnam (logname);
if (pwent != NULL && pwent->pw_uid != getuid ()) {
/* LOGNAME is lying, fall back to looking up the uid */
pwent = NULL;
}
}
if (pwent == NULL)
pwent = getpwuid (getuid ());
if (pwent)
login_name = pwent->pw_name;
else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment