diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2004-03-16 12:06:44 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2004-03-16 12:06:44 +0000 |
commit | a4ff75d9949de45c17671a682dcb1f44912417bc (patch) | |
tree | 6c8317daec23e16a52ba9c379f775c620b10eb38 /usr.sbin/bgpd/bgpd.c | |
parent | fbdf6dd5103af565d36181e82983eca843a281e7 (diff) |
delay creating the control socket until after forking, but before chroot
(lives in /var/run, i. e. outside chroot) and privdrop.
claudio ok
Diffstat (limited to 'usr.sbin/bgpd/bgpd.c')
-rw-r--r-- | usr.sbin/bgpd/bgpd.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c index 9eb31212719..3240a9ddea6 100644 --- a/usr.sbin/bgpd/bgpd.c +++ b/usr.sbin/bgpd/bgpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.c,v 1.87 2004/03/12 16:21:34 henning Exp $ */ +/* $OpenBSD: bgpd.c,v 1.88 2004/03/16 12:06:43 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -104,7 +104,7 @@ main(int argc, char *argv[]) pid_t io_pid = 0, rde_pid = 0, pid; char *conffile; int debug = 0; - int ch, csock, i, j, n, nfds, timeout; + int ch, i, j, n, nfds, timeout; int pipe_m2s[2]; int pipe_m2r[2]; int pipe_s2r[2]; @@ -191,9 +191,6 @@ main(int argc, char *argv[]) fcntl(pipe_s2r[1], F_SETFL, O_NONBLOCK) == -1) fatal("fcntl"); - if ((csock = control_init()) == -1) - fatalx("control socket setup failed"); - /* fork children */ rde_pid = rde_main(&conf, peer_l, &net_l, rules_l, &mrt_l, pipe_m2r, pipe_s2r); @@ -213,7 +210,6 @@ main(int argc, char *argv[]) close(pipe_m2r[1]); close(pipe_s2r[0]); close(pipe_s2r[1]); - close(csock); imsg_init(&ibuf_se, pipe_m2s[0]); imsg_init(&ibuf_rde, pipe_m2r[0]); |