Update to bash-5.2 patchlevel 15
Also fix an issue with dates not being in chronological order in changelog. Resolves: #2152991
This commit is contained in:
parent
56ed8fdb9a
commit
aaec1fbc68
@ -27,3 +27,15 @@ diff --git a/general.c b/general.c
|
||||
return (0);
|
||||
if (c == '\0')
|
||||
return (1);
|
||||
diff --git a/patchlevel.h b/patchlevel.h
|
||||
index e59027ac..9ddc79f7 100644
|
||||
--- a/patchlevel.h
|
||||
+++ b/patchlevel.h
|
||||
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
-#define PATCHLEVEL 9
|
||||
+#define PATCHLEVEL 10
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
25
bash-5.2-patch-11.patch
Normal file
25
bash-5.2-patch-11.patch
Normal file
@ -0,0 +1,25 @@
|
||||
diff --git a/builtins/read.def b/builtins/read.def
|
||||
--- a/builtins/read.def
|
||||
+++ b/builtins/read.def
|
||||
@@ -167,6 +167,9 @@ reset_timeout ()
|
||||
/* Cancel alarm before restoring signal handler. */
|
||||
if (read_timeout)
|
||||
shtimer_clear (read_timeout);
|
||||
+#if defined (READLINE)
|
||||
+ rl_clear_timeout ();
|
||||
+#endif
|
||||
read_timeout = 0;
|
||||
}
|
||||
|
||||
diff --git a/patchlevel.h b/patchlevel.h
|
||||
index 9ddc79f7..9ff902a0 100644
|
||||
--- a/patchlevel.h
|
||||
+++ b/patchlevel.h
|
||||
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
-#define PATCHLEVEL 10
|
||||
+#define PATCHLEVEL 11
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
268
bash-5.2-patch-12.patch
Normal file
268
bash-5.2-patch-12.patch
Normal file
@ -0,0 +1,268 @@
|
||||
diff --git a/builtins/common.h b/builtins/common.h
|
||||
--- a/builtins/common.h
|
||||
+++ b/builtins/common.h
|
||||
@@ -257,6 +257,10 @@ extern int print_shift_error;
|
||||
extern int expand_once_flag;
|
||||
#endif
|
||||
|
||||
+#if defined (EXTENDED_GLOB)
|
||||
+extern int extglob_flag;
|
||||
+#endif
|
||||
+
|
||||
extern int expaliases_flag;
|
||||
|
||||
/* variables from source.def */
|
||||
diff --git a/builtins/shopt.def b/builtins/shopt.def
|
||||
--- a/builtins/shopt.def
|
||||
+++ b/builtins/shopt.def
|
||||
@@ -149,6 +149,11 @@ static int shopt_set_complete_direxpand PARAMS((char *, int));
|
||||
static int set_assoc_expand PARAMS((char *, int));
|
||||
#endif
|
||||
|
||||
+#if defined (EXTENDED_GLOB)
|
||||
+int extglob_flag = EXTGLOB_DEFAULT;
|
||||
+static int shopt_set_extglob PARAMS((char *, int));
|
||||
+#endif
|
||||
+
|
||||
int expaliases_flag = 0;
|
||||
static int shopt_set_expaliases PARAMS((char *, int));
|
||||
|
||||
@@ -206,7 +211,7 @@ static struct {
|
||||
{ "extdebug", &debugging_mode, shopt_set_debug_mode },
|
||||
#endif
|
||||
#if defined (EXTENDED_GLOB)
|
||||
- { "extglob", &extended_glob, (shopt_set_func_t *)NULL },
|
||||
+ { "extglob", &extglob_flag, shopt_set_extglob },
|
||||
#endif
|
||||
{ "extquote", &extended_quote, (shopt_set_func_t *)NULL },
|
||||
{ "failglob", &fail_glob_expansion, (shopt_set_func_t *)NULL },
|
||||
@@ -377,7 +382,7 @@ reset_shopt_options ()
|
||||
#endif
|
||||
|
||||
#if defined (EXTENDED_GLOB)
|
||||
- extended_glob = EXTGLOB_DEFAULT;
|
||||
+ extended_glob = extglob_flag = EXTGLOB_DEFAULT;
|
||||
#endif
|
||||
|
||||
#if defined (ARRAY_VARS)
|
||||
@@ -643,6 +648,17 @@ shopt_set_expaliases (option_name, mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#if defined (EXTENDED_GLOB)
|
||||
+static int
|
||||
+shopt_set_extglob (option_name, mode)
|
||||
+ char *option_name;
|
||||
+ int mode;
|
||||
+{
|
||||
+ extended_glob = extglob_flag;
|
||||
+ return 0;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
#if defined (READLINE)
|
||||
static int
|
||||
shopt_enable_hostname_completion (option_name, mode)
|
||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
||||
--- a/execute_cmd.c
|
||||
+++ b/execute_cmd.c
|
||||
@@ -3990,13 +3990,11 @@ execute_cond_node (cond)
|
||||
else
|
||||
#endif /* COND_REGEXP */
|
||||
{
|
||||
- int oe;
|
||||
- oe = extended_glob;
|
||||
extended_glob = 1;
|
||||
result = binary_test (cond->op->word, arg1, arg2, TEST_PATMATCH|TEST_ARITHEXP|TEST_LOCALE)
|
||||
? EXECUTION_SUCCESS
|
||||
: EXECUTION_FAILURE;
|
||||
- extended_glob = oe;
|
||||
+ extended_glob = extglob_flag;
|
||||
}
|
||||
if (arg1 != nullstr)
|
||||
free (arg1);
|
||||
diff --git a/parse.y b/parse.y
|
||||
--- a/parse.y
|
||||
+++ b/parse.y
|
||||
@@ -125,7 +125,7 @@ do { \
|
||||
} while (0)
|
||||
|
||||
#if defined (EXTENDED_GLOB)
|
||||
-extern int extended_glob;
|
||||
+extern int extended_glob, extglob_flag;
|
||||
#endif
|
||||
|
||||
#if defined (TRANSLATABLE_STRINGS)
|
||||
@@ -3304,7 +3304,7 @@ reset_parser ()
|
||||
#if defined (EXTENDED_GLOB)
|
||||
/* Reset to global value of extended glob */
|
||||
if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
|
||||
- extended_glob = global_extglob;
|
||||
+ extended_glob = extglob_flag;
|
||||
#endif
|
||||
if (parser_state & (PST_CMDSUBST|PST_STRING))
|
||||
expand_aliases = expaliases_flag;
|
||||
@@ -4124,10 +4124,10 @@ parse_comsub (qc, open, close, lenp, flags)
|
||||
expand_aliases = posixly_correct != 0;
|
||||
#if defined (EXTENDED_GLOB)
|
||||
/* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
|
||||
- conditional command and have already set global_extglob appropriately. */
|
||||
+ conditional command and have already set extended_glob appropriately. */
|
||||
if (shell_compatibility_level <= 51 && was_extpat == 0)
|
||||
{
|
||||
- local_extglob = global_extglob = extended_glob;
|
||||
+ local_extglob = extended_glob;
|
||||
extended_glob = 1;
|
||||
}
|
||||
#endif
|
||||
@@ -4235,7 +4235,7 @@ xparse_dolparen (base, string, indp, flags)
|
||||
{
|
||||
sh_parser_state_t ps;
|
||||
sh_input_line_state_t ls;
|
||||
- int orig_ind, nc, sflags, start_lineno;
|
||||
+ int orig_ind, nc, sflags, start_lineno, local_extglob;
|
||||
char *ret, *ep, *ostring;
|
||||
|
||||
/*debug_parser(1);*/
|
||||
@@ -4278,7 +4278,7 @@ xparse_dolparen (base, string, indp, flags)
|
||||
old value will be restored by restore_parser_state(). */
|
||||
expand_aliases = 0;
|
||||
#if defined (EXTENDED_GLOB)
|
||||
- global_extglob = extended_glob; /* for reset_parser() */
|
||||
+ local_extglob = extended_glob;
|
||||
#endif
|
||||
|
||||
token_to_read = DOLPAREN; /* let's trick the parser */
|
||||
@@ -4296,6 +4296,9 @@ xparse_dolparen (base, string, indp, flags)
|
||||
restore_input_line_state (&ls);
|
||||
restore_parser_state (&ps);
|
||||
|
||||
+#if defined (EXTENDED_GLOB)
|
||||
+ extended_glob = local_extglob;
|
||||
+#endif
|
||||
token_to_read = 0;
|
||||
|
||||
/* If parse_string returns < 0, we need to jump to top level with the
|
||||
@@ -4731,12 +4734,16 @@ cond_term ()
|
||||
}
|
||||
|
||||
/* rhs */
|
||||
+#if defined (EXTENDED_GLOB)
|
||||
local_extglob = extended_glob;
|
||||
if (parser_state & PST_EXTPAT)
|
||||
extended_glob = 1;
|
||||
+#endif
|
||||
tok = read_token (READ);
|
||||
+#if defined (EXTENDED_GLOB)
|
||||
if (parser_state & PST_EXTPAT)
|
||||
extended_glob = local_extglob;
|
||||
+#endif
|
||||
parser_state &= ~(PST_REGEXP|PST_EXTPAT);
|
||||
|
||||
if (tok == WORD)
|
||||
@@ -4783,7 +4790,6 @@ parse_cond_command ()
|
||||
{
|
||||
COND_COM *cexp;
|
||||
|
||||
- global_extglob = extended_glob;
|
||||
cexp = cond_expr ();
|
||||
return (make_cond_command (cexp));
|
||||
}
|
||||
diff --git a/patchlevel.h b/patchlevel.h
|
||||
--- a/patchlevel.h
|
||||
+++ b/patchlevel.h
|
||||
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
-#define PATCHLEVEL 11
|
||||
+#define PATCHLEVEL 12
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
diff --git a/y.tab.c b/y.tab.c
|
||||
--- a/y.tab.c
|
||||
+++ b/y.tab.c
|
||||
@@ -175,7 +175,7 @@ do { \
|
||||
} while (0)
|
||||
|
||||
#if defined (EXTENDED_GLOB)
|
||||
-extern int extended_glob;
|
||||
+extern int extended_glob, extglob_flag;
|
||||
#endif
|
||||
|
||||
#if defined (TRANSLATABLE_STRINGS)
|
||||
@@ -5615,7 +5615,7 @@ reset_parser ()
|
||||
#if defined (EXTENDED_GLOB)
|
||||
/* Reset to global value of extended glob */
|
||||
if (parser_state & (PST_EXTPAT|PST_CMDSUBST))
|
||||
- extended_glob = global_extglob;
|
||||
+ extended_glob = extglob_flag;
|
||||
#endif
|
||||
if (parser_state & (PST_CMDSUBST|PST_STRING))
|
||||
expand_aliases = expaliases_flag;
|
||||
@@ -6435,10 +6435,10 @@ parse_comsub (qc, open, close, lenp, flags)
|
||||
expand_aliases = posixly_correct != 0;
|
||||
#if defined (EXTENDED_GLOB)
|
||||
/* If (parser_state & PST_EXTPAT), we're parsing an extended pattern for a
|
||||
- conditional command and have already set global_extglob appropriately. */
|
||||
+ conditional command and have already set extended_glob appropriately. */
|
||||
if (shell_compatibility_level <= 51 && was_extpat == 0)
|
||||
{
|
||||
- local_extglob = global_extglob = extended_glob;
|
||||
+ local_extglob = extended_glob;
|
||||
extended_glob = 1;
|
||||
}
|
||||
#endif
|
||||
@@ -6546,7 +6546,7 @@ xparse_dolparen (base, string, indp, flags)
|
||||
{
|
||||
sh_parser_state_t ps;
|
||||
sh_input_line_state_t ls;
|
||||
- int orig_ind, nc, sflags, start_lineno;
|
||||
+ int orig_ind, nc, sflags, start_lineno, local_extglob;
|
||||
char *ret, *ep, *ostring;
|
||||
|
||||
/*debug_parser(1);*/
|
||||
@@ -6589,7 +6589,7 @@ xparse_dolparen (base, string, indp, flags)
|
||||
old value will be restored by restore_parser_state(). */
|
||||
expand_aliases = 0;
|
||||
#if defined (EXTENDED_GLOB)
|
||||
- global_extglob = extended_glob; /* for reset_parser() */
|
||||
+ local_extglob = extended_glob;
|
||||
#endif
|
||||
|
||||
token_to_read = DOLPAREN; /* let's trick the parser */
|
||||
@@ -6607,6 +6607,9 @@ xparse_dolparen (base, string, indp, flags)
|
||||
restore_input_line_state (&ls);
|
||||
restore_parser_state (&ps);
|
||||
|
||||
+#if defined (EXTENDED_GLOB)
|
||||
+ extended_glob = local_extglob;
|
||||
+#endif
|
||||
token_to_read = 0;
|
||||
|
||||
/* If parse_string returns < 0, we need to jump to top level with the
|
||||
@@ -7042,12 +7045,16 @@ cond_term ()
|
||||
}
|
||||
|
||||
/* rhs */
|
||||
+#if defined (EXTENDED_GLOB)
|
||||
local_extglob = extended_glob;
|
||||
if (parser_state & PST_EXTPAT)
|
||||
extended_glob = 1;
|
||||
+#endif
|
||||
tok = read_token (READ);
|
||||
+#if defined (EXTENDED_GLOB)
|
||||
if (parser_state & PST_EXTPAT)
|
||||
extended_glob = local_extglob;
|
||||
+#endif
|
||||
parser_state &= ~(PST_REGEXP|PST_EXTPAT);
|
||||
|
||||
if (tok == WORD)
|
||||
@@ -7094,7 +7101,6 @@ parse_cond_command ()
|
||||
{
|
||||
COND_COM *cexp;
|
||||
|
||||
- global_extglob = extended_glob;
|
||||
cexp = cond_expr ();
|
||||
return (make_cond_command (cexp));
|
||||
}
|
34
bash-5.2-patch-13.patch
Normal file
34
bash-5.2-patch-13.patch
Normal file
@ -0,0 +1,34 @@
|
||||
diff --git a/patchlevel.h b/patchlevel.h
|
||||
--- a/patchlevel.h
|
||||
+++ b/patchlevel.h
|
||||
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
-#define PATCHLEVEL 12
|
||||
+#define PATCHLEVEL 13
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
diff --git a/subst.c b/subst.c
|
||||
--- a/subst.c
|
||||
+++ b/subst.c
|
||||
@@ -7497,8 +7497,6 @@ expand_arrayref:
|
||||
? quote_string (temp)
|
||||
: quote_escapes (temp);
|
||||
rflags |= W_ARRAYIND;
|
||||
- if (estatep)
|
||||
- *estatep = es; /* structure copy */
|
||||
}
|
||||
/* Note that array[*] and array[@] expanded to a quoted null string by
|
||||
returning the W_HASQUOTEDNULL flag to the caller in addition to TEMP. */
|
||||
@@ -7507,7 +7505,9 @@ expand_arrayref:
|
||||
else if (es.subtype == 2 && temp && QUOTED_NULL (temp) && (quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)))
|
||||
rflags |= W_HASQUOTEDNULL;
|
||||
|
||||
- if (estatep == 0)
|
||||
+ if (estatep)
|
||||
+ *estatep = es; /* structure copy */
|
||||
+ else
|
||||
flush_eltstate (&es);
|
||||
}
|
||||
#endif
|
93
bash-5.2-patch-14.patch
Normal file
93
bash-5.2-patch-14.patch
Normal file
@ -0,0 +1,93 @@
|
||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
||||
--- a/execute_cmd.c
|
||||
+++ b/execute_cmd.c
|
||||
@@ -3624,6 +3624,7 @@ execute_case_command (case_command)
|
||||
free (pattern);
|
||||
|
||||
dispose_words (es);
|
||||
+ QUIT;
|
||||
|
||||
if (match)
|
||||
{
|
||||
diff --git a/patchlevel.h b/patchlevel.h
|
||||
--- a/patchlevel.h
|
||||
+++ b/patchlevel.h
|
||||
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
-#define PATCHLEVEL 13
|
||||
+#define PATCHLEVEL 14
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
diff --git a/sig.c b/sig.c
|
||||
--- a/sig.c
|
||||
+++ b/sig.c
|
||||
@@ -94,6 +94,7 @@ static SigHandler *old_winch = (SigHandler *)SIG_DFL;
|
||||
#endif
|
||||
|
||||
static void initialize_shell_signals PARAMS((void));
|
||||
+static void kill_shell PARAMS((int));
|
||||
|
||||
void
|
||||
initialize_signals (reinit)
|
||||
@@ -486,6 +487,8 @@ restore_sigmask ()
|
||||
#endif
|
||||
}
|
||||
|
||||
+static int handling_termsig = 0;
|
||||
+
|
||||
sighandler
|
||||
termsig_sighandler (sig)
|
||||
int sig;
|
||||
@@ -532,6 +535,14 @@ termsig_sighandler (sig)
|
||||
sig == terminating_signal)
|
||||
terminate_immediately = 1;
|
||||
|
||||
+ /* If we are currently handling a terminating signal, we have a couple of
|
||||
+ choices here. We can ignore this second terminating signal and let the
|
||||
+ shell exit from the first one, or we can exit immediately by killing
|
||||
+ the shell with this signal. This code implements the latter; to implement
|
||||
+ the former, replace the kill_shell(sig) with return. */
|
||||
+ if (handling_termsig)
|
||||
+ kill_shell (sig); /* just short-circuit now */
|
||||
+
|
||||
terminating_signal = sig;
|
||||
|
||||
if (terminate_immediately)
|
||||
@@ -564,16 +575,13 @@ void
|
||||
termsig_handler (sig)
|
||||
int sig;
|
||||
{
|
||||
- static int handling_termsig = 0;
|
||||
- int i, core;
|
||||
- sigset_t mask;
|
||||
-
|
||||
/* Simple semaphore to keep this function from being executed multiple
|
||||
times. Since we no longer are running as a signal handler, we don't
|
||||
block multiple occurrences of the terminating signals while running. */
|
||||
if (handling_termsig)
|
||||
return;
|
||||
- handling_termsig = 1;
|
||||
+
|
||||
+ handling_termsig = terminating_signal; /* for termsig_sighandler */
|
||||
terminating_signal = 0; /* keep macro from re-testing true. */
|
||||
|
||||
/* I don't believe this condition ever tests true. */
|
||||
@@ -613,6 +621,16 @@ termsig_handler (sig)
|
||||
|
||||
run_exit_trap (); /* XXX - run exit trap possibly in signal context? */
|
||||
|
||||
+ kill_shell (sig);
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+kill_shell (sig)
|
||||
+ int sig;
|
||||
+{
|
||||
+ int i, core;
|
||||
+ sigset_t mask;
|
||||
+
|
||||
/* We don't change the set of blocked signals. If a user starts the shell
|
||||
with a terminating signal blocked, we won't get here (and if by some
|
||||
magic chance we do, we'll exit below). What we do is to restore the
|
163
bash-5.2-patch-15.patch
Normal file
163
bash-5.2-patch-15.patch
Normal file
@ -0,0 +1,163 @@
|
||||
diff --git a/builtins/common.h b/builtins/common.h
|
||||
--- a/builtins/common.h
|
||||
+++ b/builtins/common.h
|
||||
@@ -51,6 +51,7 @@ do { \
|
||||
#define SEVAL_FUNCDEF 0x080 /* only allow function definitions */
|
||||
#define SEVAL_ONECMD 0x100 /* only allow a single command */
|
||||
#define SEVAL_NOHISTEXP 0x200 /* inhibit history expansion */
|
||||
+#define SEVAL_NOOPTIMIZE 0x400 /* don't try to set optimization flags */
|
||||
|
||||
/* Flags for describe_command, shared between type.def and command.def */
|
||||
#define CDESC_ALL 0x001 /* type -a */
|
||||
diff --git a/builtins/eval.def b/builtins/eval.def
|
||||
--- a/builtins/eval.def
|
||||
+++ b/builtins/eval.def
|
||||
@@ -53,5 +53,5 @@ eval_builtin (list)
|
||||
return (EX_USAGE);
|
||||
list = loptend; /* skip over possible `--' */
|
||||
|
||||
- return (list ? evalstring (string_list (list), "eval", SEVAL_NOHIST) : EXECUTION_SUCCESS);
|
||||
+ return (list ? evalstring (string_list (list), "eval", SEVAL_NOHIST|SEVAL_NOOPTIMIZE) : EXECUTION_SUCCESS);
|
||||
}
|
||||
diff --git a/builtins/evalstring.c b/builtins/evalstring.c
|
||||
--- a/builtins/evalstring.c
|
||||
+++ b/builtins/evalstring.c
|
||||
@@ -132,8 +132,8 @@ optimize_connection_fork (command)
|
||||
if (command->type == cm_connection &&
|
||||
(command->value.Connection->connector == AND_AND || command->value.Connection->connector == OR_OR || command->value.Connection->connector == ';') &&
|
||||
(command->value.Connection->second->flags & CMD_TRY_OPTIMIZING) &&
|
||||
- ((startup_state == 2 && should_suppress_fork (command->value.Connection->second)) ||
|
||||
- ((subshell_environment & SUBSHELL_PAREN) && should_optimize_fork (command->value.Connection->second, 0))))
|
||||
+ (should_suppress_fork (command->value.Connection->second) ||
|
||||
+ ((subshell_environment & SUBSHELL_PAREN) && should_optimize_fork (command->value.Connection->second, 0))))
|
||||
{
|
||||
command->value.Connection->second->flags |= CMD_NO_FORK;
|
||||
command->value.Connection->second->value.Simple->flags |= CMD_NO_FORK;
|
||||
@@ -290,6 +290,7 @@ parse_prologue (string, flags, tag)
|
||||
(flags & SEVAL_NOFREE) -> don't free STRING when finished
|
||||
(flags & SEVAL_RESETLINE) -> reset line_number to 1
|
||||
(flags & SEVAL_NOHISTEXP) -> history_expansion_inhibited -> 1
|
||||
+ (flags & SEVAL_NOOPTIMIZE) -> don't try to turn on optimizing flags
|
||||
*/
|
||||
|
||||
int
|
||||
@@ -502,7 +503,9 @@ parse_and_execute (string, from_file, flags)
|
||||
if we are at the end of the command string, the last in a
|
||||
series of connection commands is
|
||||
command->value.Connection->second. */
|
||||
- else if (command->type == cm_connection && can_optimize_connection (command))
|
||||
+ else if (command->type == cm_connection &&
|
||||
+ (flags & SEVAL_NOOPTIMIZE) == 0 &&
|
||||
+ can_optimize_connection (command))
|
||||
{
|
||||
command->value.Connection->second->flags |= CMD_TRY_OPTIMIZING;
|
||||
command->value.Connection->second->value.Simple->flags |= CMD_TRY_OPTIMIZING;
|
||||
diff --git a/execute_cmd.c b/execute_cmd.c
|
||||
--- a/execute_cmd.c
|
||||
+++ b/execute_cmd.c
|
||||
@@ -1654,7 +1654,8 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
|
||||
subshell sets an exit trap, so we set CMD_NO_FORK for simple commands
|
||||
and set CMD_TRY_OPTIMIZING for simple commands on the right side of an
|
||||
and-or or `;' list to test for optimizing forks when they are executed. */
|
||||
- if (user_subshell && command->type == cm_subshell)
|
||||
+ if (user_subshell && command->type == cm_subshell &&
|
||||
+ (command->flags & (CMD_TIME_PIPELINE|CMD_INVERT_RETURN)) == 0)
|
||||
optimize_subshell_command (command->value.Subshell->command);
|
||||
|
||||
/* Do redirections, then dispose of them before recursive call. */
|
||||
diff --git a/jobs.c b/jobs.c
|
||||
--- a/jobs.c
|
||||
+++ b/jobs.c
|
||||
@@ -4220,7 +4220,7 @@ run_sigchld_trap (nchild)
|
||||
jobs_list_frozen = 1;
|
||||
for (i = 0; i < nchild; i++)
|
||||
{
|
||||
- parse_and_execute (savestring (trap_command), "trap", SEVAL_NOHIST|SEVAL_RESETLINE);
|
||||
+ parse_and_execute (savestring (trap_command), "trap", SEVAL_NOHIST|SEVAL_RESETLINE|SEVAL_NOOPTIMIZE);
|
||||
}
|
||||
|
||||
run_unwind_frame ("SIGCHLD trap");
|
||||
diff --git a/parse.y b/parse.y
|
||||
--- a/parse.y
|
||||
+++ b/parse.y
|
||||
@@ -2827,7 +2827,7 @@ execute_variable_command (command, vname)
|
||||
if (last_lastarg)
|
||||
last_lastarg = savestring (last_lastarg);
|
||||
|
||||
- parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST);
|
||||
+ parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOOPTIMIZE);
|
||||
|
||||
restore_parser_state (&ps);
|
||||
bind_variable ("_", last_lastarg, 0);
|
||||
diff --git a/patchlevel.h b/patchlevel.h
|
||||
--- a/patchlevel.h
|
||||
+++ b/patchlevel.h
|
||||
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
-#define PATCHLEVEL 14
|
||||
+#define PATCHLEVEL 15
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
diff --git a/trap.c b/trap.c
|
||||
--- a/trap.c
|
||||
+++ b/trap.c
|
||||
@@ -304,6 +304,7 @@ run_pending_traps ()
|
||||
sh_parser_state_t pstate;
|
||||
volatile int save_return_catch_flag, function_code;
|
||||
procenv_t save_return_catch;
|
||||
+ char *trap_command, *old_trap;
|
||||
#if defined (ARRAY_VARS)
|
||||
ARRAY *ps;
|
||||
#endif
|
||||
@@ -419,6 +420,9 @@ run_pending_traps ()
|
||||
}
|
||||
else
|
||||
{
|
||||
+ old_trap = trap_list[sig];
|
||||
+ trap_command = savestring (old_trap);
|
||||
+
|
||||
save_parser_state (&pstate);
|
||||
save_subst_varlist = subst_assign_varlist;
|
||||
subst_assign_varlist = 0;
|
||||
@@ -441,7 +445,8 @@ run_pending_traps ()
|
||||
}
|
||||
|
||||
if (function_code == 0)
|
||||
- x = parse_and_execute (savestring (trap_list[sig]), "trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE);
|
||||
+ /* XXX is x always last_command_exit_value? */
|
||||
+ x = parse_and_execute (trap_command, "trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE|SEVAL_NOOPTIMIZE);
|
||||
else
|
||||
{
|
||||
parse_and_execute_cleanup (sig + 1); /* XXX - could use -1 */
|
||||
@@ -1002,7 +1007,7 @@ run_exit_trap ()
|
||||
if (code == 0 && function_code == 0)
|
||||
{
|
||||
reset_parser ();
|
||||
- parse_and_execute (trap_command, "exit trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE);
|
||||
+ parse_and_execute (trap_command, "exit trap", SEVAL_NONINT|SEVAL_NOHIST|SEVAL_RESETLINE|SEVAL_NOOPTIMIZE);
|
||||
}
|
||||
else if (code == ERREXIT)
|
||||
retval = last_command_exit_value;
|
||||
@@ -1109,7 +1114,7 @@ _run_trap_internal (sig, tag)
|
||||
function_code = setjmp_nosigs (return_catch);
|
||||
}
|
||||
|
||||
- flags = SEVAL_NONINT|SEVAL_NOHIST;
|
||||
+ flags = SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOOPTIMIZE;
|
||||
if (sig != DEBUG_TRAP && sig != RETURN_TRAP && sig != ERROR_TRAP)
|
||||
flags |= SEVAL_RESETLINE;
|
||||
evalnest++;
|
||||
diff --git a/y.tab.c b/y.tab.c
|
||||
--- a/y.tab.c
|
||||
+++ b/y.tab.c
|
||||
@@ -5138,7 +5138,7 @@ execute_variable_command (command, vname)
|
||||
if (last_lastarg)
|
||||
last_lastarg = savestring (last_lastarg);
|
||||
|
||||
- parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST);
|
||||
+ parse_and_execute (savestring (command), vname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_NOOPTIMIZE);
|
||||
|
||||
restore_parser_state (&ps);
|
||||
bind_variable ("_", last_lastarg, 0);
|
14
bash.spec
14
bash.spec
@ -1,12 +1,12 @@
|
||||
#% define beta_tag rc2
|
||||
%define patchlevel 9
|
||||
%define patchlevel 15
|
||||
%define baseversion 5.2
|
||||
%bcond_without tests
|
||||
|
||||
Version: %{baseversion}.%{patchlevel}
|
||||
Name: bash
|
||||
Summary: The GNU Bourne Again shell
|
||||
Release: 3%{?dist}
|
||||
Release: 1%{?dist}
|
||||
License: GPLv3+
|
||||
Url: https://www.gnu.org/software/bash
|
||||
Source0: https://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz
|
||||
@ -87,10 +87,6 @@ Patch127: bash-4.4-no-loadable-builtins.patch
|
||||
# This option is undocumented in upstream and is documented by this patch
|
||||
Patch128: bash-5.0-syslog-history.patch
|
||||
|
||||
# 2135537 - Bash no longer executed a binary executable shell-script
|
||||
# This patch should be removed during next rebase
|
||||
Patch129: bash-5.2-file-detection.patch
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: texinfo bison
|
||||
BuildRequires: ncurses-devel
|
||||
@ -322,7 +318,11 @@ end
|
||||
%{_libdir}/pkgconfig/%{name}.pc
|
||||
|
||||
%changelog
|
||||
* Tue Nov 01 2022 Debarshi Ray <rishi@fedoraproject.org> - 5.2.9-3
|
||||
* Mon Jan 02 2023 Siteshwar Vashisht <svashisht@redhat.com> - 5.2.15-1
|
||||
- Update to bash-5.2 patchlevel 15
|
||||
Resolves: #2152991
|
||||
|
||||
* Fri Nov 18 2022 Debarshi Ray <rishi@fedoraproject.org> - 5.2.9-3
|
||||
- Override STANDARD_UTILS_PATH in the same way as DEFAULT_PATH_VALUE
|
||||
Related: #2132363
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user