summaryrefslogtreecommitdiff
path: root/usr.sbin/hotplugd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-19 06:05:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-19 06:05:41 +0000
commit4312bb3fa34d39f8258d5e1e5dd01eacbb711510 (patch)
tree7988f7852fbab627709cab11a9ac2d3ecbbd5ae6 /usr.sbin/hotplugd
parenta7d5f45e05578c0ef9e12313ecef3930eb314b24 (diff)
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':