Hi,
ntpd(8) also doesn't seem to delete its unix control socket, but in this case
it's not a matter of calling control_cleanup() from a chrooted process
but instead not calling it at all.
OK?
Index: ntpd.c
===================================================================
RCS file: /cvs/src/usr.sbin/ntpd/ntpd.c,v
retrieving revision 1.113
diff -u -p -u -r1.113 ntpd.c
--- ntpd.c 9 Jan 2017 14:49:22 -0000 1.113
+++ ntpd.c 2 Aug 2018 10:17:11 -0000
@@ -244,7 +244,7 @@ main(int argc, char *argv[])
* Constraint processes are forked with certificates in memory,
* then privdrop into chroot before speaking to the outside world.
*/
- if (pledge("stdio rpath inet settime proc exec id", NULL) == -1)
+ if (pledge("stdio rpath cpath inet settime proc exec id", NULL) == -1)
err(1, "pledge");
while (quit == 0) {
@@ -327,6 +327,7 @@ main(int argc, char *argv[])
msgbuf_clear(&ibuf->w);
free(ibuf);
+ control_cleanup(CTLSOCKET);
log_info("Terminating");
return (0);
}