Submitted By: Xi Ruoyao Date: 2024-01-24 Initial Package Version: 5.2.21 Upstream Status: Applied Origin: Upstream release repository Upstream patches 023-025 https://ftp.gnu.org/gnu/bash/bash-5.2-patches/ BASH PATCH REPORT ================= Bash-Release: 5.2 Patch-ID: bash52-023 Bug-Reported-by: Emanuele Torre Bug-Reference-ID: <20230206140824.1710288-1-torreemanuele6@gmail.com> Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00045.html Bug-Description: Running `local -' multiple times in a shell function would overwrite the original saved set of options. Patch (apply with `patch -p0'): *** bash-5.2-patched/builtins/declare.def 2023-01-04 20:40:28.000000000 -0500 --- bash/builtins/declare.def 2023-02-08 15:36:49.000000000 -0500 *************** *** 421,429 **** if (local_var && variable_context && STREQ (name, "-")) { var = make_local_variable ("-", 0); ! FREE (value_cell (var)); /* just in case */ ! value = get_current_options (); ! var_setvalue (var, value); ! VSETATTR (var, att_invisible); NEXT_VARIABLE (); } --- 421,437 ---- if (local_var && variable_context && STREQ (name, "-")) { + int o; + + o = localvar_inherit; + localvar_inherit = 0; var = make_local_variable ("-", 0); ! localvar_inherit = o; ! ! if (value_cell (var) == NULL) /* no duplicate instances */ ! { ! value = get_current_options (); ! var_setvalue (var, value); ! VSETATTR (var, att_invisible); ! } NEXT_VARIABLE (); } *** bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 --- bash/patchlevel.h 2020-10-01 11:01:28.000000000 -0400 *************** *** 26,30 **** looks for to find the patch level (for the sccs version string). */ ! #define PATCHLEVEL 21 #endif /* _PATCHLEVEL_H_ */ --- 26,30 ---- looks for to find the patch level (for the sccs version string). */ ! #define PATCHLEVEL 23 #endif /* _PATCHLEVEL_H_ */ BASH PATCH REPORT ================= Bash-Release: 5.2 Patch-ID: bash52-024 Bug-Reported-by: Marco Bug-Reference-ID: Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00044.html Bug-Description: Fix bug where associative array compound assignment would not expand tildes in values. Patch (apply with `patch -p0'): *** bash-20230105/arrayfunc.c Thu Jan 5 14:23:28 2023 --- bash/arrayfunc.c Wed Feb 8 16:27:48 2023 *************** *** 651,655 **** } ! aval = expand_subscript_string (v, 0); if (aval == 0) { --- 651,655 ---- } ! aval = expand_assignment_string_to_string (v, 0); if (aval == 0) { *************** *** 843,847 **** if (assoc_p (var)) { ! val = expand_subscript_string (val, 0); if (val == 0) { --- 843,847 ---- if (assoc_p (var)) { ! val = expand_assignment_string_to_string (val, 0); if (val == 0) { *************** *** 1031,1035 **** nword[i++] = w[ind++]; ! t = expand_subscript_string (w+ind, 0); s = (t && strchr (t, CTLESC)) ? quote_escapes (t) : t; value = sh_single_quote (s ? s : ""); --- 1031,1035 ---- nword[i++] = w[ind++]; ! t = expand_assignment_string_to_string (w+ind, 0); s = (t && strchr (t, CTLESC)) ? quote_escapes (t) : t; value = sh_single_quote (s ? s : ""); *** bash-20230201/subst.c Mon Jan 30 16:19:46 2023 --- bash/subst.c Mon Feb 6 16:25:22 2023 *************** *** 10803,10807 **** --- 10803,10811 ---- ret = (char *)NULL; + #if 0 td.flags = W_NOPROCSUB|W_NOTILDE|W_NOSPLIT2; /* XXX - W_NOCOMSUB? */ + #else + td.flags = W_NOPROCSUB|W_NOSPLIT2; /* XXX - W_NOCOMSUB? */ + #endif td.word = savestring (string); /* in case it's freed on error */ *** bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 --- bash/patchlevel.h 2020-10-01 11:01:28.000000000 -0400 *************** *** 26,30 **** looks for to find the patch level (for the sccs version string). */ ! #define PATCHLEVEL 23 #endif /* _PATCHLEVEL_H_ */ --- 26,30 ---- looks for to find the patch level (for the sccs version string). */ ! #define PATCHLEVEL 24 #endif /* _PATCHLEVEL_H_ */ BASH PATCH REPORT ================= Bash-Release: 5.2 Patch-ID: bash52-025 Bug-Reported-by: Andrew Neff Bug-Reference-ID: Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2022-10/msg00100.html Bug-Description: Make sure a subshell checks for and handles any terminating signals before exiting (which might have arrived after the command completed) so the parent and any EXIT trap will see the correct value for $?. Patch (apply with `patch -p0'): *** bash-5.2.9/execute_cmd.c 2022-11-02 10:36:54.000000000 -0400 --- bash/execute_cmd.c 2022-10-27 16:52:55.000000000 -0400 *************** *** 1726,1729 **** --- 1726,1732 ---- : EXECUTION_SUCCESS; + /* Check for terminating signals before we return to our caller, which we + expect to exit immediately anyway. */ + CHECK_TERMSIG; /* If we were explicitly placed in a subshell with (), we need *** bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 --- bash/patchlevel.h 2020-10-01 11:01:28.000000000 -0400 *************** *** 26,30 **** looks for to find the patch level (for the sccs version string). */ ! #define PATCHLEVEL 24 #endif /* _PATCHLEVEL_H_ */ --- 26,30 ---- looks for to find the patch level (for the sccs version string). */ ! #define PATCHLEVEL 25 #endif /* _PATCHLEVEL_H_ */