p_pledgenote before NDINIT()
-/* $OpenBSD: tty.c,v 1.124 2015/08/28 03:49:34 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.125 2015/10/28 11:17:24 deraadt Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
#include <sys/pool.h>
#include <sys/poll.h>
#include <sys/unistd.h>
+#include <sys/pledge.h>
#include <sys/namei.h>
return (EBUSY);
/* ensure user can open the real console */
+ p->p_pledgenote = PLEDGE_RPATH | PLEDGE_WPATH;
NDINIT(&nid, LOOKUP, FOLLOW, UIO_SYSSPACE, "/dev/console", p);
error = namei(&nid);
if (error)