From 14088effd4b01c948ae8c77d12bc05e87ac147a5 Mon Sep 17 00:00:00 2001 From: Marcel Denia Date: Wed, 3 Sep 2014 21:23:04 +0200 Subject: [PATCH] bash: Update to 4.3.24 Signed-off-by: Marcel Denia --- utils/bash/Makefile | 7 +- .../patches/123-upstream-bash43-023.patch | 78 +++++++++++++++++++ .../patches/124-upstream-bash43-024.patch | 45 +++++++++++ 3 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 utils/bash/patches/123-upstream-bash43-023.patch create mode 100644 utils/bash/patches/124-upstream-bash43-024.patch diff --git a/utils/bash/Makefile b/utils/bash/Makefile index be80dff7c..e86970f34 100644 --- a/utils/bash/Makefile +++ b/utils/bash/Makefile @@ -7,13 +7,16 @@ include $(TOPDIR)/rules.mk +BASE_VERSION:=4.3 + PKG_NAME:=bash -PKG_VERSION:=4.3 +PKG_VERSION:=$(BASE_VERSION).24 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(BASE_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/bash PKG_MD5SUM:=81348932d5da294953e15d4814c74dd1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BASE_VERSION) PKG_LICENSE:=GPL-3.0+ PKG_LICENSE_FILES:=COPYING diff --git a/utils/bash/patches/123-upstream-bash43-023.patch b/utils/bash/patches/123-upstream-bash43-023.patch new file mode 100644 index 000000000..8684c1372 --- /dev/null +++ b/utils/bash/patches/123-upstream-bash43-023.patch @@ -0,0 +1,78 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-023 + +Bug-Reported-by: Tim Friske +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00056.html + +Bug-Description: + +Bash does not correctly parse process substitution constructs that contain +unbalanced parentheses as part of the contained command. + +Patch (apply with `patch -p0'): + +--- a/subst.h ++++ b/subst.h +@@ -82,7 +82,7 @@ extern char *extract_arithmetic_subst __ + /* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position just after the matching ")". */ +-extern char *extract_process_subst __P((char *, char *, int *)); ++extern char *extract_process_subst __P((char *, char *, int *, int)); + #endif /* PROCESS_SUBSTITUTION */ + + /* Extract the name of the variable to bind to from the assignment string. */ +--- a/subst.c ++++ b/subst.c +@@ -1192,12 +1192,18 @@ extract_arithmetic_subst (string, sindex + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position of the matching ")". */ /*))*/ + char * +-extract_process_subst (string, starter, sindex) ++extract_process_subst (string, starter, sindex, xflags) + char *string; + char *starter; + int *sindex; ++ int xflags; + { ++#if 0 + return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND)); ++#else ++ xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); ++ return (xparse_dolparen (string, string+*sindex, sindex, xflags)); ++#endif + } + #endif /* PROCESS_SUBSTITUTION */ + +@@ -1785,7 +1791,7 @@ skip_to_delim (string, start, delims, fl + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); +- temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si); ++ temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0); + free (temp); /* no SX_ALLOC here */ + i = si; + if (string[i] == '\0') +@@ -8249,7 +8255,7 @@ add_string: + else + t_index = sindex + 1; /* skip past both '<' and LPAREN */ + +- temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/ ++ temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/ + sindex = t_index; + + /* If the process substitution specification is `<()', we want to +--- 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 22 ++#define PATCHLEVEL 23 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/utils/bash/patches/124-upstream-bash43-024.patch b/utils/bash/patches/124-upstream-bash43-024.patch new file mode 100644 index 000000000..79414550a --- /dev/null +++ b/utils/bash/patches/124-upstream-bash43-024.patch @@ -0,0 +1,45 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-024 + +Bug-Reported-by: Corentin Peuvrel +Bug-Reference-ID: <53CE9E5D.6050203@pom-monitoring.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-07/msg00021.html + +Bug-Description: + +Indirect variable references do not work correctly if the reference +variable expands to an array reference using a subscript other than 0 +(e.g., foo='bar[1]' ; echo ${!foo}). + +Patch (apply with `patch -p0'): + +--- a/subst.c ++++ b/subst.c +@@ -7374,7 +7374,13 @@ parameter_brace_expand (string, indexp, + } + + if (want_indir) +- tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); ++ { ++ tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); ++ /* Turn off the W_ARRAYIND flag because there is no way for this function ++ to return the index we're supposed to be using. */ ++ if (tdesc && tdesc->flags) ++ tdesc->flags &= ~W_ARRAYIND; ++ } + else + tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind); + +--- 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 23 ++#define PATCHLEVEL 24 + + #endif /* _PATCHLEVEL_H_ */