summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd
diff options
context:
space:
mode:
authorremi <remi@cvs.openbsd.org>2020-09-16 20:50:11 +0000
committerremi <remi@cvs.openbsd.org>2020-09-16 20:50:11 +0000
commit95ef9171ed1985e1f7c07cccfa01713e48d4935a (patch)
treeed20737ed271884996391f58ccde716fad0e8625 /usr.sbin/ospfd
parent7d1025a8cc171670409f3fdb74d3a91eedfa6e9c (diff)
Stop removing the control socket on exit and tighten the unveil even
further. This is in line with what other networking daemons do. ok mestre@
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r--usr.sbin/ospfd/control.c7
-rw-r--r--usr.sbin/ospfd/control.h4
-rw-r--r--usr.sbin/ospfd/ospfd.c6
3 files changed, 6 insertions, 11 deletions
diff --git a/usr.sbin/ospfd/control.c b/usr.sbin/ospfd/control.c
index 09733bc407e..b9824b55ed7 100644
--- a/usr.sbin/ospfd/control.c
+++ b/usr.sbin/ospfd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.45 2018/08/29 08:43:16 remi Exp $ */
+/* $OpenBSD: control.c,v 1.46 2020/09/16 20:50:10 remi Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -125,13 +125,10 @@ control_listen(void)
}
void
-control_cleanup(char *path)
+control_cleanup(void)
{
- if (path == NULL)
- return;
event_del(&control_state.ev);
event_del(&control_state.evt);
- unlink(path);
}
/* ARGSUSED */
diff --git a/usr.sbin/ospfd/control.h b/usr.sbin/ospfd/control.h
index ce2a6d02c1d..02df29924ee 100644
--- a/usr.sbin/ospfd/control.h
+++ b/usr.sbin/ospfd/control.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.h,v 1.7 2018/08/29 08:43:16 remi Exp $ */
+/* $OpenBSD: control.h,v 1.8 2020/09/16 20:50:10 remi Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -40,6 +40,6 @@ int control_listen(void);
void control_accept(int, short, void *);
void control_dispatch_imsg(int, short, void *);
int control_imsg_relay(struct imsg *);
-void control_cleanup(char *);
+void control_cleanup(void);
#endif /* _CONTROL_H_ */
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c
index 5d00cc81912..0f8f0e8485e 100644
--- a/usr.sbin/ospfd/ospfd.c
+++ b/usr.sbin/ospfd/ospfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfd.c,v 1.113 2020/06/26 19:04:38 bket Exp $ */
+/* $OpenBSD: ospfd.c,v 1.114 2020/09/16 20:50:10 remi Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -282,8 +282,6 @@ main(int argc, char *argv[])
if (unveil("/", "r") == -1)
fatal("unveil");
- if (unveil(ospfd_conf->csock, "c") == -1)
- fatal("unveil");
if (unveil(NULL, NULL) == -1)
fatal("unveil");
@@ -318,7 +316,7 @@ ospfd_shutdown(void)
msgbuf_clear(&iev_rde->ibuf.w);
close(iev_rde->ibuf.fd);
- control_cleanup(ospfd_conf->csock);
+ control_cleanup();
while ((r = SIMPLEQ_FIRST(&ospfd_conf->redist_list)) != NULL) {
SIMPLEQ_REMOVE_HEAD(&ospfd_conf->redist_list, entry);
free(r);