bash ver. bump

This commit is contained in:
Rmys
2025-11-07 18:00:03 +03:00
parent 6cf6be768b
commit a9f15c5610
47 changed files with 344 additions and 7290 deletions
@@ -1,8 +1,7 @@
diff --git a/config.h.in b/config.h.in
index ab316d4..11d1d68 100644
--- a/config.h.in
+++ b/config.h.in
@@ -775,6 +775,9 @@
@@ -805,6 +805,9 @@
/* Define if you have the pselect function. */
#undef HAVE_PSELECT
@@ -12,7 +11,7 @@ index ab316d4..11d1d68 100644
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
@@ -981,6 +984,9 @@
@@ -1032,6 +1035,9 @@
/* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -23,20 +22,18 @@ index ab316d4..11d1d68 100644
#undef HAVE_GRP_H
diff --git a/configure.ac b/configure.ac
index 2fe3e7d..f1b7f1b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -827,7 +827,7 @@ dnl checks for system calls
AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getentropy getgroups \
gethostname getpagesize getpeername getrandom getrlimit \
getrusage gettimeofday kill killpg lstat pselect readlink \
- select setdtablesize setitimer tcgetpgrp uname ulimit waitpid)
+ select setdtablesize setitimer tcgetpgrp uname ulimit waitpid pread)
@@ -878,7 +878,7 @@ AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getentropy getgroups \
getrusage gettimeofday kill killpg lstat nanosleep \
pselect readlink \
select setdtablesize setitimer statfs \
- tcgetpgrp uname ulimit waitpid)
+ tcgetpgrp uname ulimit waitpid pread)
AC_REPLACE_FUNCS(rename)
dnl checks for c library functions
diff --git a/execute_cmd.c b/execute_cmd.c
index d2a0dd7..d2555ad 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -41,6 +41,10 @@
@@ -50,7 +47,7 @@ index d2a0dd7..d2555ad 100644
#include "posixtime.h"
#if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE)
@@ -5832,6 +5836,14 @@ shell_execve (command, args, env)
@@ -6162,6 +6166,14 @@ shell_execve (char *command, char **args, char **env)
{
/* The file has the execute bits set, but the kernel refuses to
run it for some reason. See why. */
@@ -65,19 +62,18 @@ index d2a0dd7..d2555ad 100644
#if defined (HAVE_HASH_BANG_EXEC)
READ_SAMPLE_BUF (command, sample, sample_len);
if (sample_len > 0)
@@ -5841,6 +5853,7 @@ shell_execve (command, args, env)
@@ -6171,6 +6183,7 @@ shell_execve (char *command, char **args, char **env)
char *interp;
int ilen;
size_t ilen;
+ close (fd);
interp = getinterp (sample, sample_len, (int *)NULL);
ilen = strlen (interp);
errno = i;
@@ -5856,7 +5869,138 @@ shell_execve (command, args, env)
return (EX_NOEXEC);
@@ -6187,6 +6200,137 @@ shell_execve (char *command, char **args, char **env)
}
else
#endif
- errno = i;
+#if defined (HAVE_ELF_H)
+ if (i == ENOENT
+ && sample_len > EI_NIDENT
@@ -209,7 +205,6 @@ index d2a0dd7..d2555ad 100644
+ close (fd);
+#endif
+
+ errno = i;
file_error (command);
}
return (last_command_exit_value);
if (i == ENOENT)
{
errno = i;
@@ -1,12 +1,12 @@
diff -up bash-4.1/doc/bash.1.manpage_trap bash-4.1/doc/bash.1
--- bash-4.1/doc/bash.1.manpage_trap 2012-08-28 10:06:00.561999092 +0200
+++ bash-4.1/doc/bash.1 2012-08-28 10:06:24.225304505 +0200
@@ -9251,7 +9251,7 @@ being inverted via
diff --git a/doc/bash.1 b/doc/bash.1
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -12621,7 +12621,7 @@ being inverted using
These are the same conditions obeyed by the \fBerrexit\fP (\fB\-e\fP) option.
.if t .sp 0.5
.if n .sp 1
-Signals ignored upon entry to the shell cannot be trapped or reset.
+Signals ignored upon entry to the shell cannot be trapped, reset or listed.
.IP
When the shell is not interactive,
-signals ignored upon entry to the shell cannot be trapped or reset.
+signals ignored upon entry to the shell cannot be trapped, reset or listed.
Interactive shells permit trapping signals ignored on entry.
Trapped signals that are not being ignored are reset to their original
values in a subshell or subshell environment when one is created.
The return status is false if any
@@ -1,8 +1,7 @@
diff --git a/config-top.h b/config-top.h
index 026d4a4..cb0e002 100644
--- a/config-top.h
+++ b/config-top.h
@@ -92,7 +92,7 @@
@@ -97,7 +97,7 @@
/* #define SYS_BASHRC "/etc/bash.bashrc" */
/* System-wide .bash_logout for login shells. */
@@ -12,30 +11,27 @@ index 026d4a4..cb0e002 100644
/* Define this to make non-interactive shells begun with argv[0][0] == '-'
run the startup files when not in posix mode. */
diff --git a/doc/bash.1 b/doc/bash.1
index 04ce845..bfde55e 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -335,8 +335,8 @@ option may be used when the shell is started to inhibit this behavior.
@@ -378,9 +378,8 @@ option may be used when the shell is started to inhibit this behavior.
When an interactive login shell exits,
or a non-interactive login shell executes the \fBexit\fP builtin command,
.B bash
-reads and executes commands from the file \fI~/.bash_logout\fP, if it
-exists.
-reads and executes commands from the file
-.FN \*~/.bash_logout ,
-if it exists.
+reads and executes commands from the files \fI~/.bash_logout\fP
+and \fI/etc/bash.bash_logout\fP, if the files exists.
.PP
When an interactive shell that is not a login shell is started,
.B bash
@@ -10558,6 +10558,9 @@ The \fBbash\fP executable
@@ -13404,6 +13403,9 @@ The \fBbash\fP executable
.FN /etc/profile
The systemwide initialization file, executed for login shells
.TP
+.FN /etc/bash.bash_logout
+The systemwide login shell cleanup file, executed when a login shell exits
+.TP
.FN ~/.bash_profile
.FN \*~/.bash_profile
The personal initialization file, executed for login shells
.TP
--
2.9.3
@@ -1,15 +1,11 @@
diff --git a/Makefile.in b/Makefile.in
index a1f9483..24c646a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -800,7 +800,6 @@ install: .made installdirs
@@ -923,7 +923,6 @@ install: .made installdirs
infodir=$(infodir) htmldir=$(htmldir) DESTDIR=$(DESTDIR) $@ )
-( cd $(DEFDIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
-( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
- -( cd $(LOADABLES_DIR) && $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
-( cd $(DEFDIR) ; $(MAKE) $(BASH_MAKEFLAGS) DESTDIR=$(DESTDIR) $@ )
-( cd $(PO_DIR) ; $(MAKE) $(BASH_MAKEFLAGS) DESTDIR=$(DESTDIR) $@ )
- -( cd $(LOADABLES_DIR) && $(MAKE) $(BASH_MAKEFLAGS) DESTDIR=$(DESTDIR) $@ )
install-strip:
$(MAKE) $(MFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
--
2.9.3
$(MAKE) $(BASH_MAKEFLAGS) INSTALL_PROGRAM='$(INSTALL_STRIP_PROGRAM)' \
@@ -12,7 +12,7 @@ diff --git a/builtins.h b/builtins.h
diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
--- a/builtins/mkbuiltins.c
+++ b/builtins/mkbuiltins.c
@@ -69,11 +69,16 @@ extern char *strcpy ();
@@ -62,11 +62,16 @@ static void *xrealloc (void *, size_t);
#define whitespace(c) (((c) == ' ') || ((c) == '\t'))
/* Flag values that builtins can have. */
@@ -29,7 +29,7 @@ diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
#define BASE_INDENT 4
@@ -189,13 +194,21 @@ char *arrayvar_builtins[] =
@@ -183,13 +188,21 @@ char *arrayvar_builtins[] =
"typeset", "unset", "wait", /*]*/
(char *)NULL
};
@@ -43,16 +43,16 @@ diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
+};
+
/* Forward declarations. */
static int is_special_builtin ();
static int is_assignment_builtin ();
static int is_localvar_builtin ();
static int is_posix_builtin ();
static int is_arrayvar_builtin ();
static int is_special_builtin (char *);
static int is_assignment_builtin (char *);
static int is_localvar_builtin (char *);
static int is_posix_builtin (char *);
static int is_arrayvar_builtin (char *);
+static int is_requires_builtin ();
#if !defined (HAVE_RENAME)
static int rename ();
@@ -856,6 +869,8 @@ builtin_handler (self, defs, arg)
static int rename (char *, char *);
@@ -826,6 +839,8 @@ builtin_handler (char *self, DEF_FILE *defs, char *arg)
new->flags |= BUILTIN_FLAG_POSIX_BUILTIN;
if (is_arrayvar_builtin (name))
new->flags |= BUILTIN_FLAG_ARRAYREF_ARG;
@@ -61,7 +61,7 @@ diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
array_add ((char *)new, defs->builtins);
building_builtin = 1;
@@ -1275,13 +1290,14 @@ write_builtins (defs, structfile, externfile)
@@ -1212,13 +1227,14 @@ write_builtins (DEF_FILE *defs, FILE *structfile, FILE *externfile)
else
fprintf (structfile, "(sh_builtin_func_t *)0x0, ");
@@ -77,7 +77,7 @@ diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
document_name (builtin));
/* Don't translate short document summaries that are identical
@@ -1678,6 +1694,13 @@ is_arrayvar_builtin (name)
@@ -1597,6 +1613,13 @@ is_arrayvar_builtin (char *name)
return (_find_in_table (name, arrayvar_builtins));
}
@@ -90,11 +90,11 @@ diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
+
#if !defined (HAVE_RENAME)
static int
rename (from, to)
rename (char *from, char *to)
diff --git a/doc/bash.1 b/doc/bash.1
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -239,6 +239,14 @@ The shell becomes restricted (see
@@ -276,6 +276,14 @@ The shell becomes restricted (see
.B "RESTRICTED SHELL"
below).
.TP
@@ -112,8 +112,8 @@ diff --git a/doc/bash.1 b/doc/bash.1
diff --git a/doc/bashref.texi b/doc/bashref.texi
--- a/doc/bashref.texi
+++ b/doc/bashref.texi
@@ -6927,6 +6927,13 @@ standard. @xref{Bash POSIX Mode}, for a description of the Bash
@item --restricted
@@ -7812,6 +7812,13 @@ standard.
Equivalent to @option{-r}.
Make the shell a restricted shell (@pxref{The Restricted Shell}).
+@item --rpm-requires
@@ -124,12 +124,12 @@ diff --git a/doc/bashref.texi b/doc/bashref.texi
+are not parsed so some dependencies may be missed.
+
@item --verbose
Equivalent to @option{-v}. Print shell input lines as they're read.
Equivalent to @option{-v}.
Print shell input lines as they're read.
diff --git a/eval.c b/eval.c
--- a/eval.c
+++ b/eval.c
@@ -138,7 +138,8 @@ reader_loop ()
@@ -146,7 +146,8 @@ reader_loop (void)
if (read_command () == 0)
{
@@ -142,7 +142,7 @@ diff --git a/eval.c b/eval.c
diff --git a/execute_cmd.c b/execute_cmd.c
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -561,6 +561,8 @@ async_redirect_stdin ()
@@ -612,6 +612,8 @@ async_redirect_stdin (void)
#define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0)
@@ -151,7 +151,7 @@ diff --git a/execute_cmd.c b/execute_cmd.c
/* 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.
@@ -592,7 +594,13 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
@@ -638,7 +640,13 @@ execute_command_internal (COMMAND *command, int asynchronous, int pipe_in, int p
if (breaking || continuing)
return (last_command_exit_value);
@@ -166,9 +166,9 @@ diff --git a/execute_cmd.c b/execute_cmd.c
return (last_command_exit_value);
if (command == 0)
return (EXECUTION_SUCCESS);
@@ -2883,7 +2891,7 @@ execute_for_command (for_command)
save_line_number = line_number;
if (check_identifier (for_command->name, 1) == 0)
@@ -3505,7 +3513,7 @@ execute_select_command (SELECT_COM *select_command)
if (check_identifier (select_command->name, 1) == 0)
{
- if (posixly_correct && interactive_shell == 0)
+ if (posixly_correct && interactive_shell == 0 && rpm_requires == 0)
@@ -200,7 +200,7 @@ diff --git a/make_cmd.c b/make_cmd.c
#include "execute_cmd.h"
#include "parser.h"
#include "flags.h"
@@ -839,6 +841,30 @@ make_coproc_command (name, command)
@@ -797,6 +799,30 @@ make_coproc_command (char *name, COMMAND *command)
return (make_command (cm_coproc, (SIMPLE_COM *)temp));
}
@@ -231,7 +231,7 @@ diff --git a/make_cmd.c b/make_cmd.c
/* 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. */
@@ -856,6 +882,28 @@ clean_simple_command (command)
@@ -813,6 +839,28 @@ clean_simple_command (COMMAND *command)
REVERSE_LIST (command->value.Simple->redirects, REDIRECT *);
}
@@ -263,9 +263,9 @@ diff --git a/make_cmd.c b/make_cmd.c
diff --git a/shell.c b/shell.c
--- a/shell.c
+++ b/shell.c
@@ -196,6 +196,9 @@ int have_devfd = 0;
/* The name of the .(shell)rc file. */
static char *bashrc_file = DEFAULT_BASHRC;
@@ -205,6 +205,9 @@ int have_devfd = 0;
/* The name of the .(shell)rc file, DEFAULT_BASHRC is sourced by default */
static char *bashrc_file;
+/* Non-zero if we are finding the scripts requirements. */
+int rpm_requires;
@@ -273,7 +273,7 @@ diff --git a/shell.c b/shell.c
/* Non-zero means to act more like the Bourne shell on startup. */
static int act_like_sh;
@@ -266,6 +269,7 @@ static const struct {
@@ -272,6 +275,7 @@ static const struct {
{ "protected", Int, &protected_mode, (char **)0x0 },
#endif
{ "rcfile", Charp, (int *)0x0, &bashrc_file },
@@ -281,7 +281,7 @@ diff --git a/shell.c b/shell.c
#if defined (RESTRICTED_SHELL)
{ "restricted", Int, &restricted, (char **)0x0 },
#endif
@@ -510,6 +514,12 @@ main (argc, argv, env)
@@ -510,6 +514,12 @@ main (int argc, char **argv, char **env)
read_but_dont_execute = 1;
#endif
@@ -297,9 +297,9 @@ diff --git a/shell.c b/shell.c
diff --git a/shell.h b/shell.h
--- a/shell.h
+++ b/shell.h
@@ -100,6 +100,7 @@ extern int interactive, interactive_shell;
extern int startup_state;
@@ -105,6 +105,7 @@ extern int startup_state;
extern int reading_shell_script;
extern int ssh_reading_startup_files;
extern int shell_initialized;
+extern int rpm_requires;
extern int bash_argv_initialized;
@@ -1,18 +1,18 @@
diff --git a/tests/exec.right b/tests/exec.right
--- a/tests/exec.right
+++ b/tests/exec.right
@@ -60,7 +60,6 @@ this is ohio-state
0
@@ -79,7 +79,6 @@ this is ohio-state
1
0
testb
-expand_aliases on
-expand_aliases on
1
1
1
diff --git a/tests/execscript b/tests/execscript
--- a/tests/execscript
+++ b/tests/execscript
@@ -108,8 +108,6 @@ ${THIS_SH} ./exec6.sub
@@ -148,8 +148,6 @@ ${THIS_SH} ./exec6.sub
# checks for properly deciding what constitutes an executable file
${THIS_SH} ./exec7.sub
@@ -24,10 +24,10 @@ diff --git a/tests/execscript b/tests/execscript
diff --git a/tests/read.right b/tests/read.right
--- a/tests/read.right
+++ b/tests/read.right
@@ -34,17 +34,6 @@ xyz
a = xyz
a = -xyz 123-
a = abc
@@ -52,18 +52,6 @@ a = abc
<$'spring\375'>
<summer>
<automn>
-timeout 1: ok
-unset or null 1
-timeout 2: ok
@@ -38,6 +38,7 @@ diff --git a/tests/read.right b/tests/read.right
-1
-
-abcde
-abcde
-abcde
./read3.sub: line 17: read: -1: invalid number
abc
@@ -45,7 +46,7 @@ diff --git a/tests/read.right b/tests/read.right
diff --git a/tests/read.tests b/tests/read.tests
--- a/tests/read.tests
+++ b/tests/read.tests
@@ -95,9 +95,6 @@ echo " foo" | { IFS=$':' ; read line; recho "$line"; }
@@ -108,9 +108,6 @@ echo a = $a b = $b c = $c stat = $?
# test read -d delim behavior
${THIS_SH} ./read1.sub