- (dtucker) [auth-passwd.c] Only check password expiry once. Prevents
multiple warnings if a wrong password is entered.
diff --git a/auth-passwd.c b/auth-passwd.c
index 28f29cc..b9679ab 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -64,6 +64,7 @@
{
struct passwd * pw = authctxt->pw;
int ok = authctxt->valid;
+ static int expire_checked = 0;
#ifndef HAVE_CYGWIN
if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
@@ -98,9 +99,12 @@
}
#endif
#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
- if (auth_shadow_pwexpired(authctxt)) {
- disable_forwarding();
- authctxt->force_pwchange = 1;
+ if (!expire_checked) {
+ expire_checked = 1;
+ if (auth_shadow_pwexpired(authctxt)) {
+ disable_forwarding();
+ authctxt->force_pwchange = 1;
+ }
}
#endif