Browse Source

In the ntpctl(1) case, after it has connect()'d to ntpd we can tame "stdio"

since that is all it will do till termination.
OPENBSD_5_9
deraadt 9 years ago
parent
commit
af212fce6a
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/usr.sbin/ntpd/ntpd.c

+ 4
- 1
src/usr.sbin/ntpd/ntpd.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.c,v 1.94 2015/07/18 00:53:44 bcook Exp $ */
/* $OpenBSD: ntpd.c,v 1.95 2015/10/03 02:47:15 deraadt Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -565,6 +565,9 @@ ctl_main(int argc, char *argv[])
if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1)
err(1, "connect: %s", sockname); err(1, "connect: %s", sockname);
if (tame("stdio", NULL) == -1)
err(1, "tame");
if ((ibuf_ctl = malloc(sizeof(struct imsgbuf))) == NULL) if ((ibuf_ctl = malloc(sizeof(struct imsgbuf))) == NULL)
err(1, NULL); err(1, NULL);
imsg_init(ibuf_ctl, fd); imsg_init(ibuf_ctl, fd);


Loading…
Cancel
Save