[net.bugs.4bsd] the script program

schaefer@bgsuvax.UUCP (Stephen Schaefer) (01/28/86)

[line-eater bug food]

Context: 4.2BSD, Vax 11/780, source license

For the third time I am about to go fumigating /usr/src/ucb/script.c, but
I thought I'd mention it here:

	script is not properly processing control-s control-q from the
terminal, since it sets the real terminal to RAW mode, and lets the
pseudo terminal handle all the processing, which somehow doesn't
respond to the control-s control-q that ought to be passed to it.  A
long while back, someone on the Mt. Xinu bug list suggested that the
real terminal be put in CBREAK mode, but after trying that, we had all
the terminal generated signals (control-Z, control-Y, control-C,
control-\) being sent to script and not its sub-process.  Before I go
playing with process/terminal groups, signal catchers and the like,
has someone fixed this already?

	I've already fixed 2 problems with this program; if enough
interest is shown I'll post them to this group.  First, when the child
shell died, there was apparently some race condition which caused the
parent reading the pseudo terminal master to hang on the read,
ignoring the SIGCHLD signal.  I forget the details, but the new code
hasn't broken in this way for better than three months now.  Second,
Script would die while trying to get a pseudo terminal because it
sloppily tested its permission on the master without checking those on
the slave.  Startup should theoretically be slower because the fixed
version does a lot more testing, but we haven't been able to notice
it.

	Finally, a design question: why does it use three processes
(parent script, child script, grandchild shell) when I can only see
the need for two (parent script, child shell)?

	Thanks in advance,

	Stephen P. Schaefer
	...!cbosgd!osu-eddie!bgsuvax!schaefer
	schaefer%bgsuvax.CSNET@csnet-relay