From: deraadt Date: Wed, 7 Oct 2015 14:34:34 +0000 (+0000) Subject: tame "stdio wpath cpath", since tee creates & writes to a list of files X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=209655a285f3f40c3cba6c7dc5f79464f53f83bb;p=openbsd tame "stdio wpath cpath", since tee creates & writes to a list of files ok semarie --- 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;