summaryrefslogtreecommitdiff
path: root/usr.bin/tee
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-07 14:34:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-07 14:34:35 +0000
commit9f54f294d518c3cb758bb3965fd2240d0c612719 (patch)
tree3e8226de4e6a8fd541d721de15f3279679eaaf01 /usr.bin/tee
parent5a4a386fbdbe0d16d6614702905e34ca929994db (diff)
tame "stdio wpath cpath", since tee creates & writes to a list of files
ok semarie
Diffstat (limited to 'usr.bin/tee')
-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;