No need to call tzset() and log_init() in the forked constraint
authorreyk <reyk@openbsd.org>
Thu, 21 May 2015 14:24:43 +0000 (14:24 +0000)
committerreyk <reyk@openbsd.org>
Thu, 21 May 2015 14:24:43 +0000 (14:24 +0000)
handler.  It is run in a chroot, so tzset() wouldn't even succeed to
open the zone file.  Found with tame.

OK deraadt@

usr.sbin/ntpd/constraint.c

index 25a4fa7..2e48cf7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: constraint.c,v 1.10 2015/05/18 14:19:23 reyk Exp $    */
+/*     $OpenBSD: constraint.c,v 1.11 2015/05/21 14:24:43 reyk Exp $    */
 
 /*
  * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -195,9 +195,6 @@ constraint_query(struct constraint *cstr)
                close(pipes[1]);
                return (-1);
        case 0:
-               tzset();
-               log_init(conf->debug);
-
                setproctitle("constraint from %s", hname);
 
                /* Child process */