diff options
-rw-r--r-- | usr.bin/login/login.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 7ddc948..fb7cff2 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -415,6 +415,19 @@ main(argc, argv) #define DEFAULT_WARN (2L * 7L * 86400L) /* Two weeks */ + + warntime = login_getcaptime(lc, "warnexpire", + DEFAULT_WARN, DEFAULT_WARN); + + if (pwd->pw_expire) { + if (tp.tv_sec >= pwd->pw_expire) { + refused("Sorry -- your account has expired", + "EXPIRED", 1); + } else if (pwd->pw_expire - tp.tv_sec < warntime && !quietlog) + (void)printf("Warning: your account expires on %s", + ctime(&pwd->pw_expire)); + } + warntime = login_getcaptime(lc, "warnpassword", DEFAULT_WARN, DEFAULT_WARN); @@ -431,18 +444,6 @@ main(argc, argv) ctime(&pwd->pw_change)); } - warntime = login_getcaptime(lc, "warnexpire", - DEFAULT_WARN, DEFAULT_WARN); - - if (pwd->pw_expire) { - if (tp.tv_sec >= pwd->pw_expire) { - refused("Sorry -- your account has expired", - "EXPIRED", 1); - } else if (pwd->pw_expire - tp.tv_sec < warntime && !quietlog) - (void)printf("Warning: your account expires on %s", - ctime(&pwd->pw_expire)); - } - if (lc != NULL) { if (hostname) { struct addrinfo hints, *res; |