diff options
author | 2015-12-23 20:09:47 +0000 | |
---|---|---|
committer | 2015-12-23 20:09:47 +0000 | |
commit | e48418c3f7d4712155d2e9a9a5912a1e245cbfbc (patch) | |
tree | 2b5b5ba03dc14571a5cc56ea4cd832d10498be60 | |
parent | Update sqlite3 to 3.9.2. Bump major, regen .pc and header. Changes (diff) | |
download | wireguard-openbsd-e48418c3f7d4712155d2e9a9a5912a1e245cbfbc.tar.xz wireguard-openbsd-e48418c3f7d4712155d2e9a9a5912a1e245cbfbc.zip |
If PLEDGE_AUDIO is set, allow audio(4) ioctls necessary
to use raw audio devices.
ok deraadt, semarie
-rw-r--r-- | sys/kern/kern_pledge.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 396d2cb64f6..850d900a7ce 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.136 2015/12/06 17:50:21 deraadt Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.137 2015/12/23 20:09:47 ratchov Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -40,6 +40,7 @@ #include <sys/disklabel.h> #include <sys/dkio.h> #include <sys/mtio.h> +#include <sys/audioio.h> #include <net/bpf.h> #include <net/route.h> #include <net/if.h> @@ -1172,6 +1173,21 @@ pledge_ioctl(struct proc *p, long com, struct file *fp) } } + if ((p->p_p->ps_pledge & PLEDGE_AUDIO)) { + switch (com) { + case AUDIO_GETPOS: + case AUDIO_SETINFO: + case AUDIO_GETINFO: + case AUDIO_GETENC: + case AUDIO_SETFD: + case AUDIO_GETPROPS: + if (fp->f_type == DTYPE_VNODE && + vp->v_type == VCHR && + cdevsw[major(vp->v_rdev)].d_open == audioopen) + return (0); + } + } + if ((p->p_p->ps_pledge & PLEDGE_DISKLABEL)) { switch (com) { case DIOCGDINFO: |