* src/login.c: fflg is already restricted to root. Move

pam_acct_mgmt(), in case of fflg, earlier. This is equivalent and
	simplifies the code.
This commit is contained in:
nekral-guest 2009-04-19 16:09:00 +00:00
parent 2ed05e548b
commit ca10b825c7
2 changed files with 10 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2009-04-19 Nicolas François <nicolas.francois@centraliens.net>
* src/login.c: fflg is already restricted to root. Move
pam_acct_mgmt(), in case of fflg, earlier. This is equivalent and
simplifies the code.
2009-04-19 Paul Szabo <psz@maths.usyd.edu.au>
* libmisc/utmp.c: Always call endutent or endutxent when setutent

View File

@ -670,7 +670,7 @@ int main (int argc, char **argv)
PAM_FAIL_CHECK;
#endif
/* if fflg, then the user has already been authenticated */
if (!fflg || (getuid () != 0)) {
if (!fflg) {
int failcount = 0;
char hostn[256];
char loginprompt[256]; /* That's one hell of a prompt :) */
@ -817,6 +817,9 @@ int main (int argc, char **argv)
retcode = pam_chauthtok (pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
}
PAM_FAIL_CHECK;
} else (fflg) {
retcode = pam_acct_mgmt (pamh, 0);
PAM_FAIL_CHECK;
}
@ -838,11 +841,6 @@ int main (int argc, char **argv)
exit (1);
}
if (fflg) {
retcode = pam_acct_mgmt (pamh, 0);
PAM_FAIL_CHECK;
}
if (setup_groups (pwd) != 0) {
exit (1);
}