summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-17 15:01:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-17 15:01:29 +0000
commitd227f5751c4e0f5cac5350f13415e460d76f206b (patch)
tree6dbe3ae12f5f1595807652b6b1a61326d4da5ddd
parent279521dd8fed9680fbebb42b938541fa609e9158 (diff)
pledge "stdio rpath inet dns" at the head, then after RPC is connected
"stdio rpath"
-rw-r--r--usr.bin/showmount/showmount.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/showmount/showmount.c b/usr.bin/showmount/showmount.c
index 694dee7400b..c2ddf6a8189 100644
--- a/usr.bin/showmount/showmount.c
+++ b/usr.bin/showmount/showmount.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: showmount.c,v 1.18 2015/08/20 22:32:42 deraadt Exp $ */
+/* $OpenBSD: showmount.c,v 1.19 2015/11/17 15:01:28 deraadt Exp $ */
/* $NetBSD: showmount.c,v 1.7 1996/05/01 18:14:10 cgd Exp $ */
/*
@@ -49,6 +49,7 @@
#include <string.h>
#include <unistd.h>
#include <vis.h>
+#include <err.h>
/* Constant defs */
#define ALL 1
@@ -105,6 +106,9 @@ main(int argc, char *argv[])
char *host;
int ch, clnt_sock;
+ if (pledge("stdio rpath inet dns", NULL) == -1)
+ err(1, "pledge");
+
while ((ch = getopt(argc, argv, "ade3")) != -1)
switch (ch) {
case 'a':
@@ -159,6 +163,9 @@ main(int argc, char *argv[])
timeout.tv_sec = 30;
timeout.tv_usec = 0;
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
+
if (rpcs & DODUMP) {
estat = clnt_call(client, RPCMNT_DUMP, xdr_void, (char *)0,
xdr_mntdump, (char *)&mntdump, timeout);