summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2006-04-08 00:22:23 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2006-04-08 00:22:23 +0000
commit2900b8984d8fdce182b87f0ce7a2f5813ea0b53f (patch)
tree74c2e27d366eab28f5ca040860180071cd38a365 /session.c
parentc9fcce730483358594c9556426098ac3325da47f (diff)
Xorg bug #4765 <https://bugs.freedesktop.org/show_bug.cgi?id=4765> Patch
#3555 <https://bugs.freedesktop.org/attachment.cgi?id=3555> xdm doesn't work with the pam_krb5 module (call pam_getenvlist after pam_setcred) (Constantine Sapuntzakis)
Diffstat (limited to 'session.c')
-rw-r--r--session.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/session.c b/session.c
index b741fbc..a6e2605 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: app/xdm/session.c,v 1.4 2006/02/25 02:21:51 alanc Exp $ */
+/* $XdotOrg: app/xdm/session.c,v 1.5 2006/03/16 21:46:55 alanc Exp $ */
/* $Xorg: session.c,v 1.8 2001/02/09 02:05:40 xorgcvs Exp $ */
/*
@@ -570,17 +570,6 @@ StartClient (
/* Do system-dependent login setup here */
-#ifdef USE_PAM
- /* pass in environment variables set by libpam and modules it called */
- if (pamh) {
- long i;
- char **pam_env = pam_getenvlist(pamh);
- for(i = 0; pam_env && pam_env[i]; i++) {
- verify->userEnviron = putEnv(pam_env[i], verify->userEnviron);
- }
- }
-#endif
-
#ifdef USESECUREWARE
Debug ("set_identity: uid=%d\n", userp->pw.pw_uid);
ret = smp_set_identity (userp, &reason, &smpenv, &smpshell);
@@ -632,12 +621,22 @@ StartClient (
#endif /* QNX4 doesn't support multi-groups, no initgroups() */
#ifdef USE_PAM
if (pamh) {
+ long i;
+ char **pam_env;
+
pam_error = pam_setcred (pamh, PAM_ESTABLISH_CRED);
if (pam_error != PAM_SUCCESS) {
LogError ("pam_setcred for \"%s\" failed: %s\n",
name, pam_strerror(pamh, pam_error));
return(0);
}
+
+ /* pass in environment variables set by libpam and modules it called */
+ pam_env = pam_getenvlist(pamh);
+ for(i = 0; pam_env && pam_env[i]; i++) {
+ verify->userEnviron = putEnv(pam_env[i], verify->userEnviron);
+ }
+
}
#endif
if (setuid(verify->uid) < 0) {