From: renato Date: Fri, 23 Oct 2015 10:11:20 +0000 (+0000) Subject: Make use of pledge(2). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7ce073ef438e85ae478ad7a1ba35a8c73d49ed82;p=openbsd Make use of pledge(2). ok deraadt@ --- diff --git a/usr.sbin/ldpctl/ldpctl.c b/usr.sbin/ldpctl/ldpctl.c index ebd67ef3657..7c4779ff717 100644 --- a/usr.sbin/ldpctl/ldpctl.c +++ b/usr.sbin/ldpctl/ldpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpctl.c,v 1.23 2015/09/27 17:30:38 stsp Exp $ +/* $OpenBSD: ldpctl.c,v 1.24 2015/10/23 10:11:20 renato Exp $ * * Copyright (c) 2009 Michele Marchetto * Copyright (c) 2005 Claudio Jeker @@ -94,6 +94,9 @@ main(int argc, char *argv[]) if (connect(ctl_sock, (struct sockaddr *)&sun, sizeof(sun)) == -1) err(1, "connect: %s", LDPD_SOCKET); + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + if ((ibuf = malloc(sizeof(struct imsgbuf))) == NULL) err(1, NULL); imsg_init(ibuf, ctl_sock);