- (dtucker) [auth-passwd.c] Only check password expiry once. Prevents

multiple warnings if a wrong password is entered.
This commit is contained in:
Darren Tucker 2004-02-22 10:23:35 +11:00
parent aa0aecad99
commit b4dc6c23a5
1 changed files with 7 additions and 3 deletions

View File

@ -64,6 +64,7 @@ auth_password(Authctxt *authctxt, const char *password)
{ {
struct passwd * pw = authctxt->pw; struct passwd * pw = authctxt->pw;
int ok = authctxt->valid; int ok = authctxt->valid;
static int expire_checked = 0;
#ifndef HAVE_CYGWIN #ifndef HAVE_CYGWIN
if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES) if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
@ -98,9 +99,12 @@ auth_password(Authctxt *authctxt, const char *password)
} }
#endif #endif
#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) #if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
if (auth_shadow_pwexpired(authctxt)) { if (!expire_checked) {
disable_forwarding(); expire_checked = 1;
authctxt->force_pwchange = 1; if (auth_shadow_pwexpired(authctxt)) {
disable_forwarding();
authctxt->force_pwchange = 1;
}
} }
#endif #endif