diff options
author | Jean-Marc Zucconi <jmz@FreeBSD.org> | 2002-03-05 23:35:26 +0000 |
---|---|---|
committer | Jean-Marc Zucconi <jmz@FreeBSD.org> | 2002-03-05 23:35:26 +0000 |
commit | 47009eab1c564a5a34b9e5f0f1dc2b774cf0ccc6 (patch) | |
tree | 0e9bdeb1835f8a36bbb317d2fcbd41c81dff8e6d /x11/XFree86-4 | |
parent | 7b6630a8cd9ba4be78db533732dd678b086d4c63 (diff) | |
download | ports-47009eab1c564a5a34b9e5f0f1dc2b774cf0ccc6.tar.gz ports-47009eab1c564a5a34b9e5f0f1dc2b774cf0ccc6.zip |
Fix PAM bogons in xdm.
Submitted by: des
Notes
Notes:
svn path=/head/; revision=55603
Diffstat (limited to 'x11/XFree86-4')
-rw-r--r-- | x11/XFree86-4/files/patch-xdm | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/x11/XFree86-4/files/patch-xdm b/x11/XFree86-4/files/patch-xdm index c7c2d43dce28..36fcc1035e52 100644 --- a/x11/XFree86-4/files/patch-xdm +++ b/x11/XFree86-4/files/patch-xdm @@ -1,27 +1,37 @@ ---- programs/xdm/session.c.orig Wed May 30 00:56:22 2001 -+++ programs/xdm/session.c Fri Sep 28 23:25:16 2001 -@@ -541,6 +541,7 @@ - int pid; - #ifdef HAS_SETUSERCONTEXT - struct passwd* pwd; -+ extern char **environ; +--- programs/xdm/session.c.orig Tue Feb 19 23:36:19 2002 ++++ programs/xdm/session.c Tue Feb 19 23:51:21 2002 +@@ -573,11 +573,13 @@ + #ifdef USE_PAM + /* pass in environment variables set by libpam and modules it called */ + if (pamh) { +- long i; ++ int i; + char **pam_env = pam_getenvlist(pamh); + for(i = 0; pam_env && pam_env[i]; i++) { + verify->userEnviron = putEnv(pam_env[i], verify->userEnviron); ++ free(pam_env[i]); + } ++ free(pam_env); + } #endif - #ifdef USE_PAM - pam_handle_t *pamh = thepamh(); -@@ -623,6 +624,8 @@ - * Set the user's credentials: uid, gid, groups, - * environment variables, resource limits, and umask. - */ -+ /* destroy user environment before calling setusercontext */ -+ environ = verify->userEnviron; + +@@ -623,12 +625,19 @@ pwd = getpwnam(name); if (pwd) { -@@ -632,6 +635,7 @@ ++ extern char **environ; ++ char **saved_environ = environ; ++ ++ environ = verify->userEnviron; + if (setusercontext(NULL, pwd, pwd->pw_uid, LOGIN_SETALL) < 0) + { ++ environ = saved_environ; + LogError("setusercontext for \"%s\" failed, errno=%d\n", name, errno); return (0); } -+ verify->userEnviron = environ; ++ verify->userEnviron = environ; ++ environ = saved_environ; endpwent(); } else |