summaryrefslogtreecommitdiff
path: root/usr.sbin/eigrpd/eigrpe.c
diff options
context:
space:
mode:
authorRicardo Mestre <mestre@cvs.openbsd.org>2018-08-02 06:28:36 +0000
committerRicardo Mestre <mestre@cvs.openbsd.org>2018-08-02 06:28:36 +0000
commitd66f9cc7028585163daa3d0e70f19c1175f235a2 (patch)
tree315995fbdd582f962e1c39c7ed25368cd5fbd445 /usr.sbin/eigrpd/eigrpe.c
parent6c94ef23bd82b7b426f6d235742288ee3832a1ca (diff)
Currently when eigrpd(8) shuts down then its unix control socket is being
unlink(2)ed from eigrpe engine process, the problem is that this proc is chrooted and therefore the socket will never be deleted. In order to solve it we need to bring control_cleanup() function, which calls unlink(2), into the main proc which is not chrooted. This is the way it's already done for several other daemons we have in our base. Additionally we also need to move the "cpath" pledge(2) promise from the child process to the main process in order for the latter to be allowed to delete the socket and while here shuffle the promises into their canonical form. OK florian@ and benno@
Diffstat (limited to 'usr.sbin/eigrpd/eigrpe.c')
-rw-r--r--usr.sbin/eigrpd/eigrpe.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/eigrpd/eigrpe.c b/usr.sbin/eigrpd/eigrpe.c
index 5daba291106..afe92e68206 100644
--- a/usr.sbin/eigrpd/eigrpe.c
+++ b/usr.sbin/eigrpd/eigrpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eigrpe.c,v 1.34 2016/09/02 17:59:58 benno Exp $ */
+/* $OpenBSD: eigrpe.c,v 1.35 2018/08/02 06:28:35 mestre Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@@ -133,7 +133,7 @@ eigrpe(int debug, int verbose, char *sockname)
setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid))
fatal("can't drop privileges");
- if (pledge("stdio cpath inet mcast recvfd", NULL) == -1)
+ if (pledge("stdio inet mcast recvfd", NULL) == -1)
fatal("pledge");
event_init();
@@ -187,7 +187,6 @@ eigrpe_shutdown(void)
msgbuf_clear(&iev_main->ibuf.w);
close(iev_main->ibuf.fd);
- control_cleanup(global.csock);
config_clear(econf);
event_del(&ev4);