if (def_pam_setcred)
(void) pam_setcred(pamh, PAM_ESTABLISH_CRED);
+ if (def_pam_session) {
+ *pam_status = pam_open_session(pamh, 0);
+ if (*pam_status != PAM_SUCCESS) {
+ (void) pam_end(pamh, *pam_status | PAM_DATA_SILENT);
+ pamh = NULL;
+ status = AUTH_FAILURE;
+ }
+ }
+
#ifdef HAVE_PAM_GETENVLIST
/*
* Update environment based on what is stored in pamh.
}
#endif /* HAVE_PAM_GETENVLIST */
- if (def_pam_session) {
- *pam_status = pam_open_session(pamh, 0);
- if (*pam_status != PAM_SUCCESS) {
- (void) pam_end(pamh, *pam_status | PAM_DATA_SILENT);
- pamh = NULL;
- status = AUTH_FAILURE;
- }
- }
-
done:
debug_return_int(status);
}