Skip to content

Commit

Permalink
Fixes pam_close_session
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpingYang001 committed May 9, 2019
1 parent 7a17db0 commit cc2381a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Unix/base/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cc2381a

Please sign in to comment.