summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-10-03 12:41:16 +0000
committerderaadt <deraadt@openbsd.org>2015-10-03 12:41:16 +0000
commit336f11d6f7e9caa145a0c6f3367533b74b7a55f2 (patch)
treea47dd8bfdb060e99ef5ee7d2e1c2f060a21059dd
parentIPv6 transport for pflow data. (diff)
downloadwireguard-openbsd-336f11d6f7e9caa145a0c6f3367533b74b7a55f2.tar.xz
wireguard-openbsd-336f11d6f7e9caa145a0c6f3367533b74b7a55f2.zip
tame "stdio" right between setlocale and getopt, it is easy to review
this program and see it does uname(3) and stdio printf. uname(3) is backed by a cluster of sysctl() reads, all permitted by the kernel in tame_sysctl_check()
-rw-r--r--usr.bin/uname/uname.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c
index 15e7f907308..85ac7dc1186 100644
--- a/usr.bin/uname/uname.c
+++ b/usr.bin/uname/uname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uname.c,v 1.14 2015/07/21 16:22:59 jasper Exp $ */
+/* $OpenBSD: uname.c,v 1.15 2015/10/03 12:41:16 deraadt Exp $ */
/*
* Copyright (c) 1994 Winning Strategies, Inc.
@@ -59,6 +59,9 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
+
while ((c = getopt(argc, argv, "amnrsvp")) != -1 ) {
switch (c) {
case 'a':