diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-17 23:12:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-17 23:12:47 +0000 |
commit | 726b3c54ef7d4eab77916add0c14f86c2e5c45a5 (patch) | |
tree | 79d7102773fcc68b61333c70cbc2af507838eb0e /sys/kern/kern_pledge.c | |
parent | c600976b301c1330eda372aab6c742d13704a4c9 (diff) |
Allow the nasty ioctl TIOCSTI in "tty", but also require the "proc"
permission. For now, we'll tighten it down further later.
Diffstat (limited to 'sys/kern/kern_pledge.c')
-rw-r--r-- | sys/kern/kern_pledge.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 203f901fee1..c4f47f88fb9 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.46 2015/10/17 23:04:06 deraadt Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.47 2015/10/17 23:12:46 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -1094,12 +1094,11 @@ pledge_ioctl_check(struct proc *p, long com, void *v) break; return (0); #endif /* NPTY > 0 */ -#if notyet case TIOCSTI: /* ksh? csh? */ - if (fp->f_type == DTYPE_VNODE && (vp->v_flag & VISTTY)) + if ((p->p_p->ps_pledge & PLEDGE_PROC) == 0 && + fp->f_type == DTYPE_VNODE && (vp->v_flag & VISTTY)) return (0); break; -#endif case TIOCSCTTY: /* tmux etc */ if ((p->p_p->ps_pledge & PLEDGE_ID) == 0 && fp->f_type == DTYPE_VNODE && (vp->v_flag & VISTTY)) |