From 8bdd03fbee1441b67501f3ab1e1fc07e061be738 Mon Sep 17 00:00:00 2001 From: deraadt Date: Wed, 28 Oct 2015 11:17:24 +0000 Subject: [PATCH] TIOCCONS will probably never be permitted, but it is good style to set p_pledgenote before NDINIT() --- sys/kern/tty.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index c40d6fd9f88..af98f490147 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $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 $ */ /*- @@ -59,6 +59,7 @@ #include #include #include +#include #include @@ -796,6 +797,7 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) 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) -- 2.20.1