summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2016-07-20 21:04:45 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2016-07-20 21:04:45 +0000
commit4b0859efde80daec8ca78fe59a5f649ee01eb573 (patch)
treea64b3466ef02557f0029de3d587b317b5b681321 /usr.sbin
parentb2315b479ebb2e2fbc6ef79b0b6fa1052f4c8a40 (diff)
pledge switchctl
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/switchctl/switchctl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.sbin/switchctl/switchctl.c b/usr.sbin/switchctl/switchctl.c
index 2ed852cd313..658b11152dd 100644
--- a/usr.sbin/switchctl/switchctl.c
+++ b/usr.sbin/switchctl/switchctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: switchctl.c,v 1.1 2016/07/19 16:54:26 reyk Exp $ */
+/* $OpenBSD: switchctl.c,v 1.2 2016/07/20 21:04:44 reyk Exp $ */
/*
* Copyright (c) 2007-2015 Reyk Floeter <reyk@openbsd.org>
@@ -144,6 +144,14 @@ main(int argc, char *argv[])
err(1, "connect: %s", sock);
}
+ /*
+ * pledge in switchctl:
+ * stdio - for malloc and basic I/O including events.
+ * dns - for parsehostport() in the device spec.
+ */
+ if (pledge("stdio dns", NULL) == -1)
+ err(1, "pledge");
+
if (res->ibuf != NULL)
ibuf = res->ibuf;
else