summaryrefslogtreecommitdiff
path: root/sys/kern/kern_pledge.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2018-01-08 11:54:29 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2018-01-08 11:54:29 +0000
commitf0909d36eaaf373fb38f3831a2ec42032bea8d7a (patch)
tree82afe12a80ed7596c03aef905957997497a36497 /sys/kern/kern_pledge.c
parent6d61c2b2fec095e795e7adb2f2e69b0ad0e992ba (diff)
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@
Diffstat (limited to 'sys/kern/kern_pledge.c')
-rw-r--r--sys/kern/kern_pledge.c10
1 files changed, 9 insertions, 1 deletions
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 <nicm@openbsd.org>
@@ -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)