summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorRicardo Mestre <mestre@cvs.openbsd.org>2020-06-22 15:09:35 +0000
committerRicardo Mestre <mestre@cvs.openbsd.org>2020-06-22 15:09:35 +0000
commit121780d2e5da84944a88eadf7a0f3e07b21f60aa (patch)
tree68d68cc4cb05240068e52c5cf104bd87b08db96b /usr.sbin
parent7040d495c47b70c1f4fb8c87b373603d299d65a4 (diff)
On my previous commit I made the wrong assumption that the control socket was
being unlink(2)ed from the main proc so I removed "cpath" from the pledge(2) on the ldpe proc but actually the socket was unlink(2)ed from here, this means the daemon would crash on exit due to pledge(2) not having "cpath" permissions anymore. Finish the job by just not deleting the socket at all during control_cleanup(), which keeps the control program still working without issues but more importantly prevents the crash during exit, sorry about that. Crash reported by wlund at iki.fi OK deraadt@ claudio@ remi@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ldpd/control.c5
-rw-r--r--usr.sbin/ldpd/control.h4
-rw-r--r--usr.sbin/ldpd/ldpe.c4
3 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/ldpd/control.c b/usr.sbin/ldpd/control.c
index fe0eebdbea6..5c598cd1917 100644
--- a/usr.sbin/ldpd/control.c
+++ b/usr.sbin/ldpd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.29 2017/03/03 23:30:57 renato Exp $ */
+/* $OpenBSD: control.c,v 1.30 2020/06/22 15:09:34 mestre Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -98,11 +98,10 @@ control_listen(void)
}
void
-control_cleanup(char *path)
+control_cleanup(void)
{
accept_del(control_fd);
close(control_fd);
- unlink(path);
}
/* ARGSUSED */
diff --git a/usr.sbin/ldpd/control.h b/usr.sbin/ldpd/control.h
index f4f5525707d..72a9aa837a6 100644
--- a/usr.sbin/ldpd/control.h
+++ b/usr.sbin/ldpd/control.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.h,v 1.9 2017/03/03 23:30:57 renato Exp $ */
+/* $OpenBSD: control.h,v 1.10 2020/06/22 15:09:34 mestre Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -32,7 +32,7 @@ extern struct ctl_conns ctl_conns;
int control_init(char *);
int control_listen(void);
-void control_cleanup(char *);
+void control_cleanup(void);
int control_imsg_relay(struct imsg *);
#endif /* _CONTROL_H_ */
diff --git a/usr.sbin/ldpd/ldpe.c b/usr.sbin/ldpd/ldpe.c
index 6200d552882..404743ee8d5 100644
--- a/usr.sbin/ldpd/ldpe.c
+++ b/usr.sbin/ldpd/ldpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpe.c,v 1.76 2019/08/10 01:30:53 mestre Exp $ */
+/* $OpenBSD: ldpe.c,v 1.77 2020/06/22 15:09:34 mestre Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@@ -171,7 +171,7 @@ ldpe_shutdown(void)
msgbuf_clear(&iev_main->ibuf.w);
close(iev_main->ibuf.fd);
- control_cleanup(global.csock);
+ control_cleanup();
config_clear(leconf);
if (sysdep.no_pfkey == 0) {