bash-5.1-patch-6.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From f3cd936b81006df41a1c8509891dea1edeaef8e6 Mon Sep 17 00:00:00 2001
  2. From: Chet Ramey <chet.ramey@case.edu>
  3. Date: Tue, 4 May 2021 14:30:17 -0400
  4. Subject: [PATCH] Bash-5.1 patch 6: make sure child processes forked to execute
  5. command substitutions are in the right process group
  6. ---
  7. patchlevel.h | 2 +-
  8. subst.c | 7 +++++++
  9. 2 files changed, 8 insertions(+), 1 deletion(-)
  10. diff --git a/patchlevel.h b/patchlevel.h
  11. index c7f39aec..6257aeeb 100644
  12. --- a/patchlevel.h
  13. +++ b/patchlevel.h
  14. @@ -25,6 +25,6 @@
  15. regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
  16. looks for to find the patch level (for the sccs version string). */
  17. -#define PATCHLEVEL 5
  18. +#define PATCHLEVEL 6
  19. #endif /* _PATCHLEVEL_H_ */
  20. diff --git a/subst.c b/subst.c
  21. index 1d24188e..462752de 100644
  22. --- a/subst.c
  23. +++ b/subst.c
  24. @@ -6412,6 +6412,13 @@ command_substitute (string, quoted, flags)
  25. /* The currently executing shell is not interactive. */
  26. interactive = 0;
  27. +#if defined (JOB_CONTROL)
  28. + /* Invariant: in child processes started to run command substitutions,
  29. + pipeline_pgrp == shell_pgrp. Other parts of the shell assume this. */
  30. + if (pipeline_pgrp > 0 && pipeline_pgrp != shell_pgrp)
  31. + shell_pgrp = pipeline_pgrp;
  32. +#endif
  33. +
  34. set_sigint_handler (); /* XXX */
  35. free_pushed_string_input ();
  36. --
  37. 2.29.2