1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
$NetBSD: patch-af,v 1.1.1.1 2004/01/20 13:33:14 xtraeme 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);
|