Rather than re-opening the driftfile to write, keep it open; rewinding
authorderaadt <deraadt@openbsd.org>
Fri, 23 Oct 2015 16:39:13 +0000 (16:39 +0000)
committerderaadt <deraadt@openbsd.org>
Fri, 23 Oct 2015 16:39:13 +0000 (16:39 +0000)
commit348cf342aa4134b077dc8b11450b911a3f278f28
treef987b17232779ed71f416f7c6d7698bee4f67b23
parent54f214dfaaf05bb1403344ce030dbc9f08414d19
Rather than re-opening the driftfile to write, keep it open; rewinding
and coping with error conditions... that lets us avoid a pledge "wpath".

Putting it all together, this lets the master ntpd pledge "stdio rpath
inet settime proc id".  It works like this: "rpath" to load the
certificates, "proc" to create constraint processes, "id" to chroot
and lock the constraint processes into a jail, then "inet" to open a
https session.  "settime" is used by the master to manage the system
time when the ntp-speaking engine instructs the master.

with help from naddy
usr.sbin/ntpd/ntpd.c