diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | auth.c | 8 |
2 files changed, 6 insertions, 4 deletions
@@ -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 | ||
7 | 20000920 | 9 | 20000920 |
8 | - (djm) Fix bad path substitution. Report from Andrew Miner | 10 | - (djm) Fix bad path substitution. Report from Andrew Miner |
@@ -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 | } |