From d48a871f21e5d2a440bcf0acce1279fb02ec5107 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 02 2016 13:54:14 +0000 Subject: import bash-4.2.46-20.el7_2 --- diff --git a/SOURCES/fix-shopt-lastpipe-mode-crash.patch b/SOURCES/fix-shopt-lastpipe-mode-crash.patch new file mode 100644 index 0000000..620cb20 --- /dev/null +++ b/SOURCES/fix-shopt-lastpipe-mode-crash.patch @@ -0,0 +1,48 @@ +From 0eb5e47f531b49c8d048c9ae9657eeb63f49a9f3 Mon Sep 17 00:00:00 2001 +From: Siteshwar Vashisht +Date: Fri, 13 May 2016 01:34:06 +0530 +Subject: [PATCH] Fix shopt lastpipe mode crash + +--- + execute_cmd.c | 23 ++++++++++++++++++++--- + 1 file changed, 20 insertions(+), 3 deletions(-) + +diff --git a/execute_cmd.c b/execute_cmd.c +index c5cf6d2..7b22460 100644 +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -2254,11 +2254,28 @@ execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close) + if (lastpipe_flag) + { + #if defined (JOB_CONTROL) +- append_process (savestring (the_printed_command), dollar_dollar_pid, exec_result, lastpipe_jid); +-#endif ++ if (INVALID_JOB (lastpipe_jid) == 0) ++ { ++ append_process (savestring (the_printed_command_except_trap), dollar_dollar_pid, exec_result, lastpipe_jid); ++ lstdin = wait_for (lastpid); ++ } ++ else ++ lstdin = wait_for_single_pid (lastpid); /* checks bgpids list */ ++#else + lstdin = wait_for (lastpid); ++#endif ++ + #if defined (JOB_CONTROL) +- exec_result = job_exit_status (lastpipe_jid); ++ /* If wait_for removes the job from the jobs table, use result of last ++ command as pipeline's exit status as usual. The jobs list can get ++ frozen and unfrozen at inconvenient times if there are multiple pipelines ++ running simultaneously. */ ++ if (INVALID_JOB (lastpipe_jid) == 0) ++ exec_result = job_exit_status (lastpipe_jid); ++ else if (pipefail_opt) ++ exec_result = exec_result | lstdin; /* XXX */ ++ /* otherwise we use exec_result */ ++ + #endif + unfreeze_jobs_list (); + } +-- +2.5.5 + diff --git a/SPECS/bash.spec b/SPECS/bash.spec index 82f7aa1..b36f374 100644 --- a/SPECS/bash.spec +++ b/SPECS/bash.spec @@ -6,7 +6,7 @@ Version: %{baseversion}%{patchleveltag} Name: bash Summary: The GNU Bourne Again shell -Release: 19%{?dist} +Release: 20%{?dist} Group: System Environment/Shells License: GPLv3+ Url: http://www.gnu.org/software/bash @@ -162,6 +162,9 @@ Patch141: bash-4.2-case-in-command-subst.patch #1237213 - export when fnname contains hyphens Patch142: bash-4.2-enable-hyphened-fn-export.patch +#1355771 +Patch143: fix-shopt-lastpipe-mode-crash.patch + BuildRequires: texinfo bison BuildRequires: ncurses-devel BuildRequires: autoconf, gettext @@ -282,6 +285,7 @@ This package contains documentation files for %{name}. %patch140 -p1 -b .check-debugger %patch141 -p1 -b .command-subst %patch142 -p0 -b .export +%patch143 -p1 -b .fix-shopt-lastpipe-mode echo %{version} > _distribution echo %{release} > _patchlevel @@ -474,6 +478,10 @@ end #%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt %changelog +* Tue Jul 12 2016 Siteshwar Vashisht - 4.2.46-20 +- Fix a crash when lastpipe mode is enabled + Resolves: #1355771 + * Wed Jul 08 2015 Ondrej Oprala - 4.2.46-19 - Add a necessary declaration to common.h Related: #1165793