Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
bash: update to patchlevel 12
Browse files Browse the repository at this point in the history
  • Loading branch information
MingcongBai committed Feb 8, 2017
1 parent a3871bd commit f6105ba
Show file tree
Hide file tree
Showing 15 changed files with 984 additions and 4 deletions.
1 change: 0 additions & 1 deletion core-shells/bash/autobuild/defines
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ RPMEXTRAPROVIDE="/bin/sh /bin/bash /sbin/bash"
AUTOTOOLS_AFTER="--bindir=/bin --with-curses --enable-readline \
--without-bash-malloc --with-installed-readline \
--build=${ARCH_TARGET[$ARCH]}"

AB_FLAGS_O3=1
3 changes: 3 additions & 0 deletions core-shells/bash/autobuild/patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
for i in autobuild/patches/bash44-0*; do
patch -p0 < $i
done
60 changes: 60 additions & 0 deletions core-shells/bash/autobuild/patches/bash44-001
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
BASH PATCH REPORT
=================

Bash-Release: 4.4
Patch-ID: bash44-001

Bug-Reported-by: Sean Zha <freeman_cha@hotmail.com>
Bug-Reference-ID: <BN3PR01MB13657D9303EB94BF6E54216E8CCA0@BN3PR01MB1365.prod.exchangelabs.com>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00107.html

Bug-Description:

Bash-4.4 changed the way the history list is initially allocated to reduce
the number of reallocations and copies. Users who set HISTSIZE to a very
large number to essentially unlimit the size of the history list will get
memory allocation errors

Patch (apply with `patch -p0'):

*** ../bash-4.4/lib/readline/history.c 2015-12-28 13:50:31.000000000 -0500
--- lib/readline/history.c 2016-09-30 14:28:40.000000000 -0400
***************
*** 58,61 ****
--- 58,63 ----
#define DEFAULT_HISTORY_INITIAL_SIZE 502

+ #define MAX_HISTORY_INITIAL_SIZE 8192
+
/* The number of slots to increase the_history by. */
#define DEFAULT_HISTORY_GROW_SIZE 50
***************
*** 308,312 ****
{
if (history_stifled && history_max_entries > 0)
! history_size = history_max_entries + 2;
else
history_size = DEFAULT_HISTORY_INITIAL_SIZE;
--- 310,316 ----
{
if (history_stifled && history_max_entries > 0)
! history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
! ? MAX_HISTORY_INITIAL_SIZE
! : history_max_entries + 2;
else
history_size = DEFAULT_HISTORY_INITIAL_SIZE;
*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 0

#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 1

#endif /* _PATCHLEVEL_H_ */
69 changes: 69 additions & 0 deletions core-shells/bash/autobuild/patches/bash44-002
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
BASH PATCH REPORT
=================

Bash-Release: 4.4
Patch-ID: bash44-002

Bug-Reported-by: Eric Pruitt <eric.pruitt@gmail.com>
Bug-Reference-ID: <20160916055120.GA28272@sinister.codevat.com>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00015.html

Bug-Description:

Bash-4.4 warns when discarding NUL bytes in command substitution output
instead of silently dropping them. This patch changes the warnings from
one per NUL byte encountered to one warning per command substitution.

Patch (apply with `patch -p0'):

*** ../bash-4.4/subst.c 2016-08-30 16:46:38.000000000 -0400
--- subst.c 2016-09-26 10:20:19.000000000 -0400
***************
*** 5932,5935 ****
--- 5933,5937 ----
int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul;
ssize_t bufn;
+ int nullbyte;

istring = (char *)NULL;
***************
*** 5939,5942 ****
--- 5941,5946 ----
skip_ctlesc |= *s == CTLESC, skip_ctlnul |= *s == CTLNUL;

+ nullbyte = 0;
+
/* Read the output of the command through the pipe. This may need to be
changed to understand multibyte characters in the future. */
***************
*** 5957,5961 ****
{
#if 1
! internal_warning ("%s", _("command substitution: ignored null byte in input"));
#endif
continue;
--- 5961,5969 ----
{
#if 1
! if (nullbyte == 0)
! {
! internal_warning ("%s", _("command substitution: ignored null byte in input"));
! nullbyte = 1;
! }
#endif
continue;
*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 1

#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 2

#endif /* _PATCHLEVEL_H_ */
58 changes: 58 additions & 0 deletions core-shells/bash/autobuild/patches/bash44-003
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
BASH PATCH REPORT
=================

Bash-Release: 4.4
Patch-ID: bash44-003

Bug-Reported-by: op7ic \x00 <op7ica@gmail.com>
Bug-Reference-ID: <CAFHyJTopWC5Jx+U7WcvxSZKu+KrqSf+_3sHPiRWo=VzXSiPq=w@mail.gmail.com>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00005.html

Bug-Description:

Specially-crafted input, in this case an incomplete pathname expansion
bracket expression containing an invalid collating symbol, can cause the
shell to crash.

Patch (apply with `patch -p0'):

*** ../bash-4.4/lib/glob/sm_loop.c 2016-04-10 11:23:21.000000000 -0400
--- lib/glob/sm_loop.c 2016-11-02 14:03:34.000000000 -0400
***************
*** 331,334 ****
--- 331,340 ----
if (p[pc] == L('.') && p[pc+1] == L(']'))
break;
+ if (p[pc] == 0)
+ {
+ if (vp)
+ *vp = INVALID;
+ return (p + pc);
+ }
val = COLLSYM (p, pc);
if (vp)
***************
*** 484,487 ****
--- 490,496 ----
c = FOLD (c);

+ if (c == L('\0'))
+ return ((test == L('[')) ? savep : (CHAR *)0);
+
if ((flags & FNM_PATHNAME) && c == L('/'))
/* [/] can never match when matching a pathname. */
*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 2

#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 3

#endif /* _PATCHLEVEL_H_ */
84 changes: 84 additions & 0 deletions core-shells/bash/autobuild/patches/bash44-004
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
BASH PATCH REPORT
=================

Bash-Release: 4.4
Patch-ID: bash44-004

Bug-Reported-by: Christian Weisgerber <naddy@mips.inka.de>
Bug-Reference-ID: <20161101160302.GB54856@lorvorc.mips.inka.de>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00004.html

Bug-Description:

There is a race condition that can result in bash referencing freed memory
when freeing data associated with the last process substitution.

Patch (apply with `patch -p0'):

*** ../bash-4.4/jobs.c 2016-08-23 16:38:44.000000000 -0400
--- jobs.c 2016-11-02 18:24:45.000000000 -0400
***************
*** 454,457 ****
--- 454,472 ----
}

+ void
+ discard_last_procsub_child ()
+ {
+ PROCESS *disposer;
+ sigset_t set, oset;
+
+ BLOCK_CHILD (set, oset);
+ disposer = last_procsub_child;
+ last_procsub_child = (PROCESS *)NULL;
+ UNBLOCK_CHILD (oset);
+
+ if (disposer)
+ discard_pipeline (disposer);
+ }
+
struct pipeline_saver *
alloc_pipeline_saver ()
*** ../bash-4.4/jobs.h 2016-04-27 10:35:51.000000000 -0400
--- jobs.h 2016-11-02 18:25:08.000000000 -0400
***************
*** 191,194 ****
--- 191,195 ----
extern void stop_making_children __P((void));
extern void cleanup_the_pipeline __P((void));
+ extern void discard_last_procsub_child __P((void));
extern void save_pipeline __P((int));
extern PROCESS *restore_pipeline __P((int));
*** ../bash-4.4/subst.c 2016-08-30 16:46:38.000000000 -0400
--- subst.c 2016-11-02 18:23:24.000000000 -0400
***************
*** 5809,5816 ****
#if defined (JOB_CONTROL)
if (last_procsub_child)
! {
! discard_pipeline (last_procsub_child);
! last_procsub_child = (PROCESS *)NULL;
! }
last_procsub_child = restore_pipeline (0);
#endif
--- 5834,5838 ----
#if defined (JOB_CONTROL)
if (last_procsub_child)
! discard_last_procsub_child ();
last_procsub_child = restore_pipeline (0);
#endif
*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 3

#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 4

#endif /* _PATCHLEVEL_H_ */
47 changes: 47 additions & 0 deletions core-shells/bash/autobuild/patches/bash44-005
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
BASH PATCH REPORT
=================

Bash-Release: 4.4
Patch-ID: bash44-005

Bug-Reported-by: Dr. Werner Fink <werner@suse.de>
Bug-Reference-ID: <20161107100936.ajnojd7dspirdflf@noether.suse.de>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00054.html

Bug-Description:

Under certain circumstances, a simple command is optimized to eliminate a
fork, resulting in an EXIT trap not being executed.

Patch (apply with `patch -p0'):

*** ../bash-4.4/builtins/evalstring.c 2016-08-11 14:18:51.000000000 -0400
--- builtins/evalstring.c 2016-11-08 15:05:07.000000000 -0500
***************
*** 105,114 ****
*bash_input.location.string == '\0' &&
command->type == cm_simple &&
- #if 0
signal_is_trapped (EXIT_TRAP) == 0 &&
signal_is_trapped (ERROR_TRAP) == 0 &&
- #else
any_signals_trapped () < 0 &&
- #endif
command->redirects == 0 && command->value.Simple->redirects == 0 &&
((command->flags & CMD_TIME_PIPELINE) == 0) &&
--- 105,111 ----
*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 4

#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 5

#endif /* _PATCHLEVEL_H_ */
59 changes: 59 additions & 0 deletions core-shells/bash/autobuild/patches/bash44-006
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
BASH PATCH REPORT
=================

Bash-Release: 4.4
Patch-ID: bash44-006

Bug-Reported-by: <fernando@null-life.com>
Bug-Reference-ID: <CAEr-gPFPvqheiAeENmMkEwWRd4U=1iqCsYmR3sLdULOqL++_tQ@mail.gmail.com>
Bug-Reference-URL:

Bug-Description:

Out-of-range negative offsets to popd can cause the shell to crash attempting
to free an invalid memory block.

Patch (apply with `patch -p0'):

*** ../bash-4.4-patched/builtins/pushd.def 2016-01-25 13:31:49.000000000 -0500
--- builtins/pushd.def 2016-10-28 10:46:49.000000000 -0400
***************
*** 366,370 ****
}

! if (which > directory_list_offset || (directory_list_offset == 0 && which == 0))
{
pushd_error (directory_list_offset, which_word ? which_word : "");
--- 366,370 ----
}

! if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0))
{
pushd_error (directory_list_offset, which_word ? which_word : "");
***************
*** 388,391 ****
--- 388,396 ----
of the list into place. */
i = (direction == '+') ? directory_list_offset - which : which;
+ if (i < 0 || i > directory_list_offset)
+ {
+ pushd_error (directory_list_offset, which_word ? which_word : "");
+ return (EXECUTION_FAILURE);
+ }
free (pushd_directory_list[i]);
directory_list_offset--;
*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 5

#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */

! #define PATCHLEVEL 6

#endif /* _PATCHLEVEL_H_ */
Loading

0 comments on commit f6105ba

Please sign in to comment.