diff options
author | 2015-10-05 06:36:18 +0000 | |
---|---|---|
committer | 2015-10-05 06:36:18 +0000 | |
commit | b9d1a5d1adf8a1de6fc49baa6ee8fab3b557c71f (patch) | |
tree | 3e70d22c1e4384139ffc0e4e47561985a3d8a2e6 | |
parent | small KNF (diff) | |
download | wireguard-openbsd-b9d1a5d1adf8a1de6fc49baa6ee8fab3b557c71f.tar.xz wireguard-openbsd-b9d1a5d1adf8a1de6fc49baa6ee8fab3b557c71f.zip |
tame "stdio rpath" for the entire lifetime. newsyntax() could open a file
very early on, but next() can open one quite late.
ok doug
-rw-r--r-- | usr.bin/hexdump/hexdump.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/hexdump/hexdump.c b/usr.bin/hexdump/hexdump.c index a84a8c315bd..539c5d1c4e6 100644 --- a/usr.bin/hexdump/hexdump.c +++ b/usr.bin/hexdump/hexdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hexdump.c,v 1.17 2015/01/16 06:40:08 deraadt Exp $ */ +/* $OpenBSD: hexdump.c,v 1.18 2015/10/05 06:36:18 deraadt Exp $ */ /* $NetBSD: hexdump.c,v 1.7 1997/10/19 02:34:06 lukem Exp $ */ /* @@ -33,6 +33,7 @@ #include <err.h> #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include <string.h> #include "hexdump.h" @@ -53,6 +54,9 @@ main(int argc, char *argv[]) FS *tfs; char *p; + if (tame("stdio rpath", NULL) == -1) + err(1, "tame"); + if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od")) newsyntax(argc, &argv); else |