The distinguishing feature here is that lynx closes the CGI script's standard input. As a result, at some point man does roughly:
last_input = open (filename, O_RDONLY);
dup2 (last_input, 0);
close (last_input);
But the "open" returns 0, since that's the first available file descriptor, so everything is now very confused. libpipeline needs to tolerate this situation.
Thanks for your report, and sorry for my delay!
The distinguishing feature here is that lynx closes the CGI script's standard input. As a result, at some point man does roughly:
last_input = open (filename, O_RDONLY);
dup2 (last_input, 0);
close (last_input);
But the "open" returns 0, since that's the first available file descriptor, so everything is now very confused. libpipeline needs to tolerate this situation.