bash.git - bash

index : bash.git
bash
summary refs log tree commit diff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2025年11月26日 12:50:54 -0500
committerChet Ramey <chet.ramey@case.edu>2025年11月26日 12:50:54 -0500
commita80c21e8b7ff113878ecece1db730fd40bc0ff55 (patch)
treec20956d39f04405c8e0803487a9e21dbb461a3e9
parentc31cd58e6c4d24cec178e9dc6d26a768b4ecbd1d (diff)
Bash-5.3 patch 7: fix issue where nofork command substitutions can affect redirections in the calling shell
Diffstat
-rw-r--r--patchlevel.h 2
-rw-r--r--subst.c 7
2 files changed, 8 insertions, 1 deletions
diff --git a/patchlevel.h b/patchlevel.h
index b8e99ec9..816ef06b 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 6
+#define PATCHLEVEL 7
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index a8ae174d..dd5d57bf 100644
--- a/subst.c
+++ b/subst.c
@@ -206,6 +206,8 @@ extern int wordexp_only;
extern int singlequote_translations;
extern int extended_quote;
+extern REDIRECT *exec_redirection_undo_list, *redirection_undo_list;
+
#if !defined (HAVE_WCSDUP) && defined (HANDLE_MULTIBYTE)
extern wchar_t *wcsdup (const wchar_t *);
#endif
@@ -7000,6 +7002,11 @@ function_substitute (char *string, int quoted, int flags)
add_unwind_protect (uw_restore_pipestatus_array, psa);
}
#endif
+
+ unwind_protect_pointer (redirection_undo_list);
+ redirection_undo_list = NULL;
+ unwind_protect_pointer (exec_redirection_undo_list);
+ exec_redirection_undo_list = NULL;
subst_assign_varlist = 0;
generated by cgit v1.2.3 (git 2.25.1) at 2025年12月13日 21:36:05 +0000

AltStyle によって変換されたページ (->オリジナル) /