diff options
author | 2015-10-28 11:17:24 +0000 | |
---|---|---|
committer | 2015-10-28 11:17:24 +0000 | |
commit | 8bdd03fbee1441b67501f3ab1e1fc07e061be738 (patch) | |
tree | b09a82652972b1862163d6586ae8cd0ce6b45558 /sys/kern/tty.c | |
parent | Though sys_ktrace is not yet pledge allowed, prepare by setting (diff) | |
download | wireguard-openbsd-8bdd03fbee1441b67501f3ab1e1fc07e061be738.tar.xz wireguard-openbsd-8bdd03fbee1441b67501f3ab1e1fc07e061be738.zip |
TIOCCONS will probably never be permitted, but it is good style to set
p_pledgenote before NDINIT()
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 <sys/pool.h> #include <sys/poll.h> #include <sys/unistd.h> +#include <sys/pledge.h> #include <sys/namei.h> @@ -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) |