From 5d44878a832248899ebfec74068a8e125bafffe1 Mon Sep 17 00:00:00 2001 From: reyk Date: Wed, 20 Jul 2016 21:04:44 +0000 Subject: [PATCH] pledge switchctl --- usr.sbin/switchctl/switchctl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 @@ -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 -- 2.20.1