If we have a regular rint handler, never go into rint_bypass mode.
It turns out if we called cfmakeraw() on a TTY with only a rint handler in place, it could inject data into the TTY, even though it should be redirected. Always take a look at the hooks before looking at the termios flags.
This commit is contained in:
parent
49ada8d172
commit
2f086e8725
@ -560,12 +560,15 @@ ttydisc_optimize(struct tty *tp)
|
||||
{
|
||||
tty_lock_assert(tp, MA_OWNED);
|
||||
|
||||
if ((!CMP_FLAG(i, ICRNL|IGNCR|IMAXBEL|INLCR|ISTRIP|IXON) &&
|
||||
if (ttyhook_hashook(tp, rint_bypass)) {
|
||||
tp->t_flags |= TF_BYPASS;
|
||||
} else if (ttyhook_hashook(tp, rint)) {
|
||||
tp->t_flags &= ~TF_BYPASS;
|
||||
} else if (!CMP_FLAG(i, ICRNL|IGNCR|IMAXBEL|INLCR|ISTRIP|IXON) &&
|
||||
(!CMP_FLAG(i, BRKINT) || CMP_FLAG(i, IGNBRK)) &&
|
||||
(!CMP_FLAG(i, PARMRK) ||
|
||||
CMP_FLAG(i, IGNPAR|IGNBRK) == (IGNPAR|IGNBRK)) &&
|
||||
!CMP_FLAG(l, ECHO|ICANON|IEXTEN|ISIG|PENDIN)) ||
|
||||
ttyhook_hashook(tp, rint_bypass)) {
|
||||
!CMP_FLAG(l, ECHO|ICANON|IEXTEN|ISIG|PENDIN)) {
|
||||
tp->t_flags |= TF_BYPASS;
|
||||
} else {
|
||||
tp->t_flags &= ~TF_BYPASS;
|
||||
|
Loading…
Reference in New Issue
Block a user