about summary refs log tree commit diff
path: root/src/usr.bin/unvis
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-11-12 17:05:57 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-11-12 17:06:12 +0100
commit3c57c4d0031b7206ced8f313e3efa02dbcf88f78 (patch)
treeb1dec8d32d8a2e2e74f2a48a870bb4ad680fb911 /src/usr.bin/unvis
parent166efa19c7ed5e13b1db524dd0b26fc48a56a2ee (diff)
downloadoutils-3c57c4d0031b7206ced8f313e3efa02dbcf88f78.tar.gz
outils-3c57c4d0031b7206ced8f313e3efa02dbcf88f78.tar.xz
outils-3c57c4d0031b7206ced8f313e3efa02dbcf88f78.zip
cvs update v0.3
Diffstat (limited to 'src/usr.bin/unvis')
-rw-r--r--src/usr.bin/unvis/unvis.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/usr.bin/unvis/unvis.c b/src/usr.bin/unvis/unvis.c
index c5cd008..22566d9 100644
--- a/src/usr.bin/unvis/unvis.c
+++ b/src/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.14 2015/10/09 01:37:09 deraadt Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -43,6 +43,9 @@ main(int argc, char *argv[])
 	FILE *fp;
 	int ch;
 
+	if (pledge("stdio rpath", NULL) == -1)
+		err(1, "pledge");
+
 	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 (pledge("stdio", NULL) == -1)
+			err(1, "pledge");
+
 		process(stdin, "<stdin>");
+	}
 	exit(0);
 }