summaryrefslogtreecommitdiff
path: root/auth-passwd.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2004-02-22 10:23:35 +1100
committerDarren Tucker <dtucker@zip.com.au>2004-02-22 10:23:35 +1100
commitb4dc6c23a58a5e12c292c5cb3613bd5d924ff5ea (patch)
tree0dc86859e707ef496ceb5989eed731299d552fd4 /auth-passwd.c
parentaa0aecad99c4714336117d22a7c68982684cef4b (diff)
- (dtucker) [auth-passwd.c] Only check password expiry once. Prevents
multiple warnings if a wrong password is entered.
Diffstat (limited to 'auth-passwd.c')
-rw-r--r--auth-passwd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/auth-passwd.c b/auth-passwd.c
index 28f29cc65..b9679abd0 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -64,6 +64,7 @@ auth_password(Authctxt *authctxt, const char *password)
64{ 64{
65 struct passwd * pw = authctxt->pw; 65 struct passwd * pw = authctxt->pw;
66 int ok = authctxt->valid; 66 int ok = authctxt->valid;
67 static int expire_checked = 0;
67 68
68#ifndef HAVE_CYGWIN 69#ifndef HAVE_CYGWIN
69 if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES) 70 if (pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
@@ -98,9 +99,12 @@ auth_password(Authctxt *authctxt, const char *password)
98 } 99 }
99#endif 100#endif
100#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE) 101#if defined(USE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
101 if (auth_shadow_pwexpired(authctxt)) { 102 if (!expire_checked) {
102 disable_forwarding(); 103 expire_checked = 1;
103 authctxt->force_pwchange = 1; 104 if (auth_shadow_pwexpired(authctxt)) {
105 disable_forwarding();
106 authctxt->force_pwchange = 1;
107 }
104 } 108 }
105#endif 109#endif
106 110