From 9ec5cca5b8943cb80b8db146b246a7c03aa4d10f Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 20 Mar 2009 18:04:18 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/bash?expand=0&rev=35 --- bash-4.0-complete.dif | 10 -------- bash-4.0-patches.tar.bz2 | 4 ++-- bash-4.0.10-bar-and-piping.patch | 29 ++++++++++++++++++++++ bash-4.0.10-segfault.patch | 41 ++++++++++++++++++++++++++++++++ bash-4.0.10-typo.patch | 21 ++++++++++++++++ bash.changes | 16 +++++++++++++ bash.spec | 25 +++++++++++++------ 7 files changed, 127 insertions(+), 19 deletions(-) delete mode 100644 bash-4.0-complete.dif create mode 100644 bash-4.0.10-bar-and-piping.patch create mode 100644 bash-4.0.10-segfault.patch create mode 100644 bash-4.0.10-typo.patch diff --git a/bash-4.0-complete.dif b/bash-4.0-complete.dif deleted file mode 100644 index d403d632..00000000 --- a/bash-4.0-complete.dif +++ /dev/null @@ -1,10 +0,0 @@ ---- pcomplete.c -+++ pcomplete.c 2009-03-04 11:58:05.296254166 +0000 -@@ -1032,6 +1032,7 @@ gen_shell_function_matches (cs, text, li - cmdlist = build_arg_list (funcname, text, lwords, cw); - - pps = &ps; -+ save_parser_state (pps); - begin_unwind_frame ("gen-shell-function-matches"); - add_unwind_protect (restore_parser_state, (char *)pps); - add_unwind_protect (dispose_words, (char *)cmdlist); diff --git a/bash-4.0-patches.tar.bz2 b/bash-4.0-patches.tar.bz2 index d44c6a89..ab41209c 100644 --- a/bash-4.0-patches.tar.bz2 +++ b/bash-4.0-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:edcca232666f913366fb75f95c08c1a4275c29de0e464dae77fa8bec72bc8314 -size 3959 +oid sha256:e60bf361e9a96b3903a30f323f6d6f00e88604cd6212f5666af9ca294df793ff +size 6729 diff --git a/bash-4.0.10-bar-and-piping.patch b/bash-4.0.10-bar-and-piping.patch new file mode 100644 index 00000000..062aa9da --- /dev/null +++ b/bash-4.0.10-bar-and-piping.patch @@ -0,0 +1,29 @@ +|> On Wed, Mar 11, 2009 at 09:50:18PM -0400, Matt +|> > rm 2>&1 | grep --color op +|> > rm |& grep --color op +|> > +|> > Notice that they are behaving differently. +|> +|> Confirmed in 4.0.0 and 4.0.10: +| +|Interesting. Only for non-builtin simple commands and some shell functions. +|The attached patch fixes it for me. +| +|Chet +| +*** parse.y 2009-03-09 10:27:05.000000000 -0400 +--- parse.y 2009-03-12 09:02:31.000000000 -0400 +*************** +*** 1123,1127 **** + REDIRECT *r; + +! tc = $1; + rd.dest = 1; + r = make_redirection (2, r_duplicating_output, rd); +--- 1123,1127 ---- + REDIRECT *r; + +! tc = $1->type == cm_simple ? $1->value.Simple : $1; + rd.dest = 1; + r = make_redirection (2, r_duplicating_output, rd); + diff --git a/bash-4.0.10-segfault.patch b/bash-4.0.10-segfault.patch new file mode 100644 index 00000000..42ffb1c3 --- /dev/null +++ b/bash-4.0.10-segfault.patch @@ -0,0 +1,41 @@ +| Date: Sat, 14 Mar 2009 14:00:35 +0800 +| From: "Clark J. Wang" +| To: Bash - Bug +| Subject: [bash-bug] [PATCH] bash-4.0.10: segfault with `; &' at the end of case statement +| +| With bash version: 4.0.10, the following case statement crashed with +| segfault: +| +| $ cat foo.sh +| case a in +| a) echo a ;& +| esac +| $ bash4 foo.sh +| a +| Segmentation fault +| $ +| +| In an interactive shell, that case statement causes current shell to hang +| with nearly 100% CPU usage. +| +| The following patch fixes this for me: +| +*** execute_cmd.c 2009-02-14 05:41:41.000000000 +0800 +--- execute_cmd.c 2009-03-14 13:47:15.000000000 +0800 +*************** +*** 2932,2938 **** + retval = execute_command (clauses->action); + } + while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = clauses->next)); +! if ((clauses->flags & CASEPAT_TESTNEXT) == 0) + EXIT_CASE (); + else + break; +--- 2932,2938 ---- + retval = execute_command (clauses->action); + } + while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = clauses->next)); +! if (!clauses || (clauses->flags & CASEPAT_TESTNEXT) == 0) + EXIT_CASE (); + else + break; diff --git a/bash-4.0.10-typo.patch b/bash-4.0.10-typo.patch new file mode 100644 index 00000000..d24bc714 --- /dev/null +++ b/bash-4.0.10-typo.patch @@ -0,0 +1,21 @@ +| Date: Sat, 14 Mar 2009 21:14:06 +0100 +| From: Andreas Schwab +| To: bug-bash@gnu.org +| Subject: [bash-bug] Doc typo +| +| A small typo in the bash doc. +| +| Andreas. +| +--- doc/bashref.texi 2009-02-18 21:14:43.000000000 +0100 ++++ doc/bashref.texi 2009-03-14 21:11:36.000000000 +0100 +@@ -864,7 +864,7 @@ operator terminates a pattern list. + A list of patterns and an associated command-list is known + as a @var{clause}. + +-Each clause must be terminated with @samp{;;}, @samp{,&}, or @samp{;;&}. ++Each clause must be terminated with @samp{;;}, @samp{;&}, or @samp{;;&}. + The @var{word} undergoes tilde expansion, parameter expansion, command + substitution, arithmetic expansion, and quote removal before matching is + attempted. Each @var{pattern} undergoes tilde expansion, parameter + diff --git a/bash.changes b/bash.changes index 56a4b317..11fdd4d0 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Mon Mar 16 11:38:14 CET 2009 - werner@suse.de + +- Add patches from bug-bash@gnu.org to avoid eg. segmentation fault + +------------------------------------------------------------------- +Thu Mar 12 15:05:55 CET 2009 - werner@suse.de + +- Add patch from bug-bash@gnu.org to enable |& not only for + builtins and shell functions but for all commands. + +------------------------------------------------------------------- +Tue Mar 10 14:50:55 CET 2009 - werner@suse.de + +- Switch to official patches, now we are on patch level 10 + ------------------------------------------------------------------- Wed Mar 4 17:36:35 CET 2009 - werner@suse.de diff --git a/bash.spec b/bash.spec index 02c87df5..3736100a 100644 --- a/bash.spec +++ b/bash.spec @@ -27,7 +27,7 @@ Recommends: bash-doc = %bash_vers Suggests: command-not-found AutoReqProv: on Version: 4.0 -Release: 6 +Release: 7 Summary: The GNU Bourne-Again Shell Url: http://www.gnu.org/software/bash/bash.html Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{bash_vers}.tar.bz2 @@ -52,12 +52,14 @@ Patch11: bash-4.0-loadables.dif Patch14: bash-3.2-sigrestart.patch Patch15: bash-3.2-longjmp.dif Patch16: bash-4.0-setlocale.dif -Patch17: bash-4.0-complete.dif Patch20: readline-%{rl_vers}.dif Patch21: readline-4.3-input.dif Patch22: readline-6.0-wrap.patch Patch23: readline-5.2-conf.patch Patch30: readline-6.0-destdir.patch +Patch40: bash-4.0.10-bar-and-piping.patch +Patch41: bash-4.0.10-segfault.patch +Patch42: bash-4.0.10-typo.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _incdir %{_includedir} @@ -85,7 +87,7 @@ Group: Documentation/Man Provides: bash:%{_infodir}/bash.info.gz PreReq: %install_info_prereq Version: 4.0 -Release: 6 +Release: 7 AutoReqProv: on %description -n bash-doc @@ -105,7 +107,7 @@ Summary: The Readline Library Group: System/Libraries Provides: bash:/%{_lib}/libreadline.so.%{rl_major} Version: 6.0 -Release: 6 +Release: 7 Recommends: readline-doc = %{version} # bug437293 %ifarch ppc64 @@ -134,7 +136,7 @@ Summary: Include Files and Libraries mandatory for Development Group: Development/Libraries/C and C++ Provides: bash:%{_libdir}/libreadline.a Version: 6.0 -Release: 6 +Release: 7 Requires: libreadline6 = %{version} Requires: ncurses-devel Recommends: readline-doc = %{version} @@ -163,7 +165,7 @@ Group: System/Libraries Provides: readline:%{_infodir}/readline.info.gz PreReq: %install_info_prereq Version: 6.0 -Release: 6 +Release: 7 AutoReqProv: on %description -n readline-doc @@ -198,10 +200,12 @@ unset p %patch14 -p0 -b .sigrestart %patch15 -p0 -b .longjmp %patch16 -p0 -b .setlocale -%patch17 -p0 -b .complete %patch21 -p0 -b .zerotty %patch22 -p0 -b .wrap %patch23 -p0 -b .conf +%patch40 -p0 -b .pipe +%patch41 -p0 -b .segfault +%patch42 -p0 -b .typo %patch0 -p0 cd ../readline-%{rl_vers} for p in ../readline-%{rl_vers}-patches/*; do @@ -507,6 +511,13 @@ ldd -u -r %{buildroot}%{_libdir}/libreadline.so || true %doc %{_defaultdocdir}/readline/ %changelog +* Mon Mar 16 2009 werner@suse.de +- Add patches from bug-bash@gnu.org to avoid eg. segmentation fault +* Thu Mar 12 2009 werner@suse.de +- Add patch from bug-bash@gnu.org to enable |& not only for + builtins and shell functions but for all commands. +* Tue Mar 10 2009 werner@suse.de +- Switch to official patches, now we are on patch level 10 * Wed Mar 04 2009 werner@suse.de - Use patches from bug-bash@gnu.org to make it work * Wed Mar 04 2009 werner@suse.de