Bash: Update to 5.1.16

This is a maintenance release that bundles all the previously added
patches, which have therefore been deleted.

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Peter Müller
2022-08-03 10:34:45 +00:00
parent f22f1e21e9
commit 7ee41667d0
9 changed files with 3 additions and 608 deletions

View File

@@ -1,7 +1,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2021 IPFire Team <info@ipfire.org> #
# Copyright (C) 2007-2022 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -24,7 +24,7 @@
include Config
VER = 5.1.8
VER = 5.1.16
THISAPP = bash-$(VER)
DL_FILE = $(THISAPP).tar.gz
@@ -53,7 +53,7 @@ objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_BLAKE2 = c61f70cef51b6576254a8cbdfbc69904c9e9ebefb061f03c719e35ac2aa3b497e654f78514ffd6e6c74cd546de917a6cfae1e643bf7b8aec88f154b2c97b9090
$(DL_FILE)_BLAKE2 = 0bc53b24d9b95cd85e45196510104acf6ac6c980f68aedcc83c8409ce6a4682e92736a9cbe089ed92d74590e28918d0bee0e67c8e0f994bd37e45fad83f5b48e
install : $(TARGET)
@@ -87,10 +87,6 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
sed -e "s/filename, RTLD_LAZY/filename, RTLD_NOW/" \
-i $(DIR_APP)/builtins/enable.def
for i in $$(seq 9 16); do \
cd $(DIR_APP) && patch -Np0 < $(DIR_SRC)/src/patches/bash/bash51-$$(printf "%03d" "$${i}") || exit 1; \
done
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bash/bash-4.0-paths-1.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bash/bash-4.0-profile-1.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/bash/bash-3.2-ssh_source_bash.patch

View File

@@ -1,59 +0,0 @@
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_ */

View File

@@ -1,59 +0,0 @@
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_ */

View File

@@ -1,81 +0,0 @@
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_ */

View File

@@ -1,198 +0,0 @@
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_ */

View File

@@ -1,43 +0,0 @@
BASH PATCH REPORT
=================
Bash-Release: 5.1
Patch-ID: bash51-013
Bug-Reported-by: Anders Kaseorg <andersk@mit.edu>
Bug-Reference-ID: <de65540274064d7b95f17e9c46a3a6d8@oc11expo7.exchange.mit.edu>
Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2021-11/msg00025.html
Bug-Description:
Bash did not always perform tilde expansion following an unquoted colon on
the rhs of an assignment statement in posix mode.
Patch (apply with `patch -p0'):
*** ../bash-20211028/subst.c 2021-10-18 16:09:58.000000000 -0400
--- subst.c 2021-11-30 11:19:47.000000000 -0500
***************
*** 3826,3829 ****
--- 3826,3830 ----
td.flags = W_ASSIGNRHS;
#endif
+ td.flags |= (W_NOGLOB|W_TILDEEXP);
td.word = savestring (string);
value = call_expand_word_internal (&td, quoted, 0, (int *)NULL, (int *)NULL);
*** ../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 12
#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */
! #define PATCHLEVEL 13
#endif /* _PATCHLEVEL_H_ */

View File

@@ -1,48 +0,0 @@
BASH PATCH REPORT
=================
Bash-Release: 5.1
Patch-ID: bash51-014
Bug-Reported-by: platon7pronko@gmail.com
Bug-Reference-ID:
Bug-Reference-URL: https://savannah.gnu.org/patch/?10035
Bug-Description:
Bash may produce corrupted input if a multibyte character spans a 512-byte
boundary while reading the output of a command substitution.
Patch (apply with `patch -p0'):
*** ../bash-20210217/subst.c 2021-02-03 10:32:08.000000000 -0500
--- subst.c 2021-03-01 16:47:52.000000000 -0500
***************
*** 6243,6247 ****
/* punt on the hard case for now */
memset (&ps, '\0', sizeof (mbstate_t));
! mblen = mbrtowc (&wc, bufp-1, bufn+1, &ps);
if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1)
istring[istring_index++] = c;
--- 6243,6247 ----
/* punt on the hard case for now */
memset (&ps, '\0', sizeof (mbstate_t));
! mblen = mbrtowc (&wc, bufp-1, bufn, &ps);
if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1)
istring[istring_index++] = c;
*** ../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 13
#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */
! #define PATCHLEVEL 14
#endif /* _PATCHLEVEL_H_ */

View File

@@ -1,49 +0,0 @@
BASH PATCH REPORT
=================
Bash-Release: 5.1
Patch-ID: bash51-015
Bug-Reported-by: Volodymyr Prodan <vovcat@gmail.com>
Bug-Reference-ID:
Bug-Reference-URL: https://savannah.gnu.org/patch/?10076
Bug-Description:
Patch (apply with `patch -p0'):
There are some characters (e.g., cyrillic) that can't be displayed using
certain single-byte encodings (e.g., cp1251) because the negative signed
int is interpreted as EOF and not displayed.
*** ../bash-20210524/lib/readline/display.c 2021-03-16 18:12:20.000000000 -0400
--- lib/readline/display.c 2021-06-07 16:53:08.000000000 -0400
***************
*** 1599,1603 ****
for (cur_face = FACE_NORMAL, i = 0; i < n; i++)
! putc_face (str[i], face[i], &cur_face);
putc_face (EOF, FACE_NORMAL, &cur_face);
}
--- 1599,1603 ----
for (cur_face = FACE_NORMAL, i = 0; i < n; i++)
! putc_face ((unsigned char) str[i], face[i], &cur_face);
putc_face (EOF, FACE_NORMAL, &cur_face);
}
*** ../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 14
#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */
! #define PATCHLEVEL 15
#endif /* _PATCHLEVEL_H_ */

View File

@@ -1,64 +0,0 @@
BASH PATCH REPORT
=================
Bash-Release: 5.1
Patch-ID: bash51-016
Bug-Reported-by: Vincent Menegaux <vincent.menegaux@gmail.com>
Bug-Reference-ID:
Bug-Reference-URL: https://savannah.gnu.org/patch/?10070
Bug-Description:
Multiple `!' tokens should toggle negation of an expression in a [[
conditional command, instead of simply negating the expression.
Patch (apply with `patch -p0'):
*** ../bash-20210515/parse.y 2021-04-21 15:32:50.000000000 -0400
--- parse.y 2021-05-24 11:53:30.000000000 -0400
***************
*** 4797,4801 ****
term = cond_term ();
if (term)
! term->flags |= CMD_INVERT_RETURN;
}
else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word))
--- 4797,4801 ----
term = cond_term ();
if (term)
! term->flags ^= CMD_INVERT_RETURN;
}
else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word))
*** ../bash-20210515/y.tab.c 2021-05-14 15:50:41.000000000 -0400
--- y.tab.c 2021-05-24 16:35:55.000000000 -0400
***************
*** 7091,7095 ****
term = cond_term ();
if (term)
! term->flags |= CMD_INVERT_RETURN;
}
else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word))
--- 7091,7095 ----
term = cond_term ();
if (term)
! term->flags ^= CMD_INVERT_RETURN;
}
else if (tok == WORD && yylval.word->word[0] == '-' && yylval.word->word[1] && yylval.word->word[2] == 0 && test_unop (yylval.word->word))
*** ../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 15
#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */
! #define PATCHLEVEL 16
#endif /* _PATCHLEVEL_H_ */