summaryrefslogtreecommitdiff
path: root/usr.bin/chpass
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2008-12-16 05:25:56 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2008-12-16 05:25:56 +0000
commit799c9944fa8bbbc14aab0bb61b58d2823678bc31 (patch)
tree226ae8f3eeff652669f20255e87725ae857a6a49 /usr.bin/chpass
parent4459921cc677485f424b3c0900bf2d409722e716 (diff)
strptime() never sets tm_isdst, so set it to -1 before passing the
struct tm to mktime() so that the calculation will follow the local DST rules ok millert@ otto@
Diffstat (limited to 'usr.bin/chpass')
-rw-r--r--usr.bin/chpass/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/chpass/util.c b/usr.bin/chpass/util.c
index d100844d8fc..bd7006510e4 100644
--- a/usr.bin/chpass/util.c
+++ b/usr.bin/chpass/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.9 2008/10/09 18:33:15 chl Exp $ */
+/* $OpenBSD: util.c,v 1.10 2008/12/16 05:25:55 guenther Exp $ */
/* $NetBSD: util.c,v 1.4 1995/03/26 04:55:35 glass Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)util.c 8.4 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: util.c,v 1.9 2008/10/09 18:33:15 chl Exp $";
+static char rcsid[] = "$OpenBSD: util.c,v 1.10 2008/12/16 05:25:55 guenther Exp $";
#endif
#endif /* not lint */
@@ -80,6 +80,7 @@ atot(char *p, time_t *store)
t = strptime(p, "%B %d %Y", &tm);
if (t == NULL || (*t != '\0' && *t != '\n'))
return 1;
+ tm.tm_isdst = -1;
*store = mktime(&tm);
if (*store == (time_t) -1)
return 1;