summaryrefslogtreecommitdiffstats
path: root/usr.sbin/hotplugd
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-11-19 06:05:40 +0000
committerderaadt <deraadt@openbsd.org>2015-11-19 06:05:40 +0000
commite5ac0ed5e25775f12358f59f086d401318832ab4 (patch)
treef21e471f24ce8768c6ab9f922cb3f97e3d766fb5 /usr.sbin/hotplugd
parentcorrects leaks refs to files introduced by my previous commit for pledge_socket. (diff)
downloadwireguard-openbsd-e5ac0ed5e25775f12358f59f086d401318832ab4.tar.xz
wireguard-openbsd-e5ac0ed5e25775f12358f59f086d401318832ab4.zip
pledge "stdio rpath proc exec" for entire lifetime. rpath must remain
even late, because of access() before doing wasteful fork+execs.
Diffstat (limited to 'usr.sbin/hotplugd')
-rw-r--r--usr.sbin/hotplugd/hotplugd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/hotplugd/hotplugd.c b/usr.sbin/hotplugd/hotplugd.c
index 412b1125474..2e23bc7c19e 100644
--- a/usr.sbin/hotplugd/hotplugd.c
+++ b/usr.sbin/hotplugd/hotplugd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hotplugd.c,v 1.12 2010/01/10 13:20:41 grange Exp $ */
+/* $OpenBSD: hotplugd.c,v 1.13 2015/11/19 06:05:40 deraadt Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -61,6 +61,9 @@ main(int argc, char *argv[])
struct sigaction sact;
struct hotplug_event he;
+ if (pledge("stdio rpath proc exec", NULL) == -1)
+ err(1, "pledge");
+
while ((ch = getopt(argc, argv, "d:")) != -1)
switch (ch) {
case 'd':