Subject: script(1) regression
To: None <current-users@netbsd.org>
From: Jukka Salmi <j+nbsd@2007.salmi.ch>
List: current-users
Date: 08/19/2007 10:53:45
Hi,
the following regression was introduced with usr.bin/script/script.c
rev. 1.12 which fixed PR [1]bin/26363.
With script.c rev. 1.11 (NetBSD 3 and earlier) it was possible to use
a fifo as the playback file. This could be used e.g. for watching a
remote terminal session (together with netcat or similar; `nc6' is
net/netcat6 from pkgsrc):
reader:
$ mkfifo fifo
$ nc6 -uxlp 1234 >fifo &
$ script -dp fifo
writer:
$ mkfifo fifo
$ nc6 -ux reader-host 1234 <fifo &
$ script -ar fifo
While recording (script -r) to a fifo still works with -current, playing
back doesn't: script -p returns immediately; previously it used to
block.
The problem seems to be new playback() code stat(2)ing the playback
file and reading only st_size bytes from it, which is zero for a fifo...
So, was I relying on a side effect when using script(1) like this, or
should the playback function be fixed?
Regards, Jukka
[1] http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=26363
--
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~