diff options
author | Chet Ramey <chet.ramey@case.edu> | 2020-12-19 14:29:01 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2020-12-19 14:29:01 -0500 |
commit | a042c731eecd6c6f5c488fa3187af28b18a6c905 (patch) | |
tree | 1c8476e233d861be8a800fc92d4610fd067b15c1 | |
parent | ba970fdb2dcc627f2952d0bd3421abdcd9e8b85e (diff) | |
download | bash-a042c731eecd6c6f5c488fa3187af28b18a6c905.tar.gz |
Bash-5.1 patch 3: fix command substitution in here-document from child process in wrong process group
-rw-r--r-- | patchlevel.h | 2 | ||||
-rw-r--r-- | subst.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/patchlevel.h b/patchlevel.h index 8a183551..e4d85cf8 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -25,6 +25,6 @@ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh looks for to find the patch level (for the sccs version string). */ -#define PATCHLEVEL 2 +#define PATCHLEVEL 3 #endif /* _PATCHLEVEL_H_ */ @@ -6356,8 +6356,10 @@ command_substitute (string, quoted, flags) #if defined (JOB_CONTROL) old_pipeline_pgrp = pipeline_pgrp; - /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */ - if ((subshell_environment & SUBSHELL_PIPE) == 0) + /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline or + we've already forked to run a disk command (and are expanding redirections, + for example). */ + if ((subshell_environment & (SUBSHELL_FORK|SUBSHELL_PIPE)) == 0) pipeline_pgrp = shell_pgrp; cleanup_the_pipeline (); #endif /* JOB_CONTROL */ |