diff options
author | 2016-07-20 21:04:44 +0000 | |
---|---|---|
committer | 2016-07-20 21:04:44 +0000 | |
commit | 5d44878a832248899ebfec74068a8e125bafffe1 (patch) | |
tree | 7e70b16328260e571599e45c6d04f85ddb87f398 | |
parent | pledge(2) all the switchd processes. (diff) | |
download | wireguard-openbsd-5d44878a832248899ebfec74068a8e125bafffe1.tar.xz wireguard-openbsd-5d44878a832248899ebfec74068a8e125bafffe1.zip |
pledge switchctl
-rw-r--r-- | usr.sbin/switchctl/switchctl.c | 10 |
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 |