Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: script(1) bug?
On Fri, Aug 28, 2026 at 13:51:31 +0300, Valery Ushakov wrote:
> indeed: consider
>
> runme() {
> rm typescript
> script -q -f -c 'echo foo; sleep 10;' < /dev/null > /dev/null
> ls -l typescript
> hexdump -C typescript
> }
>
>
> And then you race:
>
> $ runme
> -rw-r--r-- 1 uwe uwe 5 Aug 28 13:44 typescript
> 00000000 66 6f 6f 0d 0a |foo..|
> 00000005
> $ runme
> -rw-r--r-- 1 uwe uwe 0 Aug 28 13:46 typescript
> $runme
> -rw-r--r-- 1 uwe uwe 0 Aug 28 13:44 typescript
> 00000000 66 6f 6f 0d 0a |foo..|
> 00000005
At the end of main(), if read(2) from stdin fails or returns EOF, the
script(1) should not exit and should do sigsuspend(2). Shouldn't be
too hard to fix, but needs someone with tuits...
-uwe
Home |
Main Index |
Thread Index |
Old Index