-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix process substitution infinite loops in virtual machines
src/cmd/ksh93/sh/xec.c: - An infinite loop may occur if an orphaned process from a process substitution isn't adopted by PID 1. Rather than close the FIFO when the parent process is init, check for the existence of the the parent shell or parent forked subshell by using kill(2). src/cmd/ksh93/include/defs.h, src/cmd/ksh93/sh/init.c, src/cmd/ksh93/sh/subshell.c: - Add a new 'parent_pid' variable to store the correct PPID. The PPID cannot be obtained after creating the process substitution (as that causes intermittent looping) and 'shgd->current_pid' can't be used as it's the process substitution's PID. As it's only used for FIFO process substitutions, hide it behind !SHOPT_DEVFD. src/cmd/ksh93/tests/io.sh: - Test for the infinite looping bug by using a forked command substitution. Fixes: ksh93#213
- Loading branch information
Showing
6 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters