summaryrefslogtreecommitdiff
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
parent578783e6bfb3cb81a63aa580f5641af010d73c72 (diff)
- (djm) Tweak password expiry checking at suggestion of Kevin Steves
<stevesk@sweden.hp.com>
-rw-r--r--ChangeLog2
-rw-r--r--auth.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9adb880d2..f0640e55e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
3 <stevesk@sweden.hp.com> 3 <stevesk@sweden.hp.com>
4 - (djm) Redhat spec and manpage fixes from Pekka Savola <pekkas@netcore.fi> 4 - (djm) Redhat spec and manpage fixes from Pekka Savola <pekkas@netcore.fi>
5 - (djm) Seperate tests for int64_t and u_int64_t types 5 - (djm) Seperate tests for int64_t and u_int64_t types
6 - (djm) Tweak password expiry checking at suggestion of Kevin Steves
7 <stevesk@sweden.hp.com>
6 8
720000920 920000920
8 - (djm) Fix bad path substitution. Report from Andrew Miner 10 - (djm) Fix bad path substitution. Report from Andrew Miner
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 }