mirror of
git://anongit.mindrot.org/openssh.git
synced 2025-02-18 14:56:55 +00:00
- (djm) Stop shadow expiry checking from preventing logins with NIS. Based
on fix from HARUYAMA Seigo <haruyama@nt.phys.s.u-tokyo.ac.jp>
This commit is contained in:
parent
9b6d4ab8f9
commit
c708843e6a
@ -1,5 +1,7 @@
|
|||||||
20000702
|
20000702
|
||||||
- (djm) Fix brace mismatch from Corinna Vinschen <vinschen@cygnus.com>
|
- (djm) Fix brace mismatch from Corinna Vinschen <vinschen@cygnus.com>
|
||||||
|
- (djm) Stop shadow expiry checking from preventing logins with NIS. Based
|
||||||
|
on fix from HARUYAMA Seigo <haruyama@nt.phys.s.u-tokyo.ac.jp>
|
||||||
|
|
||||||
20000701
|
20000701
|
||||||
- (djm) Fix Tru64 SIA problems reported by John P Speno <speno@isc.upenn.edu>
|
- (djm) Fix Tru64 SIA problems reported by John P Speno <speno@isc.upenn.edu>
|
||||||
|
21
auth.c
21
auth.c
@ -65,17 +65,18 @@ allowed_user(struct passwd * pw)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
spw = getspnam(pw->pw_name);
|
spw = getspnam(pw->pw_name);
|
||||||
if (spw == NULL)
|
if (spw != NULL) {
|
||||||
return 0;
|
int days = time(NULL) / 86400;
|
||||||
|
|
||||||
/* Check account expiry */
|
|
||||||
if ((spw->sp_expire > 0) && ((time(NULL) / 86400) > spw->sp_expire))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* Check password expiry */
|
/* Check account expiry */
|
||||||
if ((spw->sp_lstchg > 0) && (spw->sp_inact > 0) &&
|
if ((spw->sp_expire > 0) && (days > spw->sp_expire))
|
||||||
((time(NULL) / 86400) > (spw->sp_lstchg + spw->sp_inact)))
|
return 0;
|
||||||
return 0;
|
|
||||||
|
/* Check password expiry */
|
||||||
|
if ((spw->sp_lstchg > 0) && (spw->sp_inact > 0) &&
|
||||||
|
(days > (spw->sp_lstchg + spw->sp_inact)))
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/* Shouldn't be called if pw is NULL, but better safe than sorry... */
|
/* Shouldn't be called if pw is NULL, but better safe than sorry... */
|
||||||
if (!pw)
|
if (!pw)
|
||||||
|
Loading…
Reference in New Issue
Block a user