From 55ea0fb002c6c4d8cca77afe096ca1c2584669e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ertu=C4=9Frul=20Erata?= Date: Wed, 28 Nov 2018 23:42:33 +0300 Subject: [PATCH] bash update to 4.4.18 --- .../fedora/bash-4.4-assignment-error.patch | 31 +++ .../bash-4.4-case-in-command-subst.patch | 18 ++ .../bash/files/fedora/bash-4.4-coverity.patch | 203 ++++++++++++++++++ .../bash-4.4-unset-nonblock-stdin.patch | 11 + .../bash-4.5-test-modification-time.patch | 11 + .../files/official/bash-4.4-patch-12.patch | 119 ++++++++++ .../files/official/bash-4.4-patch-13.patch | 38 ++++ .../files/official/bash-4.4-patch-14.patch | 85 ++++++++ .../files/official/bash-4.4-patch-15.patch | 38 ++++ .../files/official/bash-4.4-patch-16.patch | 68 ++++++ .../files/official/bash-4.4-patch-17.patch | 41 ++++ .../files/official/bash-4.4-patch-18.patch | 38 ++++ .../files/official/bash-4.4-patch-19.patch | 40 ++++ system/base/bash/pspec.xml | 22 +- 14 files changed, 762 insertions(+), 1 deletion(-) create mode 100644 system/base/bash/files/fedora/bash-4.4-assignment-error.patch create mode 100644 system/base/bash/files/fedora/bash-4.4-case-in-command-subst.patch create mode 100644 system/base/bash/files/fedora/bash-4.4-coverity.patch create mode 100644 system/base/bash/files/fedora/bash-4.4-unset-nonblock-stdin.patch create mode 100644 system/base/bash/files/fedora/bash-4.5-test-modification-time.patch create mode 100644 system/base/bash/files/official/bash-4.4-patch-12.patch create mode 100644 system/base/bash/files/official/bash-4.4-patch-13.patch create mode 100644 system/base/bash/files/official/bash-4.4-patch-14.patch create mode 100644 system/base/bash/files/official/bash-4.4-patch-15.patch create mode 100644 system/base/bash/files/official/bash-4.4-patch-16.patch create mode 100644 system/base/bash/files/official/bash-4.4-patch-17.patch create mode 100644 system/base/bash/files/official/bash-4.4-patch-18.patch create mode 100644 system/base/bash/files/official/bash-4.4-patch-19.patch diff --git a/system/base/bash/files/fedora/bash-4.4-assignment-error.patch b/system/base/bash/files/fedora/bash-4.4-assignment-error.patch new file mode 100644 index 00000000..96455039 --- /dev/null +++ b/system/base/bash/files/fedora/bash-4.4-assignment-error.patch @@ -0,0 +1,31 @@ +diff --git a/execute_cmd.h b/execute_cmd.h +--- a/execute_cmd.h ++++ b/execute_cmd.h +@@ -37,6 +37,9 @@ struct func_array_state + }; + #endif + ++/* Variables delared in execute_cmd.c, used by many other files */ ++extern int executing_command_builtin; ++ + extern struct fd_bitmap *new_fd_bitmap __P((int)); + extern void dispose_fd_bitmap __P((struct fd_bitmap *)); + extern void close_fd_bitmap __P((struct fd_bitmap *)); +diff --git a/subst.c b/subst.c +--- a/subst.c ++++ b/subst.c +@@ -10676,11 +10676,12 @@ expand_word_list_internal (list, eflags) + tint = do_word_assignment (temp_list->word, 0); + this_command_name = savecmd; + /* Variable assignment errors in non-interactive shells +- running in Posix.2 mode cause the shell to exit. */ ++ running in Posix.2 mode cause the shell to exit, unless ++ they are being run by the `command' builtin. */ + if (tint == 0) + { + last_command_exit_value = EXECUTION_FAILURE; +- if (interactive_shell == 0 && posixly_correct) ++ if (interactive_shell == 0 && posixly_correct && executing_command_builtin == 0) + exp_jump_to_top_level (FORCE_EOF); + else + exp_jump_to_top_level (DISCARD); diff --git a/system/base/bash/files/fedora/bash-4.4-case-in-command-subst.patch b/system/base/bash/files/fedora/bash-4.4-case-in-command-subst.patch new file mode 100644 index 00000000..12509ed3 --- /dev/null +++ b/system/base/bash/files/fedora/bash-4.4-case-in-command-subst.patch @@ -0,0 +1,18 @@ +diff --git a/parse.y b/parse.y +--- a/parse.y ++++ b/parse.y +@@ -4011,11 +4011,13 @@ eof_error: + tflags |= LEX_RESWDOK; + lex_rwlen = 0; + } +- else ++ else if (shellmeta (ch) == 0) + { + tflags &= ~LEX_RESWDOK; + /*itrace("parse_comsub:%d: found `%.4s', lex_reswdok -> 0", line_number, ret+retind-4);*/ + } ++ else /* can't be in a reserved word any more */ ++ lex_rwlen = 0; + } + else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0))) + ; /* don't modify LEX_RESWDOK if we're starting a comment */ diff --git a/system/base/bash/files/fedora/bash-4.4-coverity.patch b/system/base/bash/files/fedora/bash-4.4-coverity.patch new file mode 100644 index 00000000..c1fc7473 --- /dev/null +++ b/system/base/bash/files/fedora/bash-4.4-coverity.patch @@ -0,0 +1,203 @@ +diff --git a/builtins/fc.def b/builtins/fc.def +index fe16471..98c53db 100644 +--- a/builtins/fc.def ++++ b/builtins/fc.def +@@ -423,6 +423,7 @@ fc_builtin (list) + { + sh_wrerror (); + fclose (stream); ++ FREE (fn); + return (EXECUTION_FAILURE); + } + fclose (stream); +diff --git a/execute_cmd.c b/execute_cmd.c +index 63a332a..15b5e19 100644 +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -2196,8 +2196,10 @@ coproc_setvars (cp) + if (v == 0) + { + v = find_variable_nameref_for_create (cp->c_name, 1); +- if (v == INVALID_NAMEREF_VALUE) +- return; ++ if (v == INVALID_NAMEREF_VALUE) { ++ free (namevar); ++ return; ++ } + if (v && nameref_p (v)) + { + free (cp->c_name); +@@ -2210,6 +2212,7 @@ coproc_setvars (cp) + { + if (readonly_p (v)) + err_readonly (cp->c_name); ++ free (namevar); + return; + } + if (v == 0) +@@ -5528,7 +5531,6 @@ shell_execve (command, args, env) + char *interp; + int ilen; + +- close (fd); + interp = getinterp (sample, sample_len, (int *)NULL); + ilen = strlen (interp); + errno = i; +diff --git a/expr.c b/expr.c +index 172964a..5dc57c0 100644 +--- a/expr.c ++++ b/expr.c +@@ -207,7 +207,8 @@ static intmax_t exp5 __P((void)); + static intmax_t exp4 __P((void)); + static intmax_t expshift __P((void)); + static intmax_t exp3 __P((void)); +-static intmax_t exp2 __P((void)); ++/* Avoid name clash with standard exp2 */ ++static intmax_t bash_exp2 __P((void)); + static intmax_t exppower __P((void)); + static intmax_t exp1 __P((void)); + static intmax_t exp0 __P((void)); +@@ -809,14 +810,14 @@ exp3 () + { + register intmax_t val1, val2; + +- val1 = exp2 (); ++ val1 = bash_exp2 (); + + while ((curtok == PLUS) || (curtok == MINUS)) + { + int op = curtok; + + readtok (); +- val2 = exp2 (); ++ val2 = bash_exp2 (); + + if (op == PLUS) + val1 += val2; +@@ -828,7 +829,7 @@ exp3 () + } + + static intmax_t +-exp2 () ++bash_exp2 () + { + register intmax_t val1, val2; + #if defined (HAVE_IMAXDIV) +diff --git a/lib/glob/glob.c b/lib/glob/glob.c +index 7f6eafe..c018e29 100644 +--- a/lib/glob/glob.c ++++ b/lib/glob/glob.c +@@ -576,7 +576,7 @@ glob_vector (pat, dir, flags) + register char *nextname, *npat, *subdir; + unsigned int count; + int lose, skip, ndirs, isdir, sdlen, add_current, patlen; +- register char **name_vector; ++ register char **name_vector = NULL; + register unsigned int i; + int mflags; /* Flags passed to strmatch (). */ + int pflags; /* flags passed to sh_makepath () */ +@@ -894,7 +894,7 @@ glob_vector (pat, dir, flags) + } + + /* Don't call QUIT; here; let higher layers deal with it. */ +- ++ FREE (name_vector); + return ((char **)NULL); + } + +diff --git a/lib/sh/pathcanon.c b/lib/sh/pathcanon.c +index f19bd55..2a565d6 100644 +--- a/lib/sh/pathcanon.c ++++ b/lib/sh/pathcanon.c +@@ -227,7 +227,7 @@ sh_canonpath (path, flags) + if (result[2] == '\0') /* short-circuit for bare `//' */ + result[1] = '\0'; + else +- strcpy (result, result + 1); ++ memmove(result, result + 1, strlen(result + 1) + 1); + } + + return (result); +diff --git a/lib/sh/pathphys.c b/lib/sh/pathphys.c +index 26016b7..b64c4cd 100644 +--- a/lib/sh/pathphys.c ++++ b/lib/sh/pathphys.c +@@ -245,7 +245,7 @@ error: + if (result[2] == '\0') /* short-circuit for bare `//' */ + result[1] = '\0'; + else +- strcpy (result, result + 1); ++ memmove(result, result + 1, strlen(result + 1) + 1); + } + + return (result); +diff --git a/shell.c b/shell.c +index b43de50..4aae182 100644 +--- a/shell.c ++++ b/shell.c +@@ -1948,8 +1948,10 @@ show_shell_usage (fp, extra) + fputs (_("\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n"), fp); + + for (i = 0, set_opts = 0; shell_builtins[i].name; i++) +- if (STREQ (shell_builtins[i].name, "set")) ++ if (STREQ (shell_builtins[i].name, "set")) { + set_opts = savestring (shell_builtins[i].short_doc); ++ break; ++ } + if (set_opts) + { + s = strchr (set_opts, '['); +diff --git a/subst.c b/subst.c +index 5f3e41e..7574617 100644 +--- a/subst.c ++++ b/subst.c +@@ -5182,8 +5182,11 @@ parameter_list_transform (xc, itype, quoted) + list = list_rest_of_args (); + if (list == 0) + return ((char *)NULL); +- if (xc == 'A') +- return (pos_params_assignment (list, itype, quoted)); ++ if (xc == 'A') { ++ ret = pos_params_assignment (list, itype, quoted); ++ dispose_words (list); ++ return (ret); ++ } + ret = list_transform (xc, (SHELL_VAR *)0, list, itype, quoted); + dispose_words (list); + return (ret); +@@ -6813,6 +6816,7 @@ parameter_brace_expand_rhs (name, value, c, quoted, pflags, qdollaratp, hasdolla + { + report_error (_("%s: invalid indirect expansion"), name); + free (vname); ++ free (t1); + dispose_word (w); + return &expand_wdesc_error; + } +@@ -6820,6 +6824,7 @@ parameter_brace_expand_rhs (name, value, c, quoted, pflags, qdollaratp, hasdolla + { + report_error (_("%s: invalid variable name"), vname); + free (vname); ++ free (t1); + dispose_word (w); + return &expand_wdesc_error; + } +diff --git a/support/man2html.c b/support/man2html.c +index 6ba5061..1d9e376 100644 +--- a/support/man2html.c ++++ b/support/man2html.c +@@ -522,6 +522,7 @@ read_man_page(char *filename) + man_buf[buf_size] = '\n'; + man_buf[buf_size + 1] = man_buf[buf_size + 2] = '\0'; + } else { ++ free (man_buf); + man_buf = NULL; + } + fclose(man_stream); +@@ -2562,7 +2563,6 @@ scan_request(char *c) + h = name; + if (stat(h, &stbuf) != -1) + l = stbuf.st_size; +- buf = stralloc(l + 4); + #if NOCGI + if (!out_length) { + char *t, *s; diff --git a/system/base/bash/files/fedora/bash-4.4-unset-nonblock-stdin.patch b/system/base/bash/files/fedora/bash-4.4-unset-nonblock-stdin.patch new file mode 100644 index 00000000..68ad38c3 --- /dev/null +++ b/system/base/bash/files/fedora/bash-4.4-unset-nonblock-stdin.patch @@ -0,0 +1,11 @@ +diff --git a/parse.y b/parse.y +index 85f1c4f..9d1cdf8 100644 +--- a/parse.y ++++ b/parse.y +@@ -1453,6 +1453,7 @@ yy_readline_get () + old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler); + } + ++ sh_unset_nodelay_mode (fileno (rl_instream)); /* just in case */ + current_readline_line = readline (current_readline_prompt ? + current_readline_prompt : ""); diff --git a/system/base/bash/files/fedora/bash-4.5-test-modification-time.patch b/system/base/bash/files/fedora/bash-4.5-test-modification-time.patch new file mode 100644 index 00000000..275bbedb --- /dev/null +++ b/system/base/bash/files/fedora/bash-4.5-test-modification-time.patch @@ -0,0 +1,11 @@ +diff --git a/config.h.in b/config.h.in +--- a/config.h.in ++++ b/config.h.in +@@ -449,6 +449,7 @@ + #undef SYS_TIME_H_DEFINES_STRUCT_TIMESPEC + #undef PTHREAD_H_DEFINES_STRUCT_TIMESPEC + ++#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC + #undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC + #undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC + #undef HAVE_STRUCT_STAT_ST_ATIMENSEC diff --git a/system/base/bash/files/official/bash-4.4-patch-12.patch b/system/base/bash/files/official/bash-4.4-patch-12.patch new file mode 100644 index 00000000..2983a947 --- /dev/null +++ b/system/base/bash/files/official/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/system/base/bash/files/official/bash-4.4-patch-13.patch b/system/base/bash/files/official/bash-4.4-patch-13.patch new file mode 100644 index 00000000..abfb2def --- /dev/null +++ b/system/base/bash/files/official/bash-4.4-patch-13.patch @@ -0,0 +1,38 @@ +From 1aef9c7b55dcef4af239caf93e01419e1c8e04ad Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Mon, 29 Jan 2018 16:03:33 -0500 +Subject: [PATCH] Bash-4.4 patch 13 + +--- + patchlevel.h | 2 +- + redir.c | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/patchlevel.h b/patchlevel.h +index 93dbe0db..779671cd 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 12 ++#define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ +diff --git a/redir.c b/redir.c +index 25488eaf..1858b0b0 100644 +--- a/redir.c ++++ b/redir.c +@@ -469,6 +469,8 @@ here_document_to_fd (redirectee, ri) + return (fd); + } + ++ SET_CLOSE_ON_EXEC (fd); ++ + errno = r = 0; /* XXX */ + /* write_here_document returns 0 on success, errno on failure. */ + if (redirectee->word) +-- +2.13.6 + diff --git a/system/base/bash/files/official/bash-4.4-patch-14.patch b/system/base/bash/files/official/bash-4.4-patch-14.patch new file mode 100644 index 00000000..bceb8eaa --- /dev/null +++ b/system/base/bash/files/official/bash-4.4-patch-14.patch @@ -0,0 +1,85 @@ +From 2fb21d75bfddd724b0e45d4a51455a166467e496 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Mon, 29 Jan 2018 16:03:47 -0500 +Subject: [PATCH] Bash-4.4 patch 14 + +--- + execute_cmd.c | 19 ++++++++++++++++--- + patchlevel.h | 2 +- + 2 files changed, 17 insertions(+), 4 deletions(-) + +diff --git a/execute_cmd.c b/execute_cmd.c +index 2a3df6d6..76a80766 100644 +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -726,6 +726,8 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out, + { + ofifo = num_fifos (); + ofifo_list = copy_fifo_list ((int *)&osize); ++ begin_unwind_frame ("internal_fifos"); ++ add_unwind_protect (xfree, ofifo_list); + saved_fifo = 1; + } + else +@@ -741,7 +743,10 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out, + dispose_exec_redirects (); + #if defined (PROCESS_SUBSTITUTION) + if (saved_fifo) +- free ((void *)ofifo_list); ++ { ++ free ((void *)ofifo_list); ++ discard_unwind_frame ("internal_fifos"); ++ } + #endif + return (last_command_exit_value = EXECUTION_FAILURE); + } +@@ -1060,6 +1065,7 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out, + if (nfifo > ofifo) + close_new_fifos ((char *)ofifo_list, osize); + free ((void *)ofifo_list); ++ discard_unwind_frame ("internal_fifos"); + } + #endif + +@@ -4977,9 +4983,14 @@ execute_builtin_or_function (words, builtin, var, redirects, + char *ofifo_list; + #endif + +-#if defined (PROCESS_SUBSTITUTION) ++#if defined (PROCESS_SUBSTITUTION) ++ begin_unwind_frame ("saved_fifos"); ++ /* If we return, we longjmp and don't get a chance to restore the old ++ fifo list, so we add an unwind protect to free it */ + ofifo = num_fifos (); + ofifo_list = copy_fifo_list (&osize); ++ if (ofifo_list) ++ add_unwind_protect (xfree, ofifo_list); + #endif + + if (do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE) != 0) +@@ -5063,7 +5074,9 @@ execute_builtin_or_function (words, builtin, var, redirects, + nfifo = num_fifos (); + if (nfifo > ofifo) + close_new_fifos (ofifo_list, osize); +- free (ofifo_list); ++ if (ofifo_list) ++ free (ofifo_list); ++ discard_unwind_frame ("saved_fifos"); + #endif + + return (result); +diff --git a/patchlevel.h b/patchlevel.h +index 779671cd..09a3cc84 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 13 ++#define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ +-- +2.13.6 + diff --git a/system/base/bash/files/official/bash-4.4-patch-15.patch b/system/base/bash/files/official/bash-4.4-patch-15.patch new file mode 100644 index 00000000..7d1dccf0 --- /dev/null +++ b/system/base/bash/files/official/bash-4.4-patch-15.patch @@ -0,0 +1,38 @@ +From 9cce630e80008e74fa9a1d9408367341caf363f2 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Mon, 29 Jan 2018 16:04:01 -0500 +Subject: [PATCH] Bash-4.4 patch 15 + +--- + patchlevel.h | 2 +- + subst.c | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/patchlevel.h b/patchlevel.h +index 09a3cc84..6e9ed3fc 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 14 ++#define PATCHLEVEL 15 + + #endif /* _PATCHLEVEL_H_ */ +diff --git a/subst.c b/subst.c +index dbf0157e..fc00cab0 100644 +--- a/subst.c ++++ b/subst.c +@@ -5906,6 +5906,8 @@ process_substitute (string, open_for_read_in_child) + parent. */ + expanding_redir = 0; + ++ remove_quoted_escapes (string); ++ + subshell_level++; + result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST)); + subshell_level--; +-- +2.13.6 + diff --git a/system/base/bash/files/official/bash-4.4-patch-16.patch b/system/base/bash/files/official/bash-4.4-patch-16.patch new file mode 100644 index 00000000..752b034e --- /dev/null +++ b/system/base/bash/files/official/bash-4.4-patch-16.patch @@ -0,0 +1,68 @@ +From c9f1b04651dae16e33f0aa8974c5122e26b362ae Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Mon, 29 Jan 2018 16:04:20 -0500 +Subject: [PATCH] Bash-4.4 patch 16 + +--- + lib/sh/zread.c | 23 +++++++++-------------- + patchlevel.h | 2 +- + 2 files changed, 10 insertions(+), 15 deletions(-) + +diff --git a/lib/sh/zread.c b/lib/sh/zread.c +index 868f9705..496f20b8 100644 +--- a/lib/sh/zread.c ++++ b/lib/sh/zread.c +@@ -37,7 +37,10 @@ extern int errno; + # define SEEK_CUR 1 + #endif + ++extern int executing_builtin; ++ + extern void check_signals_and_traps (void); ++extern void check_signals (void); + extern int signal_is_trapped (int); + + /* Read LEN bytes from FD into BUF. Retry the read on EINTR. Any other +@@ -50,21 +53,13 @@ zread (fd, buf, len) + { + ssize_t r; + +-#if 0 +-#if defined (HAVE_SIGINTERRUPT) +- if (signal_is_trapped (SIGCHLD)) +- siginterrupt (SIGCHLD, 1); +-#endif +-#endif +- + while ((r = read (fd, buf, len)) < 0 && errno == EINTR) +- check_signals_and_traps (); /* XXX - should it be check_signals()? */ +- +-#if 0 +-#if defined (HAVE_SIGINTERRUPT) +- siginterrupt (SIGCHLD, 0); +-#endif +-#endif ++ /* XXX - bash-5.0 */ ++ /* We check executing_builtin and run traps here for backwards compatibility */ ++ if (executing_builtin) ++ check_signals_and_traps (); /* XXX - should it be check_signals()? */ ++ else ++ check_signals (); + + return r; + } +diff --git a/patchlevel.h b/patchlevel.h +index 6e9ed3fc..9074f4dd 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 15 ++#define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ +-- +2.13.6 + diff --git a/system/base/bash/files/official/bash-4.4-patch-17.patch b/system/base/bash/files/official/bash-4.4-patch-17.patch new file mode 100644 index 00000000..ac3eac87 --- /dev/null +++ b/system/base/bash/files/official/bash-4.4-patch-17.patch @@ -0,0 +1,41 @@ +From b3a5ec8dd510a68dc850f3f516c0cf9afd87451f Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Mon, 29 Jan 2018 16:04:37 -0500 +Subject: [PATCH] Bash-4.4 patch 17 + +--- + builtins/read.def | 5 +++++ + patchlevel.h | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/builtins/read.def b/builtins/read.def +index 33821f3f..803bea35 100644 +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -690,6 +690,11 @@ add_char: + input_string[i] = '\0'; + CHECK_ALRM; + ++#if defined (READLINE) ++ if (edit) ++ free (rlbuf); ++#endif ++ + if (retval < 0) + { + t_errno = errno; +diff --git a/patchlevel.h b/patchlevel.h +index 9074f4dd..98e714da 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 16 ++#define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ +-- +2.13.6 + diff --git a/system/base/bash/files/official/bash-4.4-patch-18.patch b/system/base/bash/files/official/bash-4.4-patch-18.patch new file mode 100644 index 00000000..853a9e39 --- /dev/null +++ b/system/base/bash/files/official/bash-4.4-patch-18.patch @@ -0,0 +1,38 @@ +From eb78197af36bb0fb95493ebf8fce104be6832ec9 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Mon, 29 Jan 2018 16:04:56 -0500 +Subject: [PATCH] Bash-4.4 patch 18 + +--- + builtins/read.def | 2 +- + patchlevel.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/builtins/read.def b/builtins/read.def +index 803bea35..b54b3af6 100644 +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -610,7 +610,7 @@ read_builtin (list) + } + + CHECK_ALRM; +- ++ QUIT; /* in case we didn't call check_signals() */ + #if defined (READLINE) + } + #endif +diff --git a/patchlevel.h b/patchlevel.h +index 98e714da..f0ee56e4 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 17 ++#define PATCHLEVEL 18 + + #endif /* _PATCHLEVEL_H_ */ +-- +2.13.6 + diff --git a/system/base/bash/files/official/bash-4.4-patch-19.patch b/system/base/bash/files/official/bash-4.4-patch-19.patch new file mode 100644 index 00000000..35e66060 --- /dev/null +++ b/system/base/bash/files/official/bash-4.4-patch-19.patch @@ -0,0 +1,40 @@ +From b0776d8c49ab4310fa056ce1033985996c5b9807 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Tue, 6 Feb 2018 16:22:34 -0500 +Subject: [PATCH] Bash-4.4 patch 19 + +--- + lib/readline/display.c | 4 +++- + patchlevel.h | 2 +- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/lib/readline/display.c b/lib/readline/display.c +index 41fb0531..2d2e768a 100644 +--- a/lib/readline/display.c ++++ b/lib/readline/display.c +@@ -771,7 +771,9 @@ rl_redisplay () + appear in the first and last lines of the prompt */ + wadjust = (newlines == 0) + ? prompt_invis_chars_first_line +- : ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line); ++ : ((newlines == prompt_lines_estimate) ++ ? (wrap_offset - prompt_invis_chars_first_line) ++ : 0); + + /* fix from Darin Johnson for prompt string with + invisible characters that is longer than the screen width. The +diff --git a/patchlevel.h b/patchlevel.h +index f0ee56e4..a711c495 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 18 ++#define PATCHLEVEL 19 + + #endif /* _PATCHLEVEL_H_ */ +-- +2.13.6 + diff --git a/system/base/bash/pspec.xml b/system/base/bash/pspec.xml index e1abb108..bc29afe7 100644 --- a/system/base/bash/pspec.xml +++ b/system/base/bash/pspec.xml @@ -28,7 +28,14 @@ official/bash-4.4-patch-8.patch official/bash-4.4-patch-9.patch official/bash-4.4-patch-10.patch - official/bash-4.4-patch-11.patch + official/bash-4.4-patch-11.patch + official/bash-4.4-patch-12.patch + official/bash-4.4-patch-13.patch + official/bash-4.4-patch-14.patch + official/bash-4.4-patch-15.patch + official/bash-4.4-patch-16.patch + official/bash-4.4-patch-17.patch + official/bash-4.4-patch-18.patch fedora/bash-2.02-security.patch @@ -58,6 +65,12 @@ fedora/bash-4.3-noecho.patch fedora/bash-4.3-memleak-lc_all.patch fedora/bash-4.4-no-loadable-builtins.patch + + fedora/bash-4.4-unset-nonblock-stdin.patch + fedora/bash-4.4-assignment-error.patch + fedora/bash-4.5-test-modification-time.patch + fedora/bash-4.4-case-in-command-subst.patch + fedora/bash-4.4-coverity.patch @@ -82,6 +95,13 @@ + + 2018-11-28 + 4.4.18 + Version bump. + Ertuğrul Erata + ertugrulerata@gmail.com + 2018-07-15 4.4.11