diff options
author | 2015-10-16 13:59:58 +0000 | |
---|---|---|
committer | 2015-10-16 13:59:58 +0000 | |
commit | 0c9061ec44d7a7af2cc68235f8cb79fdf6de82f8 (patch) | |
tree | 85103a61ca611b17178e9d5a0b9b795d8bbda152 | |
parent | Merge nlist out of boundary access fix with other nlist implementations. (diff) | |
download | wireguard-openbsd-0c9061ec44d7a7af2cc68235f8cb79fdf6de82f8.tar.xz wireguard-openbsd-0c9061ec44d7a7af2cc68235f8cb79fdf6de82f8.zip |
For "tty" pledges, treat TIOCGPGRP and TIOCGWINSZ like TIOCGETA -
returning ENOTTY instead of killing the process.
-rw-r--r-- | sys/kern/kern_pledge.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 888ef8b2444..511378a8ef9 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.33 2015/10/16 13:37:43 millert Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.34 2015/10/16 13:59:58 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -1079,7 +1079,9 @@ pledge_ioctl_check(struct proc *p, long com, void *v) if ((p->p_p->ps_pledge & PLEDGE_PROC) == 0) break; /* FALLTHROUGH */ + case TIOCGPGRP: case TIOCGETA: + case TIOCGWINSZ: /* various programs */ if (fp->f_type == DTYPE_VNODE && (vp->v_flag & VISTTY)) return (0); return (ENOTTY); @@ -1089,8 +1091,6 @@ pledge_ioctl_check(struct proc *p, long com, void *v) return (0); break; #endif - case TIOCGPGRP: - case TIOCGWINSZ: /* various programs */ case TIOCSWINSZ: case TIOCCBRK: /* cu */ case TIOCSBRK: /* cu */ |