summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2015-10-11 23:01:32 +0000
committerespie <espie@openbsd.org>2015-10-11 23:01:32 +0000
commitb2490958e9d66b1bc83845daec043fc28dab8680 (patch)
treedd50aa32e99d0d91df9c4dcb9da8e3a7adb20243
parentDrop tags containing a blank character: (diff)
downloadwireguard-openbsd-b2490958e9d66b1bc83845daec043fc28dab8680.tar.xz
wireguard-openbsd-b2490958e9d66b1bc83845daec043fc28dab8680.zip
now that tsort has a clean structure, do more specific pledge() calls.
okay deraadt@
-rw-r--r--usr.bin/tsort/tsort.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/tsort/tsort.c b/usr.bin/tsort/tsort.c
index 4f25618ae68..e82841d7e85 100644
--- a/usr.bin/tsort/tsort.c
+++ b/usr.bin/tsort/tsort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsort.c,v 1.31 2015/10/11 17:39:50 espie Exp $ */
+/* $OpenBSD: tsort.c,v 1.32 2015/10/11 23:01:32 espie Exp $ */
/* ex:ts=8 sw=4:
*
* Copyright (c) 1999-2004 Marc Espie <espie@openbsd.org>
@@ -824,7 +824,7 @@ parse_args(int argc, char *argv[], struct ohash *pairs)
int c;
unsigned int order;
int reverse_flag;
- char **files;
+ const char **files;
int i, j;
i = 0;
@@ -878,6 +878,9 @@ parse_args(int argc, char *argv[], struct ohash *pairs)
files[i] = NULL;
+ if (pledge("stdio rpath", files) == -1)
+ err(1, "pledge");
+
nodes_init(pairs);
order = 0;
@@ -905,6 +908,9 @@ parse_args(int argc, char *argv[], struct ohash *pairs)
order = read_pairs(stdin, pairs, reverse_flag, "stdin",
order, hints_flag == 2);
}
+
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
}
static int