summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2018-10-26 06:03:03 +0000
committerderaadt <deraadt@openbsd.org>2018-10-26 06:03:03 +0000
commit0e1644d175408cfff9afab0b0f25a81535654b55 (patch)
treeb3d79c5adc58cbf041e12bad5e048e1c803ec64b
parentregen (diff)
downloadwireguard-openbsd-0e1644d175408cfff9afab0b0f25a81535654b55.tar.xz
wireguard-openbsd-0e1644d175408cfff9afab0b0f25a81535654b55.zip
Unveil should work because this only opens the configuration file,
and re-exec's itself. That locks the pledge 'exec' nicely.
-rw-r--r--usr.sbin/rebound/rebound.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/rebound/rebound.c b/usr.sbin/rebound/rebound.c
index 366102eef36..6ccc69c0ab8 100644
--- a/usr.sbin/rebound/rebound.c
+++ b/usr.sbin/rebound/rebound.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rebound.c,v 1.100 2018/09/10 19:22:53 anton Exp $ */
+/* $OpenBSD: rebound.c,v 1.101 2018/10/26 06:03:03 deraadt Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -1032,6 +1032,12 @@ monitorloop(int ud, int ld, int ud6, int ld6, const char *confname)
int conffd = -1;
struct timespec ts, *timeout = NULL;
+ if (unveil(confname, "r") == -1)
+ err(1, "unveil");
+
+ if (unveil("/usr/sbin/rebound", "x") == -1)
+ err(1, "unveil");
+
if (pledge("stdio rpath proc exec", NULL) == -1)
err(1, "pledge");