diff options
author | claudio <claudio@openbsd.org> | 2015-12-05 12:20:13 +0000 |
---|---|---|
committer | claudio <claudio@openbsd.org> | 2015-12-05 12:20:13 +0000 |
commit | 358269bbfcc3257b062a23fe654ebefa242ea0d5 (patch) | |
tree | da84905b9624c90b755a880c29a32c6764069115 /usr.sbin/ospfd/rde.c | |
parent | ifq_deq_rollback without a preceding ifq_deq_begin is fail. (diff) | |
download | wireguard-openbsd-358269bbfcc3257b062a23fe654ebefa242ea0d5.tar.xz wireguard-openbsd-358269bbfcc3257b062a23fe654ebefa242ea0d5.zip |
Pledge ospfd SE ("stdio inet mcast") and RDE ("stdio") move some code
around to make it possible. Parent can't be pledged at the moment because
of carp ioctl (carp demote). Putting it in so that people can test.
OK benno@
Diffstat (limited to 'usr.sbin/ospfd/rde.c')
-rw-r--r-- | usr.sbin/ospfd/rde.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/rde.c b/usr.sbin/ospfd/rde.c index d68109201b9..6d53eb3a953 100644 --- a/usr.sbin/ospfd/rde.c +++ b/usr.sbin/ospfd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.99 2015/12/03 11:41:06 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.100 2015/12/05 12:20:13 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -111,6 +111,9 @@ rde(struct ospfd_conf *xconf, int pipe_parent2rde[2], int pipe_ospfe2rde[2], return (pid); } + /* cleanup a bit */ + kif_clear(); + rdeconf = xconf; if ((pw = getpwnam(OSPFD_USER)) == NULL) @@ -129,6 +132,9 @@ rde(struct ospfd_conf *xconf, int pipe_parent2rde[2], int pipe_ospfe2rde[2], setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid)) fatal("can't drop privileges"); + if (pledge("stdio", NULL) == -1) + fatal("pledge"); + event_init(); rde_nbr_init(NBR_HASHSIZE); lsa_init(&asext_tree); @@ -211,7 +217,6 @@ rde_shutdown(void) } rde_asext_free(); rde_nbr_free(); - kr_shutdown(); msgbuf_clear(&iev_ospfe->ibuf.w); free(iev_ospfe); |