From: benno Date: Tue, 10 Jul 2018 13:02:14 +0000 (+0000) Subject: move the top level pledge, getrtable() works with pledge stdio. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=445db22e74d57041e62535280bdf79334f2fa4ef;p=openbsd move the top level pledge, getrtable() works with pledge stdio. ok claudio@ phessler@ --- diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index bec68d17eb6..2b36c46b5e5 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.202 2017/11/27 16:53:04 sthen Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.203 2018/07/10 13:02:14 benno Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -129,13 +129,13 @@ main(int argc, char *argv[]) char *sockname; enum imsg_type type; + if (pledge("stdio rpath wpath cpath unix inet dns", NULL) == -1) + err(1, "pledge"); + r = getrtable(); if (asprintf(&sockname, "%s.%d", SOCKET_NAME, r) == -1) err(1, "asprintf"); - if (pledge("stdio rpath wpath cpath unix inet dns", NULL) == -1) - err(1, "pledge"); - while ((ch = getopt(argc, argv, "ns:")) != -1) { switch (ch) { case 'n':