From: deraadt Date: Sat, 17 Oct 2015 22:58:30 +0000 (+0000) Subject: Allow TIOCSCTTY on tty devices, if the pledge says "tty id" X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3611f3d46d5805ecc93fc82c23d215099605a6cd;p=openbsd Allow TIOCSCTTY on tty devices, if the pledge says "tty id" worked out with nicm --- 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 @@ -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;