Bash-5.3 patch 7: fix issue where nofork command substitutions can affect redirections in the calling shell

This commit is contained in:
Chet Ramey
2025-11-26 12:50:54 -05:00
parent c31cd58e6c
commit a80c21e8b7
2 changed files with 8 additions and 1 deletions
+1 -1
View 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 6
#define PATCHLEVEL 7
#endif /* _PATCHLEVEL_H_ */
+7
View File
@@ -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;