summaryrefslogtreecommitdiff
path: root/usr.sbin/rebound
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2018-10-26 06:03:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2018-10-26 06:03:04 +0000
commit37d73cfacedf74380a028d4eaa16a839cd05b1f2 (patch)
tree7392ba5109a7825554a6579f6892b70125ffa8ab /usr.sbin/rebound
parentfa342feeb99900dd05ebe9e4814839ecb0ba83f9 (diff)
Unveil should work because this only opens the configuration file,
and re-exec's itself. That locks the pledge 'exec' nicely.
Diffstat (limited to 'usr.sbin/rebound')
-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");