fix for ssh infinite loop when SSH_SOURCE_BASHRC is defined and bash is run in a comsub in .bashrc; implement posix interp 1009 in posix mode

This commit is contained in:
Chet Ramey
2023-12-04 16:40:00 -05:00
parent 9702b74a28
commit d5ab50bc02
17 changed files with 482 additions and 253 deletions
+3
View File
@@ -118,6 +118,8 @@ should_optimize_fork (COMMAND *command, int subshell)
/* This has extra tests to account for STARTUP_STATE == 2, which is for
-c command but has been extended to command and process substitution
(basically any time you call parse_and_execute in a subshell). */
/* ssh_reading_startup_files will never be non-zero unless someone goes
and uncomments SSH_SOURCE_BASHRC in config-top.h */
int
should_suppress_fork (COMMAND *command)
{
@@ -128,6 +130,7 @@ should_suppress_fork (COMMAND *command)
*bash_input.location.string == '\0' &&
parser_expanding_alias () == 0 &&
job_control_active_p () == 0 &&
ssh_reading_startup_files == 0 &&
should_optimize_fork (command, subshell));
}