summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-09-04 19:15:28 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-09-04 19:15:28 +0000
commit86a24042b5a74aa29884db0b4dd4f9fcedd06970 (patch)
treead132e074ca102d209d727056e36b31ace6df25a
parente7577f4126ec513b0124fd75af3801b71eb91e81 (diff)
Check for account expiration before password expiration;
sigh@kuzirabekon.econ.nagasaki-u.ac.jp
-rw-r--r--usr.bin/login/login.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c
index e9d3dd0e011..4b6cc4e6e18 100644
--- a/usr.bin/login/login.c
+++ b/usr.bin/login/login.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login.c,v 1.32 2000/08/24 20:08:06 millert Exp $ */
+/* $OpenBSD: login.c,v 1.33 2000/09/04 19:15:27 millert Exp $ */
/* $NetBSD: login.c,v 1.13 1996/05/15 23:50:16 jtc Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94";
#endif
-static char rcsid[] = "$OpenBSD: login.c,v 1.32 2000/08/24 20:08:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: login.c,v 1.33 2000/09/04 19:15:27 millert Exp $";
#endif /* not lint */
/*
@@ -427,16 +427,6 @@ main(argc, argv)
if (pwd->pw_change || pwd->pw_expire)
(void)gettimeofday(&tp, (struct timezone *)NULL);
- if (pwd->pw_change) {
- if (tp.tv_sec >= pwd->pw_change) {
- (void)printf("Sorry -- your password has expired.\n");
- sleepexit(1);
- } else if (!quietlog && pwd->pw_change - tp.tv_sec <
- login_getcaptime(lc, "password-warn",
- 2 * DAYSPERWEEK * SECSPERDAY, 2 * DAYSPERWEEK * SECSPERDAY))
- (void)printf("Warning: your password expires on %s",
- ctime(&pwd->pw_change));
- }
if (pwd->pw_expire) {
if (tp.tv_sec >= pwd->pw_expire) {
(void)printf("Sorry -- your account has expired.\n");
@@ -447,6 +437,16 @@ main(argc, argv)
(void)printf("Warning: your account expires on %s",
ctime(&pwd->pw_expire));
}
+ if (pwd->pw_change) {
+ if (tp.tv_sec >= pwd->pw_change) {
+ (void)printf("Sorry -- your password has expired.\n");
+ sleepexit(1);
+ } else if (!quietlog && pwd->pw_change - tp.tv_sec <
+ login_getcaptime(lc, "password-warn",
+ 2 * DAYSPERWEEK * SECSPERDAY, 2 * DAYSPERWEEK * SECSPERDAY))
+ (void)printf("Warning: your password expires on %s",
+ ctime(&pwd->pw_change));
+ }
/* Nothing else left to fail -- really log in. */
(void)signal(SIGHUP, SIG_DFL);