> The case I'm wondering about is:

>       - open real tty
>       - make it the control tty
>       - open /dev/tty
>       - close the real tty
>       - read/write the /dev/tty fd

> It looks to me as though this could lead to the underlying tty driver
> getting a read/write call when, according to its open/close calls,
> it's not open.

I've got the test program written.  On 5.2/amd64 with /dev/ttyE1 as the
test tty (no getty running on it, of course), output works just fine
(this doesn't surprise me; I find it plausible that wscons tty
open/close are pretty much no-ops aside from possible permissions
checking on open).

I'm going to test with real hardware on 5.2/amd64 and 1.4T/sparc, but
those will not be happening as immediately.

The test program is in ftp.rodents-montreal.org:/mouse/misc/ctty-test.c
in case anyone wants to try it on other versions or other hardware.

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mo...@rodents-montreal.org
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Reply via email to