summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-10-07 14:34:34 +0000
committerderaadt <deraadt@openbsd.org>2015-10-07 14:34:34 +0000
commit209655a285f3f40c3cba6c7dc5f79464f53f83bb (patch)
tree7625952e54e58f6a4082882b188dd3949f9690e9
parenttame "stdio cpath rpath fattr", unless mkdir -m is passed a mode which (diff)
downloadwireguard-openbsd-209655a285f3f40c3cba6c7dc5f79464f53f83bb.tar.xz
wireguard-openbsd-209655a285f3f40c3cba6c7dc5f79464f53f83bb.zip
tame "stdio wpath cpath", since tee creates & writes to a list of files
ok semarie
-rw-r--r--usr.bin/tee/tee.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/tee/tee.c b/usr.bin/tee/tee.c
index 8f65a0656a1..91bf24cac1e 100644
--- a/usr.bin/tee/tee.c
+++ b/usr.bin/tee/tee.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tee.c,v 1.8 2013/04/23 17:48:17 tedu Exp $ */
+/* $OpenBSD: tee.c,v 1.9 2015/10/07 14:34:34 deraadt Exp $ */
/* $NetBSD: tee.c,v 1.5 1994/12/09 01:43:39 jtc Exp $ */
/*
@@ -74,6 +74,9 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
+ if (tame("stdio wpath cpath", NULL) == -1)
+ err(1, "tame");
+
append = 0;
while ((ch = getopt(argc, argv, "ai")) != -1) {
switch(ch) {
@@ -105,6 +108,9 @@ main(int argc, char *argv[])
argv++;
}
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
+
while ((rval = read(STDIN_FILENO, buf, sizeof(buf))) > 0) {
for (p = head; p; p = p->next) {
n = rval;