summaryrefslogtreecommitdiff
path: root/auth-pam.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2009-12-29 21:42:53 +0000
committerColin Watson <cjwatson@debian.org>2009-12-29 21:42:53 +0000
commit87552344215a38d3a2b0d4d63dc151e05978bbe1 (patch)
tree9f4b96055e6ccaa915e8d59d9f2805e9e119371d /auth-pam.c
parenta25ec0b132c44c9e341e08464ff830de06b81126 (diff)
parentef94e5613d37bcbf880f21ee6094e4b1c7683a4c (diff)
import openssh-5.1p1-gsskex-cjwatson-20080722.patch
Diffstat (limited to 'auth-pam.c')
-rw-r--r--auth-pam.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/auth-pam.c b/auth-pam.c
index a07f1fe77..ccdb9937e 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -598,15 +598,17 @@ static struct pam_conv store_conv = { sshpam_store_conv, NULL };
598void 598void
599sshpam_cleanup(void) 599sshpam_cleanup(void)
600{ 600{
601 debug("PAM: cleanup"); 601 if (sshpam_handle == NULL || (use_privsep && !mm_is_monitor()))
602 if (sshpam_handle == NULL)
603 return; 602 return;
603 debug("PAM: cleanup");
604 pam_set_item(sshpam_handle, PAM_CONV, (const void *)&null_conv); 604 pam_set_item(sshpam_handle, PAM_CONV, (const void *)&null_conv);
605 if (sshpam_cred_established) { 605 if (sshpam_cred_established) {
606 debug("PAM: deleting credentials");
606 pam_setcred(sshpam_handle, PAM_DELETE_CRED); 607 pam_setcred(sshpam_handle, PAM_DELETE_CRED);
607 sshpam_cred_established = 0; 608 sshpam_cred_established = 0;
608 } 609 }
609 if (sshpam_session_open) { 610 if (sshpam_session_open) {
611 debug("PAM: closing session");
610 pam_close_session(sshpam_handle, PAM_SILENT); 612 pam_close_session(sshpam_handle, PAM_SILENT);
611 sshpam_session_open = 0; 613 sshpam_session_open = 0;
612 } 614 }