On 28/02/2019 06:27, Herbert Xu wrote:
Thanks for the analysis. I think the real bug here is the fact that subshells can "escape" their jail by a longjmp that is caught by evalcommand.
That is *a* real bug here, not *the* real bug. This leaves the buggy behaviour of the "command" built-in intact in the test case I included in the message you replied to.
For fixing the one bug, it is a sensible approach, but keep in mind that when a fork is omitted because of EV_EXIT, so too will the reset of handler. You may be able to get away with that as long as you do not propagate EV_EXIT in any cases where a cleanup action might cause problems.
Cheers, Harald van Dijk