summaryrefslogtreecommitdiff
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
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@
-rw-r--r--sbin/route/route.c20
-rw-r--r--sbin/route/show.c11
2 files changed, 8 insertions, 23 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");
diff --git a/sbin/route/show.c b/sbin/route/show.c
index 30ff049fae7..bcede302663 100644
--- a/sbin/route/show.c
+++ b/sbin/route/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.102 2015/10/23 15:03:25 deraadt Exp $ */
+/* $OpenBSD: show.c,v 1.103 2015/11/27 16:26:52 benno Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -145,13 +145,8 @@ p_rttables(int af, u_int tableid, int hastable, char prio)
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");
printf("Routing tables\n");