On 8/25/23 9:38 PM, Earl Chew wrote:
A newly created process of a foreground job races the
parent shell to configure the controlling terminal. This
can result in the parent shell stealing the controlling
terminal from a grandchild, and giving it to the child.

I think stop_pipeline() needs to be fixed to be more
cautious. What might be the right approach?

OK, so there is a potential race condition here. What do you suggest the
right approach might be? It seems to me we can do one of two things:
rearrange and extend the PGRP_PIPE code to make sure the child process
doesn't proceed until the parent sets the terminal process group; or
change stop_pipeline() (and audit its callers, of course) so it does not
set the terminal process group.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to