summaryrefslogtreecommitdiff
path: root/sbin/route/route.c
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2015-11-27 16:26:53 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2015-11-27 16:26:53 +0000
commit2552825e293c57cfa9f8d8d9acf7e46d7d4347c7 (patch)
tree1e63e0c97db17080d260164e617505c54aa0d956 /sbin/route/route.c
parent18c625453b58c16b60538e16e55bec4008a4d535 (diff)
After evaluating patches from Ricardo Mestre, it became obvious that
route needs pledge("stdio rpath dns") in all cases. Looks best to me deraadt@
Diffstat (limited to 'sbin/route/route.c')
-rw-r--r--sbin/route/route.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 1b3b37b47d9..5cd81f43049 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.180 2015/11/20 17:26:56 jca Exp $ */
+/* $OpenBSD: route.c,v 1.181 2015/11/27 16:26:52 benno Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -226,13 +226,8 @@ main(int argc, char **argv)
break;
}
- if (nflag) {
- if (pledge("stdio rpath dns", NULL) == -1)
- err(1, "pledge");
- } else {
- if (pledge("stdio rpath dns", NULL) == -1)
- err(1, "pledge");
- }
+ if (pledge("stdio rpath dns", NULL) == -1)
+ err(1, "pledge");
switch (kw) {
case K_GET:
@@ -329,13 +324,8 @@ flushroutes(int argc, char **argv)
break;
}
- if (nflag) {
- if (pledge("stdio rpath dns", NULL) == -1)
- err(1, "pledge");
- } else {
- if (pledge("stdio rpath dns", NULL) == -1)
- err(1, "pledge");
- }
+ if (pledge("stdio rpath dns", NULL) == -1)
+ err(1, "pledge");
if (verbose) {
printf("Examining routing table from sysctl\n");