Simplify and lock down priv_open():
authorguenther <guenther@openbsd.org>
Sun, 11 Oct 2015 07:32:06 +0000 (07:32 +0000)
committerguenther <guenther@openbsd.org>
Sun, 11 Oct 2015 07:32:06 +0000 (07:32 +0000)
commit116a5cae52969a2c9d78d06ad3d89b6396ab42f7
treef046447912a2f1931ad69ae2316f5193d556d857
parent25d2bf7f9a4f235ad505aed911725c6924b71130
Simplify and lock down priv_open():
 * kill the 'mode' argument
 * fail if passed any flags other than O_ACCMODE OR O_NONBLOCK
 * paranoia: mask O_CREAT when calling open() with only two arguments
 * instead of using ioctl(FIONBIO) after the fact, pass O_NONBLOCK to
   priv_open()

"good start" deraadt@
ok yasuoka@
usr.sbin/npppd/npppd/npppd_iface.c
usr.sbin/npppd/npppd/npppd_tun.c
usr.sbin/npppd/npppd/privsep.c
usr.sbin/npppd/npppd/privsep.h
usr.sbin/npppd/pppoe/pppoed.c