From: mpi Date: Mon, 8 Jan 2018 11:54:28 +0000 (+0000) Subject: Allow TIOCUCNTL issued on a pty(4) master in promise "tty". X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3268d68dcb9980823e813763687348eab97edc5a;p=openbsd Allow TIOCUCNTL issued on a pty(4) master in promise "tty". This will be soon be used to emulate BREAK commands in vmd(8). ok nicm@, ccardenas@, deraadt@ --- diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 232d3003095..3586720d0ad 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.226 2017/12/12 01:12:34 deraadt Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.227 2018/01/08 11:54:28 mpi Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -1123,6 +1123,14 @@ pledge_ioctl(struct proc *p, long com, struct file *fp) if (cdevsw[major(vp->v_rdev)].d_open != ptmopen) break; return (0); + case TIOCUCNTL: /* vmd */ + if ((p->p_p->ps_pledge & PLEDGE_RPATH) == 0) + break; + if ((p->p_p->ps_pledge & PLEDGE_WPATH) == 0) + break; + if (cdevsw[major(vp->v_rdev)].d_open != ptcopen) + break; + return (0); #endif /* NPTY > 0 */ case TIOCSPGRP: if ((p->p_p->ps_pledge & PLEDGE_PROC) == 0)