diff options
author | 2018-04-25 19:37:09 +0000 | |
---|---|---|
committer | 2018-04-25 19:37:09 +0000 | |
commit | 3c74b4939c11561afe6acd67f17a374ba300a79b (patch) | |
tree | 4bcfe2999b782f53ac3d19f299242c68e17914d5 | |
parent | Use a NUMKEYS macro instead of magic and use a more familiar idiom (diff) | |
download | wireguard-openbsd-3c74b4939c11561afe6acd67f17a374ba300a79b.tar.xz wireguard-openbsd-3c74b4939c11561afe6acd67f17a374ba300a79b.zip |
The time-setting codepath can use pledge "settime" which was added for
ntpd, but apparently date was never revisited. "wpath" is for wtmp logging.
"rpath" for the case where -z argument isn't in the standard timezone dir.
discussed with tb and guenther
-rw-r--r-- | bin/date/date.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/date/date.c b/bin/date/date.c index 3a3ff3851a3..0f5dad5b3fa 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -1,4 +1,4 @@ -/* $OpenBSD: date.c,v 1.52 2018/02/13 17:28:11 cheloha Exp $ */ +/* $OpenBSD: date.c,v 1.53 2018/04/25 19:37:09 deraadt Exp $ */ /* $NetBSD: date.c,v 1.11 1995/09/07 06:21:05 jtc Exp $ */ /* @@ -127,7 +127,7 @@ main(int argc, char *argv[]) argc--; } - if (pledge("stdio rpath wpath", NULL) == -1) + if (pledge("stdio rpath", NULL) == -1) err(1, "pledge"); if (*argv && **argv == '+') { @@ -159,6 +159,9 @@ setthetime(char *p) time_t now; int yearset = 0; + if (pledge("stdio settime rpath wpath", NULL) == -1) + err(1, "pledge"); + for (t = p, dot = NULL; *t; ++t) { if (isdigit((unsigned char)*t)) continue; |