diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-17 22:58:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-17 22:58:31 +0000 |
commit | c61d5c32572e9d51635e8e47ae25b99ebcea0b8d (patch) | |
tree | 3b1c577593552bfec8591e46d398f19a1d891cc7 | |
parent | 596b7b20bf02f0d7c4910f359d4b13fc1d8f8656 (diff) |
Allow TIOCSCTTY on tty devices, if the pledge says "tty id"
worked out with nicm
-rw-r--r-- | sys/kern/kern_pledge.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index a155f22cbed..08329c03a61 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.43 2015/10/17 22:54:23 deraadt Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.44 2015/10/17 22:58:30 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -1103,6 +1103,11 @@ pledge_ioctl_check(struct proc *p, long com, void *v) 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)) + return (0); + break; case TIOCSPGRP: if ((p->p_p->ps_pledge & PLEDGE_PROC) == 0) break; |