Mailing List Archive

[PATCH] console in pty spams conserver when parent process exits
The attached patch fixes a bug in conserver 8.1.16 causing console to
send garbage to the server if read(stdin) returns -1.

This occurs if you run console in a pty on Linux: when the parent
process exits, the kernel eventually SIGHUPs the child, but if the
child keeps reading stdin before this happens, it eventually gets an
EIO, which causes read() to return -1. console currently interprets
this as a valid length and passes -1 to FileWrite(), which ends up
sending a large blob of junk (up to the first NULL) to the server.
This occurs repeatedly until console finally receives SIGHUP.

--Ed