summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-03-15 00:41:29 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-03-15 00:41:29 +0000
commit22eb77a8bd9284ff55e7f91c659398a9a554766a (patch)
treea28c1053918bf9acff5523fc5d5d0b958b776fbb /lib
parentb89e57b4b2848230b0a05f0d361e996015aecf61 (diff)
tzfile.h is an internal header that should never have been installed.
What's worse, the tzfile.h that gets installed is over 20 years old and doesn't match the real tzfile.h in libc/time. This makes the tree safe for /usr/include/tzfile.h removal. The TM_YEAR_BASE define has been moved to time.h temporarily until its usage is replaced by 1900 in the tree. Actual removal of tzfile.h is pending a ports build. Based on a diff from deraadt@
Diffstat (limited to 'lib')
-rw-r--r--lib/libutil/check_expire.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libutil/check_expire.c b/lib/libutil/check_expire.c
index cc141311dad..6fd0bd3ddd4 100644
--- a/lib/libutil/check_expire.c
+++ b/lib/libutil/check_expire.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: check_expire.c,v 1.10 2014/08/25 07:50:25 doug Exp $ */
+/* $OpenBSD: check_expire.c,v 1.11 2015/03/15 00:41:27 millert Exp $ */
/*
* Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
@@ -45,7 +45,6 @@
#include <string.h>
#include <syslog.h>
#include <time.h>
-#include <tzfile.h>
#include <login_cap.h>
#include <bsd_auth.h>
@@ -53,6 +52,9 @@
static char *pwd_update(const struct passwd *, const struct passwd *);
+#define SECSPERDAY (24 * 60 * 60)
+#define TWOWEEKS (2 * 7 * SECSPERDAY)
+
int
login_check_expire(FILE *back, struct passwd *pwd, char *class, int lastchance)
{
@@ -85,8 +87,7 @@ login_check_expire(FILE *back, struct passwd *pwd, char *class, int lastchance)
} else {
dead = login_getcaptime(lc, "password-dead", 0, 0);
warn = login_getcaptime(lc, "password-warn",
- 2 * DAYSPERWEEK * SECSPERDAY,
- 2 * DAYSPERWEEK * SECSPERDAY);
+ TWOWEEKS, TWOWEEKS);
if (dead < 0) {
syslog(LOG_ERR, "class %s password-dead is %qd",
lc->lc_class, dead);