diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-03 02:47:16 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-03 02:47:16 +0000 |
commit | 34c90b84b50c5197921be23eb460b80ddc851e72 (patch) | |
tree | 51d24f85e6f3d768d68b7ce32f3649f6e944d8dd | |
parent | c60042025da820772fb142ddcb369ac83020645d (diff) |
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.
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index 0b591e851f5..b5fe4e025fb 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -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> @@ -565,6 +565,9 @@ ctl_main(int argc, char *argv[]) if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) err(1, "connect: %s", sockname); + if (tame("stdio", NULL) == -1) + err(1, "tame"); + if ((ibuf_ctl = malloc(sizeof(struct imsgbuf))) == NULL) err(1, NULL); imsg_init(ibuf_ctl, fd); |