summaryrefslogtreecommitdiffstats
path: root/bin/expr/expr.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-10-04 16:01:07 +0000
committerderaadt <deraadt@openbsd.org>2015-10-04 16:01:07 +0000
commitda60dcb29af3824fd584b0acf9d3012c9380d2ae (patch)
treef42bfa75ecc2458de39ca1d6cf6504f364ada46d /bin/expr/expr.c
parentls can use tame "stdio rpath getpw". It does uid/gid lookups, using (diff)
downloadwireguard-openbsd-da60dcb29af3824fd584b0acf9d3012c9380d2ae.tar.xz
wireguard-openbsd-da60dcb29af3824fd584b0acf9d3012c9380d2ae.zip
expr can use tame "stdio"
ok semarie
Diffstat (limited to 'bin/expr/expr.c')
-rw-r--r--bin/expr/expr.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/expr/expr.c b/bin/expr/expr.c
index b5cd6063b9a..7558a0f841b 100644
--- a/bin/expr/expr.c
+++ b/bin/expr/expr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expr.c,v 1.20 2015/08/11 17:15:46 deraadt Exp $ */
+/* $OpenBSD: expr.c,v 1.21 2015/10/04 16:01:07 deraadt Exp $ */
/* $NetBSD: expr.c,v 1.3.6.1 1996/06/04 20:41:47 cgd Exp $ */
/*
@@ -12,6 +12,7 @@
#include <limits.h>
#include <locale.h>
#include <ctype.h>
+#include <unistd.h>
#include <regex.h>
#include <err.h>
@@ -500,6 +501,9 @@ main(int argc, char *argv[])
(void) setlocale(LC_ALL, "");
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
+
if (argc > 1 && !strcmp(argv[1], "--"))
argv++;