summaryrefslogtreecommitdiff
path: root/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth.c')
-rw-r--r--auth.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/auth.c b/auth.c
index ae8c79843..883f08ab0 100644
--- a/auth.c
+++ b/auth.c
@@ -81,8 +81,8 @@ allowed_user(struct passwd * pw)
81#ifdef WITH_AIXAUTHENTICATE 81#ifdef WITH_AIXAUTHENTICATE
82 char *loginmsg; 82 char *loginmsg;
83#endif /* WITH_AIXAUTHENTICATE */ 83#endif /* WITH_AIXAUTHENTICATE */
84#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) && \ 84#if !defined(PAM) && defined(HAVE_SHADOW_H) && \
85 defined(HAS_SHADOW_EXPIRE) 85 !defined(DISABLE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
86 struct spwd *spw; 86 struct spwd *spw;
87 87
88 /* Shouldn't be called if pw is NULL, but better safe than sorry... */ 88 /* Shouldn't be called if pw is NULL, but better safe than sorry... */
@@ -94,11 +94,11 @@ allowed_user(struct passwd * pw)
94 int days = time(NULL) / 86400; 94 int days = time(NULL) / 86400;
95 95
96 /* Check account expiry */ 96 /* Check account expiry */
97 if ((spw->sp_expire > 0) && (days > spw->sp_expire)) 97 if ((spw->sp_expire >= 0) && (days > spw->sp_expire))
98 return 0; 98 return 0;
99 99
100 /* Check password expiry */ 100 /* Check password expiry */
101 if ((spw->sp_lstchg > 0) && (spw->sp_max > 0) && 101 if ((spw->sp_lstchg >= 0) && (spw->sp_max >= 0) &&
102 (days > (spw->sp_lstchg + spw->sp_max))) 102 (days > (spw->sp_lstchg + spw->sp_max)))
103 return 0; 103 return 0;
104 } 104 }