From: krw Date: Thu, 22 Jun 2017 15:08:53 +0000 (+0000) Subject: Drop support for old (>4yr) timestamp formats in leases X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c12a7b557a41361d10d5ab1834cdd437f33f32eb;p=openbsd Drop support for old (>4yr) timestamp formats in leases files. ok tb@ millert@ --- diff --git a/sbin/dhclient/dhcpd.h b/sbin/dhclient/dhcpd.h index 60a67d38528..2e4d70f2a99 100644 --- a/sbin/dhclient/dhcpd.h +++ b/sbin/dhclient/dhcpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpd.h,v 1.190 2017/06/21 15:24:34 krw Exp $ */ +/* $OpenBSD: dhcpd.h,v 1.191 2017/06/22 15:08:53 krw Exp $ */ /* * Copyright (c) 2004 Henning Brauer @@ -43,8 +43,6 @@ #define REMOTE_PORT 67 #define INTERNALSIG INT_MAX #define DB_TIMEFMT "%w %Y/%m/%d %T UTC" -#define BAD_DB_TIMEFMT "%u %Y/%m/%d %T" -#define OLD_DB_TIMEFMT "%w %Y/%m/%d %T" struct option { char *name; diff --git a/sbin/dhclient/parse.c b/sbin/dhclient/parse.c index d1f5bb2140d..85f92432b4f 100644 --- a/sbin/dhclient/parse.c +++ b/sbin/dhclient/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.52 2017/06/19 19:28:35 krw Exp $ */ +/* $OpenBSD: parse.c,v 1.53 2017/06/22 15:08:53 krw Exp $ */ /* Common parser code for dhcpd and dhclient. */ @@ -399,14 +399,8 @@ parse_date(FILE *cfile) memset(&tm, 0, sizeof(tm)); /* 'cuz strptime ignores tm_isdt. */ p = strptime(timestr, DB_TIMEFMT, &tm); if (p == NULL || *p != '\0') { - p = strptime(timestr, OLD_DB_TIMEFMT, &tm); - if (p == NULL || *p != '\0') { - p = strptime(timestr, BAD_DB_TIMEFMT, &tm); - if (p == NULL || *p != '\0') { - parse_warn("unparseable time string"); - return (0); - } - } + parse_warn("unparseable time string"); + return (0); } guess = timegm(&tm);