From ff591e8b3873d95dd21a3f6d0e4c0f0a9119f623 Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 6 Oct 2015 22:58:24 +0000 Subject: [PATCH] tame "stdio rpath" if we have new files to open, otherwise tame "stdio". --- usr.bin/unvis/unvis.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/usr.bin/unvis/unvis.c b/usr.bin/unvis/unvis.c index c5cd0087fc7..924e88c8a90 100644 --- a/usr.bin/unvis/unvis.c +++ b/usr.bin/unvis/unvis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unvis.c,v 1.12 2014/01/22 09:45:21 jsg Exp $ */ +/* $OpenBSD: unvis.c,v 1.13 2015/10/06 22:58:24 deraadt Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -43,6 +43,9 @@ main(int argc, char *argv[]) FILE *fp; int ch; + if (tame("stdio rpath", NULL) == -1) + err(1, "tame"); + while ((ch = getopt(argc, argv, "")) != -1) switch(ch) { case '?': @@ -62,8 +65,12 @@ main(int argc, char *argv[]) warn("%s", *argv); argv++; } - else + else { + if (tame("stdio", NULL) == -1) + err(1, "tame"); + process(stdin, ""); + } exit(0); } -- 2.20.1