aboutsummaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2008-07-23 09:23:42 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2008-07-23 09:23:42 +0000
commit490bfaade9fd39fe364761a9abb9e53381c5571c (patch)
tree043f54862360ff8a1158c881c9634f7ee0cd52b9 /session.c
parent8211d6b01828096abeefb4a88cd06030d0097c10 (diff)
downloadsrc-490bfaade9fd39fe364761a9abb9e53381c5571c.tar.gz
src-490bfaade9fd39fe364761a9abb9e53381c5571c.zip
Vendor import of OpenSSH 4.7p1 for posterity's sakevendor/openssh/4.7p1
Notes
Notes: svn path=/vendor-crypto/openssh/dist/; revision=180744 svn path=/vendor-crypto/openssh/4.7p1/; revision=180745; tag=vendor/openssh/4.7p1
Diffstat (limited to 'session.c')
-rw-r--r--session.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/session.c b/session.c
index 4c97c4a7dddd..9a606ef8feb4 100644
--- a/session.c
+++ b/session.c
@@ -1310,7 +1310,7 @@ do_setusercontext(struct passwd *pw)
# ifdef USE_PAM
if (options.use_pam) {
do_pam_session();
- do_pam_setcred(0);
+ do_pam_setcred(use_privsep);
}
# endif /* USE_PAM */
if (setusercontext(lc, pw, pw->pw_uid,
@@ -1352,7 +1352,7 @@ do_setusercontext(struct passwd *pw)
*/
if (options.use_pam) {
do_pam_session();
- do_pam_setcred(0);
+ do_pam_setcred(use_privsep);
}
# endif /* USE_PAM */
# if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY)
@@ -1361,11 +1361,11 @@ do_setusercontext(struct passwd *pw)
# ifdef _AIX
aix_usrinfo(pw);
# endif /* _AIX */
-#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF)
+#ifdef USE_LIBIAF
if (set_id(pw->pw_name) != 0) {
exit(1);
}
-#endif /* HAVE_LIBIAF && !BROKEN_LIBIAF */
+#endif /* USE_LIBIAF */
/* Permanently switch to the desired uid. */
permanently_set_uid(pw);
#endif
@@ -2478,8 +2478,19 @@ do_cleanup(Authctxt *authctxt)
return;
called = 1;
- if (authctxt == NULL || !authctxt->authenticated)
+ if (authctxt == NULL)
return;
+
+#ifdef USE_PAM
+ if (options.use_pam) {
+ sshpam_cleanup();
+ sshpam_thread_cleanup();
+ }
+#endif
+
+ if (!authctxt->authenticated)
+ return;
+
#ifdef KRB5
if (options.kerberos_ticket_cleanup &&
authctxt->krb5_ctx)
@@ -2491,13 +2502,6 @@ do_cleanup(Authctxt *authctxt)
ssh_gssapi_cleanup_creds();
#endif
-#ifdef USE_PAM
- if (options.use_pam) {
- sshpam_cleanup();
- sshpam_thread_cleanup();
- }
-#endif
-
/* remove agent socket */
auth_sock_cleanup_proc(authctxt->pw);