bash ver. bump

This commit is contained in:
Rmys
2022-12-16 16:52:51 +03:00
parent 788d3bd825
commit 051b5be9c5
22 changed files with 1916 additions and 88 deletions
@@ -1,11 +1,12 @@
--- bash-2.05b/aclocal.m4.pgrp_sync 2002-06-25 14:45:43.000000000 +0100
+++ bash-2.05b/aclocal.m4 2003-01-15 18:17:35.000000000 +0000
@@ -1255,7 +1255,7 @@
diff --git a/aclocal.m4 b/aclocal.m4
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1324,7 +1324,7 @@ main()
wait(&status);
exit(ok ? 0 : 5);
}
-], bash_cv_pgrp_pipe=no,bash_cv_pgrp_pipe=yes,
+], bash_cv_pgrp_pipe=yes,bash_cv_pgrp_pipe=yes,
-]])], [bash_cv_pgrp_pipe=no], [bash_cv_pgrp_pipe=yes],
+]])], [bash_cv_pgrp_pipe=yes], [bash_cv_pgrp_pipe=yes],
[AC_MSG_WARN(cannot check pgrp synchronization if cross compiling -- defaulting to no)
bash_cv_pgrp_pipe=no])
])
bash_cv_pgrp_pipe=no]
)])
@@ -1,18 +1,18 @@
diff -up bash-4.1/examples/loadables/Makefile.in.examples bash-4.1/examples/loadables/Makefile.in
--- bash-4.1/examples/loadables/Makefile.in.examples 2010-06-22 16:20:02.000000000 +0200
+++ bash-4.1/examples/loadables/Makefile.in 2010-06-22 16:20:41.000000000 +0200
@@ -43,7 +43,7 @@ host_os = @host_os@
host_cpu = @host_cpu@
diff --git a/examples/loadables/Makefile.in b/examples/loadables/Makefile.in
--- a/examples/loadables/Makefile.in
+++ b/examples/loadables/Makefile.in
@@ -59,7 +59,7 @@ host_cpu = @host_cpu@
host_vendor = @host_vendor@
STYLE_CFLAGS = @STYLE_CFLAGS@
-CFLAGS = @CFLAGS@
+CFLAGS = -O2 -g
++CFLAGS = -O2 -g
LOCAL_CFLAGS = @LOCAL_CFLAGS@
DEFS = @DEFS@
LOCAL_DEFS = @LOCAL_DEFS@
diff -up bash-4.1/examples/loadables/perl/Makefile.in.examples bash-4.1/examples/loadables/perl/Makefile.in
--- bash-4.1/examples/loadables/perl/Makefile.in.examples 2010-06-22 16:20:46.000000000 +0200
+++ bash-4.1/examples/loadables/perl/Makefile.in 2010-06-22 16:21:04.000000000 +0200
diff --git a/examples/loadables/perl/Makefile.in b/examples/loadables/perl/Makefile.in
--- a/examples/loadables/perl/Makefile.in
+++ b/examples/loadables/perl/Makefile.in
@@ -42,7 +42,7 @@ SHELL = @MAKE_SHELL@
PERL5 = perl5
@@ -1,21 +1,20 @@
diff --git a/parse.y b/parse.y
index df1231d..2449fa8 100644
--- a/parse.y
+++ b/parse.y
@@ -4482,6 +4482,8 @@ xparse_dolparen (base, string, indp, flags)
@@ -4255,7 +4255,8 @@ xparse_dolparen (base, string, indp, flags)
save_parser_state (&ps);
save_input_line_state (&ls);
orig_eof_token = shell_eof_token;
-
+ /* avoid echoing every substitution again */
+ echo_input_at_read = 0;
#if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
saved_pushed_strings = pushed_string_list; /* separate parsing context */
pushed_string_list = (STRING_SAVER *)NULL;
#endif
diff --git a/subst.c b/subst.c
index 9ccbf33..8a9ee5c 100644
--- a/subst.c
+++ b/subst.c
@@ -9453,6 +9453,7 @@ param_expand (string, sindex, quoted, expanded_something,
@@ -10222,6 +10222,7 @@ param_expand (string, sindex, quoted, expanded_something,
WORD_LIST *list, *l;
WORD_DESC *tdesc, *ret;
int tflag, nullarg;
@@ -23,7 +22,7 @@ index 9ccbf33..8a9ee5c 100644
/*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
zindex = *sindex;
@@ -9843,6 +9844,9 @@ arithsub:
@@ -10614,6 +10615,9 @@ arithsub:
}
comsub:
@@ -33,7 +32,7 @@ index 9ccbf33..8a9ee5c 100644
if (pflags & PF_NOCOMSUB)
/* we need zindex+1 because string[zindex] == RPAREN */
temp1 = substring (string, *sindex, zindex+1);
@@ -9855,6 +9859,7 @@ comsub:
@@ -10626,6 +10630,7 @@ comsub:
}
FREE (temp);
temp = temp1;
@@ -0,0 +1,13 @@
diff --git a/doc/bash.1 b/doc/bash.1
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -10726,6 +10726,9 @@ If set, the shell automatically closes file descriptors assigned using the
.el above)
instead of leaving them open when the command completes.
.TP 8
+.B syslog_history
+If set, command history is logged to syslog.
+.TP 8
.B xpg_echo
If set, the \fBecho\fP builtin expands backslash-escape sequences
by default.
@@ -1,20 +1,18 @@
diff --git a/builtins.h b/builtins.h
index dac95fd..5b7e811 100644
--- a/builtins.h
+++ b/builtins.h
@@ -45,6 +45,7 @@
#define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */
@@ -46,6 +46,7 @@
#define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */
#define LOCALVAR_BUILTIN 0x40 /* This builtin creates local variables */
+#define REQUIRES_BUILTIN 0x80 /* This builtin requires other files. */
#define ARRAYREF_BUILTIN 0x80 /* This builtin takes array references as arguments */
+#define REQUIRES_BUILTIN 0x100 /* This builtin requires other files. */
#define BASE_INDENT 4
diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
index e243021..0a7a0e5 100644
--- a/builtins/mkbuiltins.c
+++ b/builtins/mkbuiltins.c
@@ -69,10 +69,15 @@ extern char *strcpy ();
@@ -69,11 +69,16 @@ extern char *strcpy ();
#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
/* Flag values that builtins can have. */
@@ -25,15 +23,18 @@ index e243021..0a7a0e5 100644
#define BUILTIN_FLAG_SPECIAL 0x01
#define BUILTIN_FLAG_ASSIGNMENT 0x02
#define BUILTIN_FLAG_LOCALVAR 0x04
#define BUILTIN_FLAG_POSIX_BUILTIN 0x08
+#define BUILTIN_FLAG_REQUIRES 0x10
#define BUILTIN_FLAG_POSIX_BUILTIN 0x08
#define BUILTIN_FLAG_ARRAYREF_ARG 0x10
+#define BUILTIN_FLAG_REQUIRES 0x20
#define BASE_INDENT 4
@@ -173,11 +178,19 @@ char *posix_builtins[] =
@@ -189,13 +194,21 @@ char *arrayvar_builtins[] =
"typeset", "unset", "wait", /*]*/
(char *)NULL
};
-
+
+/* The builtin commands that cause requirements on other files. */
+static char *requires_builtins[] =
+{
@@ -46,36 +47,38 @@ index e243021..0a7a0e5 100644
static int is_assignment_builtin ();
static int is_localvar_builtin ();
static int is_posix_builtin ();
static int is_arrayvar_builtin ();
+static int is_requires_builtin ();
#if !defined (HAVE_RENAME)
static int rename ();
@@ -831,6 +844,8 @@ builtin_handler (self, defs, arg)
new->flags |= BUILTIN_FLAG_LOCALVAR;
if (is_posix_builtin (name))
@@ -856,6 +869,8 @@ builtin_handler (self, defs, arg)
new->flags |= BUILTIN_FLAG_POSIX_BUILTIN;
if (is_arrayvar_builtin (name))
new->flags |= BUILTIN_FLAG_ARRAYREF_ARG;
+ if (is_requires_builtin (name))
+ new->flags |= BUILTIN_FLAG_REQUIRES;
array_add ((char *)new, defs->builtins);
building_builtin = 1;
@@ -1250,12 +1265,13 @@ write_builtins (defs, structfile, externfile)
@@ -1275,13 +1290,14 @@ write_builtins (defs, structfile, externfile)
else
fprintf (structfile, "(sh_builtin_func_t *)0x0, ");
- fprintf (structfile, "%s%s%s%s%s, %s_doc,\n",
+ fprintf (structfile, "%s%s%s%s%s%s, %s_doc,\n",
- fprintf (structfile, "%s%s%s%s%s%s, %s_doc,\n",
+ fprintf (structfile, "%s%s%s%s%s%s%s, %s_doc,\n",
"BUILTIN_ENABLED | STATIC_BUILTIN",
(builtin->flags & BUILTIN_FLAG_SPECIAL) ? " | SPECIAL_BUILTIN" : "",
(builtin->flags & BUILTIN_FLAG_ASSIGNMENT) ? " | ASSIGNMENT_BUILTIN" : "",
(builtin->flags & BUILTIN_FLAG_LOCALVAR) ? " | LOCALVAR_BUILTIN" : "",
(builtin->flags & BUILTIN_FLAG_POSIX_BUILTIN) ? " | POSIX_BUILTIN" : "",
(builtin->flags & BUILTIN_FLAG_ARRAYREF_ARG) ? " | ARRAYREF_BUILTIN" : "",
+ (builtin->flags & BUILTIN_FLAG_REQUIRES) ? " | REQUIRES_BUILTIN" : "",
document_name (builtin));
/* Don't translate short document summaries that are identical
@@ -1645,6 +1661,13 @@ is_posix_builtin (name)
return (_find_in_table (name, posix_builtins));
@@ -1678,6 +1694,13 @@ is_arrayvar_builtin (name)
return (_find_in_table (name, arrayvar_builtins));
}
+static int
@@ -89,7 +92,6 @@ index e243021..0a7a0e5 100644
static int
rename (from, to)
diff --git a/doc/bash.1 b/doc/bash.1
index 5af7d42..7539368 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -239,6 +239,14 @@ The shell becomes restricted (see
@@ -108,10 +110,9 @@ index 5af7d42..7539368 100644
Equivalent to \fB\-v\fP.
.TP
diff --git a/doc/bashref.texi b/doc/bashref.texi
index 9e23f58..d02151e 100644
--- a/doc/bashref.texi
+++ b/doc/bashref.texi
@@ -6554,6 +6554,13 @@ standard. @xref{Bash POSIX Mode}, for a description of the Bash
@@ -6927,6 +6927,13 @@ standard. @xref{Bash POSIX Mode}, for a description of the Bash
@item --restricted
Make the shell a restricted shell (@pxref{The Restricted Shell}).
@@ -126,10 +127,9 @@ index 9e23f58..d02151e 100644
Equivalent to @option{-v}. Print shell input lines as they're read.
diff --git a/eval.c b/eval.c
index 1d967da..f197033 100644
--- a/eval.c
+++ b/eval.c
@@ -137,7 +137,8 @@ reader_loop ()
@@ -138,7 +138,8 @@ reader_loop ()
if (read_command () == 0)
{
@@ -137,13 +137,12 @@ index 1d967da..f197033 100644
+
+ if (interactive_shell == 0 && (read_but_dont_execute && !rpm_requires))
{
set_exit_status (EXECUTION_SUCCESS);
set_exit_status (last_command_exit_value);
dispose_command (global_command);
diff --git a/execute_cmd.c b/execute_cmd.c
index d2555ad..397e283 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -543,6 +543,8 @@ async_redirect_stdin ()
@@ -561,6 +561,8 @@ async_redirect_stdin ()
#define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0)
@@ -152,22 +151,22 @@ index d2555ad..397e283 100644
/* Execute the command passed in COMMAND, perhaps doing it asynchronously.
COMMAND is exactly what read_command () places into GLOBAL_COMMAND.
ASYNCHRONOUS, if non-zero, says to do this command in the background.
@@ -574,7 +576,13 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
@@ -592,7 +594,13 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
if (breaking || continuing)
return (last_command_exit_value);
- if (command == 0 || read_but_dont_execute)
- if (read_but_dont_execute)
+ if (command == 0 || (read_but_dont_execute && !rpm_requires))
+ return (EXECUTION_SUCCESS);
+ if (rpm_requires && command->type == cm_function_def)
+ return last_command_exit_value =
+ execute_intern_function (command->value.Function_def->name,
+ command->value.Function_def);
+ if (read_but_dont_execute)
+ if (read_but_dont_execute)
return (last_command_exit_value);
if (command == 0)
return (EXECUTION_SUCCESS);
QUIT;
@@ -2836,7 +2844,7 @@ execute_for_command (for_command)
@@ -2883,7 +2891,7 @@ execute_for_command (for_command)
save_line_number = line_number;
if (check_identifier (for_command->name, 1) == 0)
{
@@ -177,7 +176,6 @@ index d2555ad..397e283 100644
last_command_exit_value = EX_BADUSAGE;
jump_to_top_level (ERREXIT);
diff --git a/execute_cmd.h b/execute_cmd.h
index 465030a..9c7fd1c 100644
--- a/execute_cmd.h
+++ b/execute_cmd.h
@@ -22,6 +22,9 @@
@@ -191,7 +189,6 @@ index 465030a..9c7fd1c 100644
#if defined (ARRAY_VARS)
struct func_array_state
diff --git a/make_cmd.c b/make_cmd.c
index 2d7ac96..ac53526 100644
--- a/make_cmd.c
+++ b/make_cmd.c
@@ -35,6 +35,8 @@
@@ -203,7 +200,7 @@ index 2d7ac96..ac53526 100644
#include "execute_cmd.h"
#include "parser.h"
#include "flags.h"
@@ -828,6 +830,30 @@ make_coproc_command (name, command)
@@ -839,6 +841,30 @@ make_coproc_command (name, command)
return (make_command (cm_coproc, (SIMPLE_COM *)temp));
}
@@ -234,7 +231,7 @@ index 2d7ac96..ac53526 100644
/* Reverse the word list and redirection list in the simple command
has just been parsed. It seems simpler to do this here the one
time then by any other method that I can think of. */
@@ -845,6 +871,28 @@ clean_simple_command (command)
@@ -856,6 +882,28 @@ clean_simple_command (command)
REVERSE_LIST (command->value.Simple->redirects, REDIRECT *);
}
@@ -264,10 +261,9 @@ index 2d7ac96..ac53526 100644
return (command);
}
diff --git a/shell.c b/shell.c
index ce8087f..7dcd000 100644
--- a/shell.c
+++ b/shell.c
@@ -194,6 +194,9 @@ int have_devfd = 0;
@@ -196,6 +196,9 @@ int have_devfd = 0;
/* The name of the .(shell)rc file. */
static char *bashrc_file = DEFAULT_BASHRC;
@@ -277,7 +273,7 @@ index ce8087f..7dcd000 100644
/* Non-zero means to act more like the Bourne shell on startup. */
static int act_like_sh;
@@ -260,6 +263,7 @@ static const struct {
@@ -266,6 +269,7 @@ static const struct {
{ "protected", Int, &protected_mode, (char **)0x0 },
#endif
{ "rcfile", Charp, (int *)0x0, &bashrc_file },
@@ -285,9 +281,9 @@ index ce8087f..7dcd000 100644
#if defined (RESTRICTED_SHELL)
{ "restricted", Int, &restricted, (char **)0x0 },
#endif
@@ -502,6 +506,12 @@ main (argc, argv, env)
if (dump_translatable_strings)
@@ -510,6 +514,12 @@ main (argc, argv, env)
read_but_dont_execute = 1;
#endif
+ if (rpm_requires)
+ {
@@ -299,10 +295,9 @@ index ce8087f..7dcd000 100644
disable_priv_mode ();
diff --git a/shell.h b/shell.h
index 8b41792..29b0efb 100644
--- a/shell.h
+++ b/shell.h
@@ -99,6 +99,7 @@ extern int interactive, interactive_shell;
@@ -100,6 +100,7 @@ extern int interactive, interactive_shell;
extern int startup_state;
extern int reading_shell_script;
extern int shell_initialized;
@@ -1,8 +1,7 @@
diff --git a/tests/exec.right b/tests/exec.right
index 0a249dd..fe8a127 100644
--- a/tests/exec.right
+++ b/tests/exec.right
@@ -51,7 +51,6 @@ this is ohio-state
@@ -60,7 +60,6 @@ this is ohio-state
0
1
testb
@@ -11,7 +10,6 @@ index 0a249dd..fe8a127 100644
1
1
diff --git a/tests/execscript b/tests/execscript
index 2809676..1216828 100644
--- a/tests/execscript
+++ b/tests/execscript
@@ -108,8 +108,6 @@ ${THIS_SH} ./exec6.sub
@@ -24,26 +22,27 @@ index 2809676..1216828 100644
${THIS_SH} ./exec10.sub
diff --git a/tests/read.right b/tests/read.right
index 1144083..09cd422 100644
--- a/tests/read.right
+++ b/tests/read.right
@@ -33,14 +33,6 @@ a = abcdefg
@@ -34,17 +34,6 @@ xyz
a = xyz
a = -xyz 123-
a = abc
-timeout 1: ok
-
-unset or null 1
-timeout 2: ok
-
-./read2.sub: line 36: read: -3: invalid timeout specification
-unset or null 2
-timeout 3: ok
-unset or null 3
-./read2.sub: line 45: read: -3: invalid timeout specification
-1
-
-abcde
-abcde
./read3.sub: line 17: read: -1: invalid number
abc
ab
defg
diff --git a/tests/read.tests b/tests/read.tests
index 7384f05..43fcf8d 100644
--- a/tests/read.tests
+++ b/tests/read.tests
@@ -95,9 +95,6 @@ echo " foo" | { IFS=$':' ; read line; recho "$line"; }