Browse Source

ntpd(8) has logic in place to delete its control socket on shutdown, but it

currently doesn't call the function control_cleanup to do so. The solution is
to simply call that function just before the program quits.
"sure" henning@
OPENBSD_6_4
mestre 6 years ago
parent
commit
b448df251e
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/usr.sbin/ntpd/ntpd.c

+ 3
- 2
src/usr.sbin/ntpd/ntpd.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.c,v 1.113 2017/01/09 14:49:22 reyk Exp $ */
/* $OpenBSD: ntpd.c,v 1.114 2018/08/02 13:05:34 mestre Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -244,7 +244,7 @@ main(int argc, char *argv[])
* Constraint processes are forked with certificates in memory, * Constraint processes are forked with certificates in memory,
* then privdrop into chroot before speaking to the outside world. * 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"); err(1, "pledge");
while (quit == 0) { while (quit == 0) {
@ -327,6 +327,7 @@ main(int argc, char *argv[])
msgbuf_clear(&ibuf->w); msgbuf_clear(&ibuf->w);
free(ibuf); free(ibuf);
control_cleanup(CTLSOCKET);
log_info("Terminating"); log_info("Terminating");
return (0); return (0);
} }


Loading…
Cancel
Save