summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2019-05-10 12:49:16 +0000
committerschwarze <schwarze@openbsd.org>2019-05-10 12:49:16 +0000
commit7aa88c38e720b5f246f58412f418a0fcca7dfa6b (patch)
treebdde3342d61142e2322cfbbf072a4445d4e70d1d /lib/libc
parentBrowsers using SAN instead of CN in Subject is now more than just "some (diff)
downloadwireguard-openbsd-7aa88c38e720b5f246f58412f418a0fcca7dfa6b.tar.xz
wireguard-openbsd-7aa88c38e720b5f246f58412f418a0fcca7dfa6b.zip
Delete support for military timezones in %z (A-I and K-Y).
They were originally defined in one way, then RFC822 erroneously redefined them the opposite way, then RFC5322 said they can no longer be used reliably. So return NULL like FreeBSD, DragonFly, glibc, and musl do. Issue reported by Hiltjo Posthuma <hiltjo at codemadness dot org>. Deletion suggested by tedu@ and deraadt@. Feedback and OK on the patch from tedu@.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/time/strptime.314
-rw-r--r--lib/libc/time/strptime.c24
2 files changed, 4 insertions, 34 deletions
diff --git a/lib/libc/time/strptime.3 b/lib/libc/time/strptime.3
index ed667de4f96..6f75294370a 100644
--- a/lib/libc/time/strptime.3
+++ b/lib/libc/time/strptime.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strptime.3,v 1.27 2019/02/21 19:10:32 kn Exp $
+.\" $OpenBSD: strptime.3,v 1.28 2019/05/10 12:49:16 schwarze Exp $
.\"
.\" Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -26,7 +26,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: February 21 2019 $
+.Dd $Mdocdate: May 10 2019 $
.Dt STRPTIME 3
.Os
.Sh NAME
@@ -242,15 +242,7 @@ time
or
.Ql Standard
.Pq Dq S
-time;
-a single letter military timezone specified as:
-.Dq A
-through
-.Dq I
-and
-.Dq K
-through
-.Dq Y .
+time.
.It Cm \&%Z
timezone name or no characters when timezone information is unavailable.
.It Cm \&%%
diff --git a/lib/libc/time/strptime.c b/lib/libc/time/strptime.c
index eaf182dc773..d2e24578008 100644
--- a/lib/libc/time/strptime.c
+++ b/lib/libc/time/strptime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strptime.c,v 1.25 2019/02/21 19:10:32 kn Exp $ */
+/* $OpenBSD: strptime.c,v 1.26 2019/05/10 12:49:16 schwarze Exp $ */
/* $NetBSD: strptime.c,v 1.12 1998/01/20 21:39:40 mycroft Exp $ */
/*-
* Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
@@ -464,9 +464,6 @@ literal:
* C[DS]T = Central : -5 | -6
* M[DS]T = Mountain: -6 | -7
* P[DS]T = Pacific : -7 | -8
- * Military
- * [A-IL-M] = -1 ... -9 (J not used)
- * [N-Y] = +1 ... +12
*/
while (isspace(*bp))
bp++;
@@ -520,25 +517,6 @@ literal:
bp = ep;
continue;
}
-
- if ((*bp >= 'A' && *bp <= 'I') ||
- (*bp >= 'L' && *bp <= 'Y')) {
-#ifdef TM_GMTOFF
- /* Argh! No 'J'! */
- if (*bp >= 'A' && *bp <= 'I')
- tm->TM_GMTOFF =
- ('A' - 1) - (int)*bp;
- else if (*bp >= 'L' && *bp <= 'M')
- tm->TM_GMTOFF = 'A' - (int)*bp;
- else if (*bp >= 'N' && *bp <= 'Y')
- tm->TM_GMTOFF = (int)*bp - 'M';
-#endif
-#ifdef TM_ZONE
- tm->TM_ZONE = NULL; /* XXX */
-#endif
- bp++;
- continue;
- }
return NULL;
}
offs = 0;