From 48adfa3dbdcb53bdfd79455f968106400d4431d1 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 6 Oct 2015 13:49:33 +0000 Subject: [PATCH] only modifies data, stdin to stdout, so tame "stdout" --- usr.bin/tr/tr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.20.1