commit bash for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package bash for openSUSE:Factory checked in at 2021-12-01 20:46:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bash (Old) and /work/SRC/openSUSE:Factory/.bash.new.31177 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "bash" Wed Dec 1 20:46:32 2021 rev:173 rq:932216 version:5.1.MACRO Changes: -------- --- /work/SRC/openSUSE:Factory/bash/bash.changes 2021-10-08 22:04:35.616515249 +0200 +++ /work/SRC/openSUSE:Factory/.bash.new.31177/bash.changes 2021-12-02 02:10:20.807560696 +0100 @@ -1,0 +2,27 @@ +Thu Nov 18 10:28:52 UTC 2021 - Dr. Werner Fink <werner@suse.de> + +- Update bash 5.1 to patch level 12 + * Add official patch bash51-009 + The bash malloc implementation of malloc_usable_size() does not follow the + specification. This can cause library functions that use it to overwrite + memory bounds checking. + * Add official patch bash51-010 + If `wait -n' is interrupted by a trapped signal other than SIGINT, it does + not completely clean up state, and that can prevent subsequent calls to + `wait -n' from working correctly. + * Add official patch bash51-011 + When reading a compound assignment, and running it through the parser to + split it into words, we need to save and restore any alias we're currently + expanding. + * Add official patch bash51-012 + There is a possible race condition that arises when a child process receives + a signal trapped by the parent before it can reset the signal dispositions. + The child process is not supposed to trap the signal in this circumstance. + +------------------------------------------------------------------- +Fri Oct 22 09:28:06 UTC 2021 - Stefan Schubert <schubi@suse.de> + +- Using package bash-sh instead of the update-alternative + mechanism. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bash.spec ++++++ --- /var/tmp/diff_new_pack.v1dVmf/_old 2021-12-02 02:10:21.599558280 +0100 +++ /var/tmp/diff_new_pack.v1dVmf/_new 2021-12-02 02:10:21.607558256 +0100 @@ -16,6 +16,12 @@ # +%if 0%{?suse_version} > 1500 +%bcond_with alternatives +%else +%bcond_without alternatives +%endif + %define bextend %{nil} %define bversion 5.1 %define bpatchlvl %(bash %{_sourcedir}/get_version_number.sh %{_sourcedir}) @@ -81,17 +87,26 @@ BuildRequires: pkgconfig BuildRequires: screen BuildRequires: sed +%if %{with alternatives} BuildRequires: update-alternatives +%endif BuildRequires: pkgconfig(audit) BuildRequires: pkgconfig(ncurses) # This has to be always the same version as included in the bash its self BuildRequires: pkgconfig(readline) = 8.1 +%if %{with alternatives} Requires(post): update-alternatives Requires(preun):update-alternatives +%endif Suggests: bash-doc = %{version} Suggests: command-not-found Provides: /bin/bash +%if %{with alternatives} Provides: /bin/sh +%else +Requires: /usr/bin/sh +Suggests: bash-sh +%endif %description Bash is an sh-compatible command interpreter that executes commands @@ -113,6 +128,18 @@ %lang_package +%if %{without alternatives} +%package sh +Summary: Handle behaviour of /bin/sh +Group: System/Shells +Provides: alternative(sh) +Conflicts: alternative(sh) +Requires: bash = %{version} + +%description sh +Use bash as /bin/sh implementation. +%endif + %package devel Summary: Include Files mandatory for Development of bash loadable builtins Group: Development/Languages/C and C++ @@ -444,7 +471,9 @@ mv -vf %{buildroot}%{_ldldir}/*.inc %{buildroot}%{_datadir}/bash rm -rf %{buildroot}/%{_lib}/pkgconfig sed -ri '/CC = gcc/s@(CC = gcc).*@\1@' %{buildroot}%{_libdir}/pkgconfig/bash.pc +%if %{with alternatives} mkdir -p %{buildroot}%{_sysconfdir}/alternatives +%endif # # It should be noted that the move of /bin/bash to /usr/bin/bash # had NOT done by me at 2019/02/08. Now only a symbolic link @@ -455,7 +484,11 @@ ln -sf %{_bindir}/bash %{buildroot}/bin/bash ln -sf %{_bindir}/sh %{buildroot}/bin/sh ln -sf bash %{buildroot}%{_bindir}/rbash +%if %{with alternatives} ln -sf %{_sysconfdir}/alternatives/sh %{buildroot}%{_bindir}/sh +%else + ln -sf %{_bindir}/bash %{buildroot}%{_bindir}/sh +%endif install -m 644 COMPAT NEWS %{buildroot}%{_docdir}/%{name} install -m 644 COPYING %{buildroot}%{_docdir}/%{name} install -m 644 doc/FAQ %{buildroot}%{_docdir}/%{name} @@ -493,6 +526,7 @@ %fdupes -s %{buildroot}%{_datadir}/bash/helpfiles sed -ri '1{ s@/bin/sh@/bin/bash@ }' %{buildroot}%{_bindir}/bashbug +%if %{with alternatives} %post -p %{_bindir}/bash %{_sbindir}/update-alternatives --quiet --force \ --install %{_bindir}/sh sh %{_bindir}/bash 10100 @@ -501,22 +535,29 @@ if test "$1" = 0; then %{_sbindir}/update-alternatives --quiet --remove sh %{_bindir}/bash fi +%endif %files %license COPYING %config %attr(600,root,root) %{_sysconfdir}/skel/.bash_history %config %attr(644,root,root) %{_sysconfdir}/skel/.bashrc %config %attr(644,root,root) %{_sysconfdir}/skel/.profile +%if %{with alternatives} %ghost %config %{_sysconfdir}/alternatives/sh +%endif %dir %{_sysconfdir}/bash_completion.d %if !0%{?usrmerged} /bin/bash +%if %{with alternatives} /bin/sh %endif +%endif %{_bindir}/bash %{_bindir}/bashbug %{_bindir}/rbash +%if %{with alternatives} %{_bindir}/sh +%endif %dir %{_datadir}/bash %dir %{_datadir}/bash/helpfiles %{_datadir}/bash/helpfiles/* @@ -525,6 +566,14 @@ %{_mandir}/man1/bashbug.1%{?ext_man} %{_mandir}/man1/rbash.1%{?ext_man} +%if %{without alternatives} +%files sh +%if !0%{?usrmerged} +/bin/sh +%endif +%{_bindir}/sh +%endif + %files lang -f bash.lang %files doc ++++++ bash-4.3-2.4.4.patch ++++++ --- /var/tmp/diff_new_pack.v1dVmf/_old 2021-12-02 02:10:21.663558085 +0100 +++ /var/tmp/diff_new_pack.v1dVmf/_new 2021-12-02 02:10:21.663558085 +0100 @@ -54,7 +54,7 @@ signal_is_trapped (s) --- jobs.c +++ jobs.c 2020-10-12 16:00:37.267184666 +0000 -@@ -2221,6 +2221,15 @@ make_child (command, flags) +@@ -2223,6 +2223,15 @@ make_child (command, flags) child process, go back and change callers who free `command' in the child process when this returns. */ mypid = getpid (); @@ -72,7 +72,7 @@ 0 because that's the file descriptor used when redirecting input, --- sig.c +++ sig.c 2020-10-12 16:00:37.267184666 +0000 -@@ -83,10 +83,10 @@ sigset_t top_level_mask; +@@ -84,10 +84,10 @@ sigset_t top_level_mask; #endif /* JOB_CONTROL */ /* When non-zero, we throw_to_top_level (). */ ++++++ bash-4.3-sigrestart.patch ++++++ --- /var/tmp/diff_new_pack.v1dVmf/_old 2021-12-02 02:10:21.683558024 +0100 +++ /var/tmp/diff_new_pack.v1dVmf/_new 2021-12-02 02:10:21.683558024 +0100 @@ -4,7 +4,7 @@ --- sig.c +++ sig.c 2018-11-29 08:13:00.103944580 +0000 -@@ -788,6 +788,8 @@ set_signal_handler (sig, handler) +@@ -796,6 +796,8 @@ set_signal_handler (sig, handler) if (sig == SIGCHLD) act.sa_flags |= SA_RESTART; /* XXX */ #endif @@ -13,7 +13,7 @@ /* Let's see if we can keep SIGWINCH from interrupting interruptible system calls, like open(2)/read(2)/write(2) */ #if defined (SIGWINCH) -@@ -798,6 +800,10 @@ set_signal_handler (sig, handler) +@@ -806,6 +808,10 @@ set_signal_handler (sig, handler) it to be as close to SIG_IGN as possible. */ if (sig == SIGTERM && handler == sigterm_sighandler) act.sa_flags |= SA_RESTART; /* XXX */ ++++++ bash-5.1-patches.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-5.1-patches/bash51-005 new/bash-5.1-patches/bash51-005 --- old/bash-5.1-patches/bash51-005 2021-05-04 17:47:16.000000000 +0200 +++ new/bash-5.1-patches/bash51-005 2021-05-05 17:01:56.036398792 +0200 @@ -17,7 +17,7 @@ Patch (apply with `patch -p0'): -*** ../bash-5.1-patched/subst.c 2020-12-16 17:01:32.000000000 -0500 +*** subst.c 2020-12-16 17:01:32.000000000 -0500 --- subst.c 2021-01-24 17:48:40.000000000 -0500 *************** *** 11674,11677 **** @@ -28,7 +28,7 @@ + wlen = STRLEN (value); -*** ../bash-5.1-patched/arrayfunc.c 2020-12-16 17:01:32.000000000 -0500 +*** arrayfunc.c 2020-12-16 17:01:32.000000000 -0500 --- arrayfunc.c 2021-04-19 16:43:09.000000000 -0400 *************** *** 565,574 **** @@ -83,7 +83,7 @@ ! free (aval); } } -*** ../bash-5.1/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +*** patchlevel.h 2020-06-22 14:51:03.000000000 -0400 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 *************** *** 26,30 **** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-5.1-patches/bash51-006 new/bash-5.1-patches/bash51-006 --- old/bash-5.1-patches/bash51-006 2021-05-04 17:47:16.000000000 +0200 +++ new/bash-5.1-patches/bash51-006 2021-05-05 17:01:56.048398572 +0200 @@ -15,7 +15,7 @@ Patch (apply with `patch -p0'): -*** ../bash-5.1-patched/subst.c 2020-12-16 17:01:32.000000000 -0500 +*** subst.c 2020-12-16 17:01:32.000000000 -0500 --- subst.c 2020-12-25 19:20:25.000000000 -0500 *************** *** 6413,6416 **** @@ -31,7 +31,7 @@ + set_sigint_handler (); /* XXX */ -*** ../bash-5.1/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +*** patchlevel.h 2020-06-22 14:51:03.000000000 -0400 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 *************** *** 26,30 **** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-5.1-patches/bash51-007 new/bash-5.1-patches/bash51-007 --- old/bash-5.1-patches/bash51-007 2021-05-04 17:47:16.000000000 +0200 +++ new/bash-5.1-patches/bash51-007 2021-05-05 17:01:56.064398278 +0200 @@ -15,7 +15,7 @@ Patch (apply with `patch -p0'): -*** ../bash-5.1-patched/lib/readline/bind.c 2020-10-26 10:03:14.000000000 -0400 +*** lib/readline/bind.c 2020-10-26 10:03:14.000000000 -0400 --- lib/readline/bind.c 2021-01-18 16:38:48.000000000 -0500 *************** *** 1235,1239 **** @@ -78,7 +78,7 @@ + _rl_parsing_conditionalized_out = 1 - opresult; } /* Check to see if the first word in ARGS is the same as the -*** ../bash-5.1/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +*** patchlevel.h 2020-06-22 14:51:03.000000000 -0400 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 *************** *** 26,30 **** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-5.1-patches/bash51-008 new/bash-5.1-patches/bash51-008 --- old/bash-5.1-patches/bash51-008 2021-05-04 17:47:16.000000000 +0200 +++ new/bash-5.1-patches/bash51-008 2021-05-05 17:01:56.080397984 +0200 @@ -15,7 +15,7 @@ Patch (apply with `patch -p0'): -*** ../bash-5.1-patched/execute_cmd.c 2020-10-12 10:16:13.000000000 -0400 +*** execute_cmd.c 2020-10-12 10:16:13.000000000 -0400 --- execute_cmd.c 2021-05-04 11:12:39.000000000 -0400 *************** *** 5557,5565 **** @@ -44,7 +44,7 @@ + if (async) interactive = old_interactive; -*** ../bash-5.1/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +*** patchlevel.h 2020-06-22 14:51:03.000000000 -0400 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 *************** *** 26,30 **** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-5.1-patches/bash51-009 new/bash-5.1-patches/bash51-009 --- old/bash-5.1-patches/bash51-009 1970-01-01 01:00:00.000000000 +0100 +++ new/bash-5.1-patches/bash51-009 2021-11-17 22:33:10.000000000 +0100 @@ -0,0 +1,59 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.1 +Patch-ID: bash51-009 + +Bug-Reported-by: Julien Moutinho <julm+bash@sourcephile.fr> +Bug-Reference-ID: <20211004035906.5kiobuzkpeckmvwg@sourcephile.fr> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2021-10/msg00022.html + +Bug-Description: + +The bash malloc implementation of malloc_usable_size() does not follow the +specification. This can cause library functions that use it to overwrite +memory bounds checking. + +Patch (apply with `patch -p0'): + +*** ../bash-5.1-patched/lib/malloc/malloc.c 2020-07-08 10:19:30.000000000 -0400 +--- lib/malloc/malloc.c 2021-10-05 16:10:55.000000000 -0400 +*************** +*** 1287,1297 **** + } + +! /* XXX - should we return 0 if ISFREE? */ +! maxbytes = binsize(p->mh_index); +! +! /* So the usable size is the maximum number of bytes in the bin less the +! malloc overhead */ +! maxbytes -= MOVERHEAD + MSLOP; +! return (maxbytes); + } + +--- 1358,1367 ---- + } + +! /* return 0 if ISFREE */ +! if (p->mh_alloc == ISFREE) +! return 0; +! +! /* Since we use bounds checking, the usable size is the last requested size. */ +! return (p->mh_nbytes); + } + +*** ../bash-5.1/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 8 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 9 + + #endif /* _PATCHLEVEL_H_ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-5.1-patches/bash51-010 new/bash-5.1-patches/bash51-010 --- old/bash-5.1-patches/bash51-010 1970-01-01 01:00:00.000000000 +0100 +++ new/bash-5.1-patches/bash51-010 2021-11-17 22:33:21.000000000 +0100 @@ -0,0 +1,59 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.1 +Patch-ID: bash51-010 + +Bug-Reported-by: Jonas Alfredsson <jonas.alfredsson@protonmail.com> +Bug-Reference-ID: <LjAfZaEuZncr2RaqhSSfcaiXdkuK6kdEYxshP3LApXbgMVQzggMGyWHO9knVkXicW2fP-ibsipJ_GZ-YaJRm96Rsozf6PgFmPsljRCtflls=@protonmail.com> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2021-05/msg00059.html + +Bug-Description: + +If `wait -n' is interrupted by a trapped signal other than SIGINT, it does +not completely clean up state, and that can prevent subsequent calls to +`wait -n' from working correctly. + +Patch (apply with `patch -p0'): + +*** ../bash-5.1-patched/builtins/wait.def 2020-12-16 17:13:12.000000000 -0500 +--- builtins/wait.def 2021-11-17 10:25:15.000000000 -0500 +*************** +*** 112,116 **** + WORD_LIST *list; + { +! int status, code, opt, nflag, wflags; + char *vname; + SHELL_VAR *pidvar; +--- 112,117 ---- + WORD_LIST *list; + { +! int status, code, opt, nflag; +! volatile int wflags; + char *vname; + SHELL_VAR *pidvar; +*************** +*** 181,184 **** +--- 188,193 ---- + status = 128 + wait_signal_received; + wait_sigint_cleanup (); ++ if (wflags & JWAIT_WAITING) ++ unset_waitlist (); + WAIT_RETURN (status); + } + +*** ../bash-5.1/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 9 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-5.1-patches/bash51-011 new/bash-5.1-patches/bash51-011 --- old/bash-5.1-patches/bash51-011 1970-01-01 01:00:00.000000000 +0100 +++ new/bash-5.1-patches/bash51-011 2021-11-17 22:33:30.000000000 +0100 @@ -0,0 +1,81 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.1 +Patch-ID: bash51-011 + +Bug-Reported-by: Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> +Bug-Reference-ID: <CAALKErFrm+yuwy=ioK+RmjCiwxTDmzeMFWqLF2BEWYtkGS5UFQ@mail.gmail.com> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2020-11/msg00064.html + +Bug-Description: + +When reading a compound assignment, and running it through the parser to +split it into words, we need to save and restore any alias we're currently +expanding. + +Patch (apply with `patch -p0'): + +*** ../bash-5.1-patched/parse.y 2020-11-28 12:10:06.000000000 -0500 +--- parse.y 2021-10-13 11:04:27.000000000 -0400 +*************** +*** 6494,6501 **** + + push_stream (1); +- #if 0 /* TAG: bash-5.2 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> 11/17/2020 */ + if (ea = expanding_alias ()) + parser_save_alias (); +- #endif + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; +--- 6494,6499 ---- +*************** +*** 6532,6539 **** + pop_stream (); + +- #if 0 /* TAG: bash-5.2 */ + if (ea) + parser_restore_alias (); +- #endif + + #if defined (HISTORY) +--- 6530,6535 ---- +*** ../bash-5.1-patched/y.tab.c 2020-11-28 12:17:19.000000000 -0500 +--- y.tab.c 2021-11-17 10:47:35.000000000 -0500 +*************** +*** 8788,8795 **** + + push_stream (1); +- #if 0 /* TAG: bash-5.2 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com> 11/17/2020 */ + if (ea = expanding_alias ()) + parser_save_alias (); +- #endif + last_read_token = WORD; /* WORD to allow reserved words here */ + current_command_line_count = 0; +--- 8777,8782 ---- +*************** +*** 8826,8833 **** + pop_stream (); + +- #if 0 /* TAG: bash-5.2 */ + if (ea) + parser_restore_alias (); +- #endif + + #if defined (HISTORY) +--- 8813,8818 ---- +*** ../bash-5.1/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bash-5.1-patches/bash51-012 new/bash-5.1-patches/bash51-012 --- old/bash-5.1-patches/bash51-012 1970-01-01 01:00:00.000000000 +0100 +++ new/bash-5.1-patches/bash51-012 2021-11-17 22:33:40.000000000 +0100 @@ -0,0 +1,198 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 5.1 +Patch-ID: bash51-012 + +Bug-Reported-by: Nikolay Borisov <nborisov@suse.com> +Bug-Reference-ID: <1a715205-06ce-413b-c1c0-2f5639ce06c0@suse.com> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2020-11/msg00091.html + +Bug-Description: + +There is a possible race condition that arises when a child process receives +a signal trapped by the parent before it can reset the signal dispositions. +The child process is not supposed to trap the signal in this circumstance. + +Patch (apply with `patch -p0'): + +*** ../bash-20201118/command.h 2020-08-14 15:04:39.000000000 -0400 +--- command.h 2020-11-27 15:18:02.000000000 -0500 +*************** +*** 125,128 **** +--- 125,129 ---- + #define SUBSHELL_COPROC 0x40 /* subshell from a coproc pipeline */ + #define SUBSHELL_RESETTRAP 0x80 /* subshell needs to reset trap strings on first call to trap */ ++ #define SUBSHELL_IGNTRAP 0x100 /* subshell should reset trapped signals from trap_handler */ + + /* A structure which represents a word. */ + +*** ../bash-20201118/execute_cmd.c 2020-11-23 14:16:48.000000000 -0500 +--- execute_cmd.c 2020-11-27 16:43:25.000000000 -0500 +*************** +*** 1548,1551 **** +--- 1548,1554 ---- + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; ++ /* Note that signal handlers have been reset, so we should no longer ++ reset the handler and resend trapped signals to ourselves. */ ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + + /* We are in a subshell, so forget that we are running a trap handler or +*************** +*** 4321,4325 **** + cmdflags |= CMD_NO_FORK; + +! subshell_environment = SUBSHELL_FORK; /* XXX */ + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; +--- 4324,4329 ---- + cmdflags |= CMD_NO_FORK; + +! /* We redo some of what make_child() does with SUBSHELL_IGNTRAP */ +! subshell_environment = SUBSHELL_FORK|SUBSHELL_IGNTRAP; /* XXX */ + if (pipe_in != NO_PIPE || pipe_out != NO_PIPE) + subshell_environment |= SUBSHELL_PIPE; +*************** +*** 4575,4578 **** +--- 4580,4584 ---- + reset_signal_handlers (); + subshell_environment |= SUBSHELL_RESETTRAP; ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + + if (async) +*************** +*** 5515,5518 **** +--- 5521,5525 ---- + /* Cancel traps, in trap.c. */ + restore_original_signals (); ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + + #if defined (JOB_CONTROL) + +*** ../bash-20201118/jobs.c 2020-08-04 10:17:39.000000000 -0400 +--- jobs.c 2020-11-27 16:39:56.000000000 -0500 +*************** +*** 2218,2221 **** +--- 2218,2223 ---- + pid_t mypid; + ++ subshell_environment |= SUBSHELL_IGNTRAP; ++ + /* If this ends up being changed to modify or use `command' in the + child process, go back and change callers who free `command' in +diff -rC 2 ../bash-20201118/nojobs.c nojobs.c +*** ../bash-20201118/nojobs.c 2020-07-08 10:11:25.000000000 -0400 +--- nojobs.c 2020-11-27 16:38:36.000000000 -0500 +*************** +*** 576,579 **** +--- 576,581 ---- + #endif + ++ subshell_environment |= SUBSHELL_IGNTRAP; ++ + default_tty_job_signals (); + } + +*** ../bash-20201118/sig.c 2020-11-23 13:22:17.000000000 -0500 +--- sig.c 2020-11-28 10:21:43.000000000 -0500 +*************** +*** 56,60 **** + #endif + +! extern void initialize_siglist (); + + #if !defined (JOB_CONTROL) +--- 56,61 ---- + #endif + +! extern void initialize_siglist PARAMS((void)); +! extern void set_original_signal PARAMS((int, SigHandler *)); + + #if !defined (JOB_CONTROL) +*************** +*** 256,259 **** +--- 257,267 ---- + XHANDLER(i) = oact.sa_handler; + XSAFLAGS(i) = oact.sa_flags; ++ ++ #if 0 ++ set_original_signal (XSIG(i), XHANDLER(i)); /* optimization */ ++ #else ++ set_original_signal (XSIG(i), act.sa_handler); /* optimization */ ++ #endif ++ + /* Don't do anything with signals that are ignored at shell entry + if the shell is not interactive. */ + +*** ../bash-20201118/subst.c 2020-11-16 10:33:15.000000000 -0500 +--- subst.c 2020-11-27 16:07:00.000000000 -0500 +*************** +*** 5952,5955 **** +--- 5952,5956 ---- + /* Cancel traps, in trap.c. */ + restore_original_signals (); /* XXX - what about special builtins? bash-4.2 */ ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + QUIT; /* catch any interrupts we got post-fork */ + setup_async_signals (); +*************** +*** 6383,6386 **** +--- 6384,6388 ---- + QUIT; /* catch any interrupts we got post-fork */ + subshell_environment |= SUBSHELL_RESETTRAP; ++ subshell_environment &= ~SUBSHELL_IGNTRAP; + } + + +diff -rC 2 ../bash-20201118/trap.c trap.c +*** ../bash-20201118/trap.c 2020-11-28 12:04:07.000000000 -0500 +--- trap.c 2020-11-28 10:22:10.000000000 -0500 +*************** +*** 482,485 **** +--- 482,511 ---- + } + ++ /* This means we're in a subshell, but have not yet reset the handler for ++ trapped signals. We're not supposed to execute the trap in this situation; ++ we should restore the original signal and resend the signal to ourselves ++ to preserve the Posix "signal traps that are not being ignored shall be ++ set to the default action" semantics. */ ++ if ((subshell_environment & SUBSHELL_IGNTRAP) && trap_list[sig] != (char *)IGNORE_SIG) ++ { ++ sigset_t mask; ++ ++ /* Paranoia */ ++ if (original_signals[sig] == IMPOSSIBLE_TRAP_HANDLER) ++ original_signals[sig] = SIG_DFL; ++ ++ restore_signal (sig); ++ ++ /* Make sure we let the signal we just caught through */ ++ sigemptyset (&mask); ++ sigprocmask (SIG_SETMASK, (sigset_t *)NULL, &mask); ++ sigdelset (&mask, sig); ++ sigprocmask (SIG_SETMASK, &mask, (sigset_t *)NULL); ++ ++ kill (getpid (), sig); ++ ++ SIGRETURN (0); ++ } ++ + if ((sig >= NSIG) || + (trap_list[sig] == (char *)DEFAULT_SIG) || + +*** ../bash-5.1/patchlevel.h 2020-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2020-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */
participants (1)
-
Source-Sync