From 30ef81cbb46dfd8ec7e72b7271091d81b9b3f732 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Mon, 12 Feb 2018 15:35:44 +0100 Subject: [PATCH] Update to bash-4.4 patchlevel 19 Removed patch bash-4.4-heredoc-cloexec.patch as it has been pushed in upstream by bash-4.4-patch-13.patch Resolves: #1540383 --- bash-4.4-heredoc-cloexec.patch | 13 ------ bash-4.4-patch-13.patch | 38 +++++++++++++++ bash-4.4-patch-14.patch | 85 ++++++++++++++++++++++++++++++++++ bash-4.4-patch-15.patch | 38 +++++++++++++++ bash-4.4-patch-16.patch | 68 +++++++++++++++++++++++++++ bash-4.4-patch-17.patch | 41 ++++++++++++++++ bash-4.4-patch-18.patch | 38 +++++++++++++++ bash-4.4-patch-19.patch | 40 ++++++++++++++++ bash.spec | 20 ++++---- 9 files changed, 358 insertions(+), 23 deletions(-) delete mode 100644 bash-4.4-heredoc-cloexec.patch create mode 100644 bash-4.4-patch-13.patch create mode 100644 bash-4.4-patch-14.patch create mode 100644 bash-4.4-patch-15.patch create mode 100644 bash-4.4-patch-16.patch create mode 100644 bash-4.4-patch-17.patch create mode 100644 bash-4.4-patch-18.patch create mode 100644 bash-4.4-patch-19.patch diff --git a/bash-4.4-heredoc-cloexec.patch b/bash-4.4-heredoc-cloexec.patch deleted file mode 100644 index 47fcb5d..0000000 --- a/bash-4.4-heredoc-cloexec.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/redir.c b/redir.c -index 25488ea..1858b0b 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) diff --git a/bash-4.4-patch-13.patch b/bash-4.4-patch-13.patch new file mode 100644 index 0000000..abfb2de --- /dev/null +++ b/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/bash-4.4-patch-14.patch b/bash-4.4-patch-14.patch new file mode 100644 index 0000000..bceb8ea --- /dev/null +++ b/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/bash-4.4-patch-15.patch b/bash-4.4-patch-15.patch new file mode 100644 index 0000000..7d1dccf --- /dev/null +++ b/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/bash-4.4-patch-16.patch b/bash-4.4-patch-16.patch new file mode 100644 index 0000000..752b034 --- /dev/null +++ b/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/bash-4.4-patch-17.patch b/bash-4.4-patch-17.patch new file mode 100644 index 0000000..ac3eac8 --- /dev/null +++ b/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/bash-4.4-patch-18.patch b/bash-4.4-patch-18.patch new file mode 100644 index 0000000..853a9e3 --- /dev/null +++ b/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/bash-4.4-patch-19.patch b/bash-4.4-patch-19.patch new file mode 100644 index 0000000..35e6606 --- /dev/null +++ b/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/bash.spec b/bash.spec index 4296f18..fd5a696 100644 --- a/bash.spec +++ b/bash.spec @@ -1,13 +1,13 @@ #% define beta_tag rc2 %global _hardened_build 1 -%define patchleveltag .12 +%define patchleveltag .19 %define baseversion 4.4 %bcond_without tests Version: %{baseversion}%{patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 14%{?dist} +Release: 1%{?dist} License: GPLv3+ Url: http://www.gnu.org/software/bash Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz @@ -21,7 +21,7 @@ Source3: dot-bash_logout # Official upstream patches # Patches are converted to apply with '-p1' -%{lua:for i=1,12 do print(string.format("Patch%u: bash-4.4-patch-%u.patch\n", i, i)) end} +%{lua:for i=1,19 do print(string.format("Patch%u: bash-4.4-patch-%u.patch\n", i, i)) end} # Other patches Patch101: bash-2.02-security.patch @@ -77,21 +77,17 @@ Patch126: bash-4.3-memleak-lc_all.patch # this patch disables it Patch127: bash-4.4-no-loadable-builtins.patch -# 1413676 - Bash leaks heredoc fd to child processes -# This should be dropped while rebasing to bash-4.5 -Patch128: bash-4.4-heredoc-cloexec.patch - # 1068697 - Explicitly unset nonblocking mode while reading from stdin # This should be dropped while rebasing to bash-4.5 -Patch129: bash-4.4-unset-nonblock-stdin.patch +Patch128: bash-4.4-unset-nonblock-stdin.patch # 1389838 - command builtin should not abort on variable assignment errors # This should be dropped while rebasing to bash-4.5 -Patch130: bash-4.4-assignment-error.patch +Patch129: bash-4.4-assignment-error.patch # 1458008 - test builtin ignores subsecond while comparing file modification times # This should be dropped while rebasing to bash-4.5 -Patch131: bash-4.5-test-modification-time.patch +Patch130: bash-4.5-test-modification-time.patch BuildRequires: texinfo bison BuildRequires: ncurses-devel @@ -316,6 +312,10 @@ end %{_libdir}/pkgconfig/%{name}.pc %changelog +* Mon Feb 12 2018 Siteshwar Vashisht - 4.4.19-1 +- Update to bash-4.4 patchlevel 19 + Resolves: #1540383 + * Wed Feb 07 2018 Fedora Release Engineering - 4.4.12-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild