summaryrefslogtreecommitdiffstats
path: root/auth.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-09-23 14:26:32 +1100
committerDamien Miller <djm@mindrot.org>2000-09-23 14:26:32 +1100
commit62dd94b375446eb04aed1550c17eaf79717423d4 (patch)
treeb19dcd9b9203c67b739b7ae512350fcd29692b35 /auth.c
parent578783e6bfb3cb81a63aa580f5641af010d73c72 (diff)
- (djm) Tweak password expiry checking at suggestion of Kevin Steves
<stevesk@sweden.hp.com>
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 ae8c7984..883f08ab 100644
--- a/auth.c
+++ b/auth.c
@@ -81,8 +81,8 @@ allowed_user(struct passwd * pw)
#ifdef WITH_AIXAUTHENTICATE
char *loginmsg;
#endif /* WITH_AIXAUTHENTICATE */
-#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) && \
- defined(HAS_SHADOW_EXPIRE)
+#if !defined(PAM) && defined(HAVE_SHADOW_H) && \
+ !defined(DISABLE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
struct spwd *spw;
/* Shouldn't be called if pw is NULL, but better safe than sorry... */
@@ -94,11 +94,11 @@ allowed_user(struct passwd * pw)
int days = time(NULL) / 86400;
/* Check account expiry */
- if ((spw->sp_expire > 0) && (days > spw->sp_expire))
+ if ((spw->sp_expire >= 0) && (days > spw->sp_expire))
return 0;
/* Check password expiry */
- if ((spw->sp_lstchg > 0) && (spw->sp_max > 0) &&
+ if ((spw->sp_lstchg >= 0) && (spw->sp_max >= 0) &&
(days > (spw->sp_lstchg + spw->sp_max)))
return 0;
}