Return EBUSY if we try to attach to a tty that is already being
snooped on. This causes all kinds of Bad Things(tm) to happen since closing one session will clobber state that's needed for the other one. This could theoretically be supported if the code was careful, but until somebody implements that, preventing this will stop people from unknowingly shooting themselves in the foot.
This commit is contained in:
parent
2f7a385114
commit
2c9fb90995
@ -508,6 +508,8 @@ snpioctl(dev, cmd, data, flags, td)
|
||||
tp = snpdevtotty(tdev);
|
||||
if (!tp)
|
||||
return (EINVAL);
|
||||
if (tp->t_state & TS_SNOOP)
|
||||
return (EBUSY);
|
||||
|
||||
s = spltty();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user