+2009-04-20 Nicolas François <nicolas.francois@centraliens.net>
+
+ * src/login.c: Open the PAM session before pam_setcred and before
+ initgroups. This is more consistent with rfc86.0.
+
2009-04-20 Nicolas François <nicolas.francois@centraliens.net>
* src/login.c: Added helper functions get_pam_user() and
}
PAM_FAIL_CHECK;
+ /* Open the PAM session */
+ get_pam_user (&pam_user);
+ retcode = pam_open_session (pamh, hushed (pam_user) ? PAM_SILENT : 0);
+ PAM_FAIL_CHECK;
+
/* Grab the user information out of the password file for future usage
* First get the username that we are actually using, though.
*
retcode = pam_setcred (pamh, PAM_ESTABLISH_CRED);
PAM_FAIL_CHECK;
-
- retcode = pam_open_session (pamh, hushed (username) ? PAM_SILENT : 0);
- PAM_FAIL_CHECK;
+ /* NOTE: If pam_setcred changes PAM_USER, this will not be taken
+ * into account.
+ */
#else /* ! USE_PAM */
while (true) { /* repeatedly get login/password pairs */