From 37d73cfacedf74380a028d4eaa16a839cd05b1f2 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 26 Oct 2018 06:03:04 +0000 Subject: Unveil should work because this only opens the configuration file, and re-exec's itself. That locks the pledge 'exec' nicely. --- usr.sbin/rebound/rebound.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'usr.sbin/rebound') 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 * @@ -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"); -- cgit v1.2.3