nalika / rpms / bash

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