diff --git a/bash-4.4-patch-12.patch b/bash-4.4-patch-12.patch new file mode 100644 index 0000000..2983a94 --- /dev/null +++ b/bash-4.4-patch-12.patch @@ -0,0 +1,119 @@ +From bc007799f0e1362100375bb95d952d28de4c62fb Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Fri, 27 Jan 2017 11:25:44 -0500 +Subject: [PATCH] Bash-4.4 patch 12 + +--- + patchlevel.h | 2 +- + subst.c | 32 ++++++++++++++++++++------------ + 2 files changed, 21 insertions(+), 13 deletions(-) + +diff --git a/patchlevel.h b/patchlevel.h +index 772676c..93dbe0d 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 11 ++#define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */ +diff --git a/subst.c b/subst.c +index 027a13e..dbf0157 100644 +--- a/subst.c ++++ b/subst.c +@@ -2825,11 +2825,15 @@ list_string (string, separators, quoted) + + /* Parse a single word from STRING, using SEPARATORS to separate fields. + ENDPTR is set to the first character after the word. This is used by +- the `read' builtin. This is never called with SEPARATORS != $IFS; +- it should be simplified. ++ the `read' builtin. ++ ++ This is never called with SEPARATORS != $IFS, and takes advantage of that. + + XXX - this function is very similar to list_string; they should be + combined - XXX */ ++ ++#define islocalsep(c) (local_cmap[(unsigned char)(c)] != 0) ++ + char * + get_word_from_string (stringp, separators, endptr) + char **stringp, *separators, **endptr; +@@ -2837,6 +2841,7 @@ get_word_from_string (stringp, separators, endptr) + register char *s; + char *current_word; + int sindex, sh_style_split, whitesep, xflags; ++ unsigned char local_cmap[UCHAR_MAX+1]; /* really only need single-byte chars here */ + size_t slen; + + if (!stringp || !*stringp || !**stringp) +@@ -2846,20 +2851,23 @@ get_word_from_string (stringp, separators, endptr) + separators[1] == '\t' && + separators[2] == '\n' && + separators[3] == '\0'; +- for (xflags = 0, s = ifs_value; s && *s; s++) ++ memset (local_cmap, '\0', sizeof (local_cmap)); ++ for (xflags = 0, s = separators; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; ++ local_cmap[(unsigned char)*s] = 1; /* local charmap of separators */ + } + + s = *stringp; + slen = 0; + + /* Remove sequences of whitespace at the beginning of STRING, as +- long as those characters appear in IFS. */ +- if (sh_style_split || !separators || !*separators) ++ long as those characters appear in SEPARATORS. This happens if ++ SEPARATORS == $' \t\n' or if IFS is unset. */ ++ if (sh_style_split || separators == 0) + { +- for (; *s && spctabnl (*s) && isifs (*s); s++); ++ for (; *s && spctabnl (*s) && islocalsep (*s); s++); + + /* If the string is nothing but whitespace, update it and return. */ + if (!*s) +@@ -2878,9 +2886,9 @@ get_word_from_string (stringp, separators, endptr) + + This obeys the field splitting rules in Posix.2. */ + sindex = 0; +- /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim +- unless multibyte chars are possible. */ +- slen = (MB_CUR_MAX > 1) ? STRLEN (s) : 1; ++ /* Don't need string length in ADVANCE_CHAR unless multibyte chars are ++ possible, but need it in string_extract_verbatim for bounds checking */ ++ slen = STRLEN (s); + current_word = string_extract_verbatim (s, slen, &sindex, separators, xflags); + + /* Set ENDPTR to the first character after the end of the word. */ +@@ -2899,19 +2907,19 @@ get_word_from_string (stringp, separators, endptr) + + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ +- while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) ++ while (s[sindex] && spctabnl (s[sindex]) && islocalsep (s[sindex])) + sindex++; + + /* If the first separator was IFS whitespace and the current character is + a non-whitespace IFS character, it should be part of the current field + delimiter, not a separate delimiter that would result in an empty field. + Look at POSIX.2, 3.6.5, (3)(b). */ +- if (s[sindex] && whitesep && isifs (s[sindex]) && !spctabnl (s[sindex])) ++ if (s[sindex] && whitesep && islocalsep (s[sindex]) && !spctabnl (s[sindex])) + { + sindex++; + /* An IFS character that is not IFS white space, along with any adjacent + IFS white space, shall delimit a field. */ +- while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex])) ++ while (s[sindex] && spctabnl (s[sindex]) && islocalsep(s[sindex])) + sindex++; + } + +-- +2.9.3 + diff --git a/bash.spec b/bash.spec index da0cab0..358318f 100644 --- a/bash.spec +++ b/bash.spec @@ -1,6 +1,6 @@ #% define beta_tag rc2 %global _hardened_build 1 -%define patchleveltag .11 +%define patchleveltag .12 %define baseversion 4.4 %bcond_without tests %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -8,7 +8,7 @@ Version: %{baseversion}%{patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 2%{?dist} +Release: 1%{?dist} License: GPLv3+ Url: http://www.gnu.org/software/bash Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz @@ -22,7 +22,7 @@ Source3: dot-bash_logout # Official upstream patches # Patches are converted to apply with '-p1' -%{lua:for i=1,11 do print(string.format("Patch%u: bash-4.4-patch-%u.patch\n", i, i)) end} +%{lua:for i=1,12 do print(string.format("Patch%u: bash-4.4-patch-%u.patch\n", i, i)) end} # Other patches Patch101: bash-2.02-security.patch @@ -295,6 +295,9 @@ end %doc doc/*.ps doc/*.0 doc/*.html doc/article.txt %changelog +* Mon Apr 10 2017 Siteshwar Vashisht - 4.4.11-3 +- Update to bash-4.4 patchlevel 12 + * Fri Feb 10 2017 Fedora Release Engineering - 4.4.11-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild