summaryrefslogtreecommitdiff
path: root/usr.bin/vis
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-05 06:59:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-10-05 06:59:19 +0000
commitdf4ade1ab637ce8f18acdb1e25c7f9ef99effa07 (patch)
tree01be087d4bc8b47c503d57813549ac4364839f4d /usr.bin/vis
parentea2998e0ae13862aa6d22fefe41304cff838ae61 (diff)
tame "stdio rpath" initially; if we find out the only file operated on
is stdin, then we can drop directly to tame "stdio" ok doug
Diffstat (limited to 'usr.bin/vis')
-rw-r--r--usr.bin/vis/vis.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/vis/vis.c b/usr.bin/vis/vis.c
index fe40eed012d..869660d3898 100644
--- a/usr.bin/vis/vis.c
+++ b/usr.bin/vis/vis.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vis.c,v 1.17 2015/04/18 18:28:38 deraadt Exp $ */
+/* $OpenBSD: vis.c,v 1.18 2015/10/05 06:59:18 deraadt Exp $ */
/* $NetBSD: vis.c,v 1.4 1994/12/20 16:13:03 jtc Exp $ */
/*-
@@ -55,6 +55,9 @@ main(int argc, char *argv[])
FILE *fp;
int ch;
+ if (tame("stdio rpath", NULL) == -1)
+ err(1, "tame");
+
while ((ch = getopt(argc, argv, "anwctsobfF:ld")) != -1)
switch(ch) {
case 'a':
@@ -114,8 +117,11 @@ main(int argc, char *argv[])
warn("%s", *argv);
argv++;
}
- else
+ else {
+ if (tame("stdio", NULL) == -1)
+ err(1, "tame");
process(stdin);
+ }
exit(0);
}