$NetBSD: patch-af,v 1.7 2002/10/26 19:51:08 bouyer Exp $ --- daemon/slave.c.orig Mon Mar 5 01:29:54 2001 +++ daemon/slave.c Tue Oct 22 20:28:04 2002 @@ -457,11 +457,14 @@ gdm_setenv ("DISPLAY", d->name); gdm_setenv ("LOGNAME", login); gdm_setenv ("USER", login); +#ifndef HAVE_SETLOGIN gdm_setenv ("USERNAME", login); +#endif gdm_setenv ("HOME", pwent->pw_dir); gdm_setenv ("GDMSESSION", session); gdm_setenv ("SHELL", pwent->pw_shell); gdm_unsetenv ("MAIL"); /* Unset $MAIL for broken shells */ + gdm_unsetenv ("GROUP"); /* Special PATH for root */ if (pwent->pw_uid == 0) @@ -517,7 +520,11 @@ if (setgid (pwent->pw_gid) < 0) gdm_slave_exit (DISPLAY_REMANAGE, _("gdm_slave_session_start: Could not setgid %d. Aborting."), pwent->pw_gid); - +#ifdef HAVE_SETLOGIN + if (setlogin (login) < 0) + gdm_slave_exit (DISPLAY_REMANAGE, + _("gdm_slave_session_start: Could not set login name %s. Aborting."), login); +#endif if (initgroups (login, pwent->pw_gid) < 0) gdm_slave_exit (DISPLAY_REMANAGE, _("gdm_slave_session_start: initgroups() failed for %s. Aborting."), login);