summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-06 13:49:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-06 13:49:34 +0000
commit07b899ac43cbbc6df71f74f72d8639001753c480 (patch)
tree2ffcef6e003c793205ae5eef0f8e87ff9b6fcbc5 /usr.bin
parentf40199bc4963bd7d9cc2775065c3612fc3e66ce7 (diff)
only modifies data, stdin to stdout, so tame "stdout"
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tr/tr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/tr/tr.c b/usr.bin/tr/tr.c
index c74fb1c4801..767660d57e8 100644
--- a/usr.bin/tr/tr.c
+++ b/usr.bin/tr/tr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tr.c,v 1.17 2014/06/03 20:57:23 millert Exp $ */
+/* $OpenBSD: tr.c,v 1.18 2015/10/06 13:49:33 deraadt Exp $ */
/* $NetBSD: tr.c,v 1.5 1995/08/31 22:13:48 jtc Exp $ */
/*
@@ -87,6 +87,9 @@ main(int argc, char *argv[])
int ch, cnt, lastch, *p;
int cflag, dflag, sflag, isstring2;
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
+
cflag = dflag = sflag = 0;
while ((ch = getopt(argc, argv, "Ccds")) != -1)
switch(ch) {