Browse Source

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@
OPENBSD_5_8
millert 9 years ago
parent
commit
daf0c358fa
2 changed files with 11 additions and 5 deletions
  1. +6
    -1
      src/include/time.h
  2. +5
    -4
      src/lib/libutil/check_expire.c

+ 6
- 1
src/include/time.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: time.h,v 1.25 2013/06/17 19:11:54 guenther Exp $ */
/* $OpenBSD: time.h,v 1.26 2015/03/15 00:41:27 millert Exp $ */
/* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */ /* $NetBSD: time.h,v 1.9 1994/10/26 00:56:35 cgd Exp $ */
/* /*
@ -166,6 +166,11 @@ int clock_getcpuclockid(pid_t, clockid_t *);
#endif #endif
#if __BSD_VISIBLE #if __BSD_VISIBLE
#ifndef TM_YEAR_BASE
#define TM_YEAR_BASE 1900
#endif
char *timezone(int, int); char *timezone(int, int);
void tzsetwall(void); void tzsetwall(void);
time_t timelocal(struct tm *); time_t timelocal(struct tm *);


+ 5
- 4
src/lib/libutil/check_expire.c View File

@ -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. * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
@ -45,7 +45,6 @@
#include <string.h> #include <string.h>
#include <syslog.h> #include <syslog.h>
#include <time.h> #include <time.h>
#include <tzfile.h>
#include <login_cap.h> #include <login_cap.h>
#include <bsd_auth.h> #include <bsd_auth.h>
@ -53,6 +52,9 @@
static char *pwd_update(const struct passwd *, const struct passwd *); static char *pwd_update(const struct passwd *, const struct passwd *);
#define SECSPERDAY (24 * 60 * 60)
#define TWOWEEKS (2 * 7 * SECSPERDAY)
int int
login_check_expire(FILE *back, struct passwd *pwd, char *class, int lastchance) 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 { } else {
dead = login_getcaptime(lc, "password-dead", 0, 0); dead = login_getcaptime(lc, "password-dead", 0, 0);
warn = login_getcaptime(lc, "password-warn", warn = login_getcaptime(lc, "password-warn",
2 * DAYSPERWEEK * SECSPERDAY,
2 * DAYSPERWEEK * SECSPERDAY);
TWOWEEKS, TWOWEEKS);
if (dead < 0) { if (dead < 0) {
syslog(LOG_ERR, "class %s password-dead is %qd", syslog(LOG_ERR, "class %s password-dead is %qd",
lc->lc_class, dead); lc->lc_class, dead);


Loading…
Cancel
Save