From cc2381a31e572f5a91428e95df7725097db0af9b Mon Sep 17 00:00:00 2001 From: JumpingYang001 Date: Tue, 19 Mar 2019 01:40:13 -0700 Subject: [PATCH] Fixes pam_close_session --- Unix/base/user.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Unix/base/user.c b/Unix/base/user.c index 911cee38e..97afc888c 100644 --- a/Unix/base/user.c +++ b/Unix/base/user.c @@ -138,23 +138,27 @@ int PamCheckUser( if (PAM_SUCCESS != pam_authenticate(t, 0)) { - pam_end(t,0); + int close_ret = pam_close_session(t,PAM_SILENT); + pam_end(t,close_ret); return -1; } if (PAM_SUCCESS != pam_acct_mgmt(t, 0)) { - pam_end(t,0); + int close_ret = pam_close_session(t,PAM_SILENT); + pam_end(t,close_ret); return -1; } if (PAM_SUCCESS != pam_setcred(t, PAM_ESTABLISH_CRED)) { - pam_end(t,0); + int close_ret = pam_close_session(t,PAM_SILENT); + pam_end(t,close_ret); return -1; } - pam_end(t, 0); + int close_ret = pam_close_session(t,PAM_SILENT); + pam_end(t,close_ret); return 0; }