]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-5.1 patch 6: make sure child processes forked to execute command substitutions...
authorChet Ramey <chet.ramey@case.edu>
Tue, 4 May 2021 18:30:17 +0000 (14:30 -0400)
committerChet Ramey <chet.ramey@case.edu>
Tue, 4 May 2021 18:30:17 +0000 (14:30 -0400)
patchlevel.h
subst.c

index c7f39aec1faeb1c41bdcdc10c054a615e9661ff5..6257aeeb342b66571c25380b38c970af7e323588 100644 (file)
@@ -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 5
+#define PATCHLEVEL 6
 
 #endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index 1d24188e5ec898f5463547ca5e7f08f6fb998a65..462752de61eb7b78b50c656e1dfd66af7cab7e1d 100644 (file)
--- a/subst.c
+++ b/subst.c
@@ -6412,6 +6412,13 @@ command_substitute (string, quoted, flags)
       /* The currently executing shell is not interactive. */
       interactive = 0;
 
+#if defined (JOB_CONTROL)
+      /* Invariant: in child processes started to run command substitutions,
+        pipeline_pgrp == shell_pgrp. Other parts of the shell assume this. */
+      if (pipeline_pgrp > 0 && pipeline_pgrp != shell_pgrp)
+       shell_pgrp = pipeline_pgrp;
+#endif
+
       set_sigint_handler ();   /* XXX */
 
       free_pushed_string_input ();