diff options
author | 2017-06-29 04:10:07 +0000 | |
---|---|---|
committer | 2017-06-29 04:10:07 +0000 | |
commit | a526c2f70cd8c814b2c7b8d3494059c4a20282f8 (patch) | |
tree | 7a73b86f8ca550e592902a4724bdaceca4270b8f /sys/kern/tty.c | |
parent | set c.c_maxrxlen to something. apparently lost a line somewhere. (diff) | |
download | wireguard-openbsd-a526c2f70cd8c814b2c7b8d3494059c4a20282f8.tar.xz wireguard-openbsd-a526c2f70cd8c814b2c7b8d3494059c4a20282f8.zip |
Due to risks known for decades, TIOCSTI now performs no action, and simply
returns EIO. The base system has been cleaned of TIOCSTI uses (collaboration
between anton and I), and the ports tree appears mostly clean. A few
stragglers may be discovered and cleaned up later...
In a month or so, we should see if the #define can be removed entirely.
ok anton tedu, support from millert
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 5f965301144..f80e4bd983f 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.133 2017/01/21 05:42:03 guenther Exp $ */ +/* $OpenBSD: tty.c,v 1.134 2017/06/29 04:10:07 deraadt Exp $ */ /* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */ /*- @@ -733,7 +733,6 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) case TIOCSETAW: case TIOCSPGRP: case TIOCSTAT: - case TIOCSTI: case TIOCSWINSZ: while (isbackground(pr, tp) && (pr->ps_flags & PS_PPWAIT) == 0 && @@ -962,11 +961,7 @@ ttioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct proc *p) splx(s); break; case TIOCSTI: /* simulate terminal input */ - if (p->p_ucred->cr_uid && (flag & FREAD) == 0) - return (EPERM); - if (p->p_ucred->cr_uid && !isctty(pr, tp)) - return (EACCES); - (*linesw[tp->t_line].l_rint)(*(u_char *)data, tp); + return (EIO); break; case TIOCSTOP: /* stop output, like ^S */ s = spltty(); |