Compare commits

...

No commits in common. "c8" and "c9s" have entirely different histories.
c8 ... c9s

83 changed files with 855 additions and 2227 deletions

View File

@ -1 +0,0 @@
8de012df1e4f3e91f571c3eb8ec45b43d7c747eb SOURCES/bash-4.4.tar.gz

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

8
.gitignore vendored
View File

@ -1 +1,7 @@
SOURCES/bash-4.4.tar.gz bash-4.1.tar.gz
/bash-4.2-rc2.tar.gz
/bash-4.2.tar.gz
/bash-4.3.tar.gz
/bash-4.4.tar.gz
/bash-5.0.tar.gz
/bash-5.1.tar.gz

View File

@ -1,11 +0,0 @@
--- bash-2.02-orig/parse.y Wed Mar 25 18:16:23 1998
+++ bash-2.02/parse.y Sun Apr 19 16:46:34 1998
@@ -923,7 +923,7 @@
#if defined (READLINE)
char *current_readline_prompt = (char *)NULL;
-char *current_readline_line = (char *)NULL;
+unsigned char *current_readline_line = (unsigned char *)NULL;
int current_readline_line_index = 0;
static int

View File

@ -1,10 +0,0 @@
--- bash-2.05b/doc/builtins.1.manso 2003-02-10 18:58:21.000000000 +0000
+++ bash-2.05b/doc/builtins.1 2003-02-10 18:58:28.000000000 +0000
@@ -10,6 +10,6 @@
ulimit, umask, unalias, unset, wait \- bash built-in commands, see \fBbash\fR(1)
.SH BASH BUILTIN COMMANDS
.nr zZ 1
-.so bash.1
+.so man1/bash.1
.SH SEE ALSO
bash(1), sh(1)

View File

@ -1,19 +0,0 @@
--- bash-3.1/Makefile.in.xcc 2005-10-25 19:37:52.000000000 +0100
+++ bash-3.1/Makefile.in 2005-12-23 16:11:09.000000000 +0000
@@ -68,6 +68,7 @@
ARFLAGS = @ARFLAGS@
RANLIB = @RANLIB@
SIZE = @SIZE@
+STRIP = strip
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -535,7 +536,7 @@
@chmod a+rx bashbug
strip: $(Program) .made
- strip $(Program)
+ $(STRIP) $(Program)
ls -l $(Program)
-$(SIZE) $(Program)

View File

@ -1,11 +0,0 @@
diff -pruN bash-4.1/jobs.c bash-4.1.patched/jobs.c
--- bash-4.1/jobs.c 2009-11-30 03:42:05.000000000 +0530
+++ bash-4.1.patched/jobs.c 2012-03-06 16:44:15.706595703 +0530
@@ -3037,6 +3037,7 @@ waitchld (wpid, block)
pid_t pid;
int call_set_current, last_stopped_job, job, children_exited, waitpid_flags;
+ int called_from_sighand = sigchld;
static int wcontinued = WCONTINUED; /* run-time fix for glibc problem */
call_set_current = children_exited = 0;

View File

@ -1,12 +0,0 @@
diff -up bash-4.3/locale.c.old bash-4.3/locale.c
--- bash-4.3/locale.c.old 2015-07-15 11:55:00.002857301 +0200
+++ bash-4.3/locale.c 2015-07-15 11:48:36.698086257 +0200
@@ -77,8 +77,6 @@ set_default_locale ()
{
#if defined (HAVE_SETLOCALE)
default_locale = setlocale (LC_ALL, "");
- if (default_locale)
- default_locale = savestring (default_locale);
#endif /* HAVE_SETLOCALE */
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);

View File

@ -1,31 +0,0 @@
diff --git a/execute_cmd.h b/execute_cmd.h
--- a/execute_cmd.h
+++ b/execute_cmd.h
@@ -37,6 +37,9 @@ struct func_array_state
};
#endif
+/* Variables delared in execute_cmd.c, used by many other files */
+extern int executing_command_builtin;
+
extern struct fd_bitmap *new_fd_bitmap __P((int));
extern void dispose_fd_bitmap __P((struct fd_bitmap *));
extern void close_fd_bitmap __P((struct fd_bitmap *));
diff --git a/subst.c b/subst.c
--- a/subst.c
+++ b/subst.c
@@ -10676,11 +10676,12 @@ expand_word_list_internal (list, eflags)
tint = do_word_assignment (temp_list->word, 0);
this_command_name = savecmd;
/* Variable assignment errors in non-interactive shells
- running in Posix.2 mode cause the shell to exit. */
+ running in Posix.2 mode cause the shell to exit, unless
+ they are being run by the `command' builtin. */
if (tint == 0)
{
last_command_exit_value = EXECUTION_FAILURE;
- if (interactive_shell == 0 && posixly_correct)
+ if (interactive_shell == 0 && posixly_correct && executing_command_builtin == 0)
exp_jump_to_top_level (FORCE_EOF);
else
exp_jump_to_top_level (DISCARD);

View File

@ -1,18 +0,0 @@
diff --git a/parse.y b/parse.y
--- a/parse.y
+++ b/parse.y
@@ -4011,11 +4011,13 @@ eof_error:
tflags |= LEX_RESWDOK;
lex_rwlen = 0;
}
- else
+ else if (shellmeta (ch) == 0)
{
tflags &= ~LEX_RESWDOK;
/*itrace("parse_comsub:%d: found `%.4s', lex_reswdok -> 0", line_number, ret+retind-4);*/
}
+ else /* can't be in a reserved word any more */
+ lex_rwlen = 0;
}
else if MBTEST((tflags & LEX_CKCOMMENT) && ch == '#' && (lex_rwlen == 0 || ((tflags & LEX_INWORD) && lex_wlen == 0)))
; /* don't modify LEX_RESWDOK if we're starting a comment */

View File

@ -1,203 +0,0 @@
diff --git a/builtins/fc.def b/builtins/fc.def
index fe16471..98c53db 100644
--- a/builtins/fc.def
+++ b/builtins/fc.def
@@ -423,6 +423,7 @@ fc_builtin (list)
{
sh_wrerror ();
fclose (stream);
+ FREE (fn);
return (EXECUTION_FAILURE);
}
fclose (stream);
diff --git a/execute_cmd.c b/execute_cmd.c
index 63a332a..15b5e19 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -2196,8 +2196,10 @@ coproc_setvars (cp)
if (v == 0)
{
v = find_variable_nameref_for_create (cp->c_name, 1);
- if (v == INVALID_NAMEREF_VALUE)
- return;
+ if (v == INVALID_NAMEREF_VALUE) {
+ free (namevar);
+ return;
+ }
if (v && nameref_p (v))
{
free (cp->c_name);
@@ -2210,6 +2212,7 @@ coproc_setvars (cp)
{
if (readonly_p (v))
err_readonly (cp->c_name);
+ free (namevar);
return;
}
if (v == 0)
@@ -5528,7 +5531,6 @@ shell_execve (command, args, env)
char *interp;
int ilen;
- close (fd);
interp = getinterp (sample, sample_len, (int *)NULL);
ilen = strlen (interp);
errno = i;
diff --git a/expr.c b/expr.c
index 172964a..5dc57c0 100644
--- a/expr.c
+++ b/expr.c
@@ -207,7 +207,8 @@ static intmax_t exp5 __P((void));
static intmax_t exp4 __P((void));
static intmax_t expshift __P((void));
static intmax_t exp3 __P((void));
-static intmax_t exp2 __P((void));
+/* Avoid name clash with standard exp2 */
+static intmax_t bash_exp2 __P((void));
static intmax_t exppower __P((void));
static intmax_t exp1 __P((void));
static intmax_t exp0 __P((void));
@@ -809,14 +810,14 @@ exp3 ()
{
register intmax_t val1, val2;
- val1 = exp2 ();
+ val1 = bash_exp2 ();
while ((curtok == PLUS) || (curtok == MINUS))
{
int op = curtok;
readtok ();
- val2 = exp2 ();
+ val2 = bash_exp2 ();
if (op == PLUS)
val1 += val2;
@@ -828,7 +829,7 @@ exp3 ()
}
static intmax_t
-exp2 ()
+bash_exp2 ()
{
register intmax_t val1, val2;
#if defined (HAVE_IMAXDIV)
diff --git a/lib/glob/glob.c b/lib/glob/glob.c
index 7f6eafe..c018e29 100644
--- a/lib/glob/glob.c
+++ b/lib/glob/glob.c
@@ -576,7 +576,7 @@ glob_vector (pat, dir, flags)
register char *nextname, *npat, *subdir;
unsigned int count;
int lose, skip, ndirs, isdir, sdlen, add_current, patlen;
- register char **name_vector;
+ register char **name_vector = NULL;
register unsigned int i;
int mflags; /* Flags passed to strmatch (). */
int pflags; /* flags passed to sh_makepath () */
@@ -894,7 +894,7 @@ glob_vector (pat, dir, flags)
}
/* Don't call QUIT; here; let higher layers deal with it. */
-
+ FREE (name_vector);
return ((char **)NULL);
}
diff --git a/lib/sh/pathcanon.c b/lib/sh/pathcanon.c
index f19bd55..2a565d6 100644
--- a/lib/sh/pathcanon.c
+++ b/lib/sh/pathcanon.c
@@ -227,7 +227,7 @@ sh_canonpath (path, flags)
if (result[2] == '\0') /* short-circuit for bare `//' */
result[1] = '\0';
else
- strcpy (result, result + 1);
+ memmove(result, result + 1, strlen(result + 1) + 1);
}
return (result);
diff --git a/lib/sh/pathphys.c b/lib/sh/pathphys.c
index 26016b7..b64c4cd 100644
--- a/lib/sh/pathphys.c
+++ b/lib/sh/pathphys.c
@@ -245,7 +245,7 @@ error:
if (result[2] == '\0') /* short-circuit for bare `//' */
result[1] = '\0';
else
- strcpy (result, result + 1);
+ memmove(result, result + 1, strlen(result + 1) + 1);
}
return (result);
diff --git a/shell.c b/shell.c
index b43de50..4aae182 100644
--- a/shell.c
+++ b/shell.c
@@ -1948,8 +1948,10 @@ show_shell_usage (fp, extra)
fputs (_("\t-ilrsD or -c command or -O shopt_option\t\t(invocation only)\n"), fp);
for (i = 0, set_opts = 0; shell_builtins[i].name; i++)
- if (STREQ (shell_builtins[i].name, "set"))
+ if (STREQ (shell_builtins[i].name, "set")) {
set_opts = savestring (shell_builtins[i].short_doc);
+ break;
+ }
if (set_opts)
{
s = strchr (set_opts, '[');
diff --git a/subst.c b/subst.c
index 5f3e41e..7574617 100644
--- a/subst.c
+++ b/subst.c
@@ -5182,8 +5182,11 @@ parameter_list_transform (xc, itype, quoted)
list = list_rest_of_args ();
if (list == 0)
return ((char *)NULL);
- if (xc == 'A')
- return (pos_params_assignment (list, itype, quoted));
+ if (xc == 'A') {
+ ret = pos_params_assignment (list, itype, quoted);
+ dispose_words (list);
+ return (ret);
+ }
ret = list_transform (xc, (SHELL_VAR *)0, list, itype, quoted);
dispose_words (list);
return (ret);
@@ -6813,6 +6816,7 @@ parameter_brace_expand_rhs (name, value, c, quoted, pflags, qdollaratp, hasdolla
{
report_error (_("%s: invalid indirect expansion"), name);
free (vname);
+ free (t1);
dispose_word (w);
return &expand_wdesc_error;
}
@@ -6820,6 +6824,7 @@ parameter_brace_expand_rhs (name, value, c, quoted, pflags, qdollaratp, hasdolla
{
report_error (_("%s: invalid variable name"), vname);
free (vname);
+ free (t1);
dispose_word (w);
return &expand_wdesc_error;
}
diff --git a/support/man2html.c b/support/man2html.c
index 6ba5061..1d9e376 100644
--- a/support/man2html.c
+++ b/support/man2html.c
@@ -522,6 +522,7 @@ read_man_page(char *filename)
man_buf[buf_size] = '\n';
man_buf[buf_size + 1] = man_buf[buf_size + 2] = '\0';
} else {
+ free (man_buf);
man_buf = NULL;
}
fclose(man_stream);
@@ -2562,7 +2563,6 @@ scan_request(char *c)
h = name;
if (stat(h, &stbuf) != -1)
l = stbuf.st_size;
- buf = stralloc(l + 4);
#if NOCGI
if (!out_length) {
char *t, *s;

View File

@ -1,23 +0,0 @@
diff -up bash-4.4/input.c.orig bash-4.4/input.c
--- bash-4.4/input.c.orig 2022-03-10 10:50:40.046490589 -0300
+++ bash-4.4/input.c 2022-03-10 10:51:48.659491601 -0300
@@ -530,7 +530,7 @@ bufstream_ungetc(c, bp)
int c;
BUFFERED_STREAM *bp;
{
- if (c == EOF || bp->b_inputp == 0)
+ if (c == EOF || bp == 0 || bp->b_inputp == 0)
return (EOF);
bp->b_buffer[--bp->b_inputp] = c;
@@ -561,6 +561,10 @@ buffered_getchar ()
{
CHECK_TERMSIG;
+ if (bash_input.location.buffered_fd < 0 ||
+ buffers[bash_input.location.buffered_fd] == 0)
+ return EOF;
+
#if !defined (DJGPP)
return (bufstream_getc (buffers[bash_input.location.buffered_fd]));
#else

View File

@ -1,49 +0,0 @@
From 8ddc8d6e3a3d85eec6d4ba9b9ed2bc36bce56716 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 14 Nov 2016 14:26:51 -0500
Subject: [PATCH] Bash-4.4 patch 1
---
lib/readline/history.c | 6 +++++-
patchlevel.h | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/readline/history.c b/lib/readline/history.c
index 3b8dbc5..9ff25a7 100644
--- a/lib/readline/history.c
+++ b/lib/readline/history.c
@@ -57,6 +57,8 @@ extern int errno;
/* How big to make the_history when we first allocate it. */
#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
@@ -307,7 +309,9 @@ add_history (string)
if (history_size == 0)
{
if (history_stifled && history_max_entries > 0)
- history_size = history_max_entries + 2;
+ history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE)
+ ? MAX_HISTORY_INITIAL_SIZE
+ : history_max_entries + 2;
else
history_size = DEFAULT_HISTORY_INITIAL_SIZE;
the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
diff --git a/patchlevel.h b/patchlevel.h
index 1cd7c96..40db1a3 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 0
+#define PATCHLEVEL 1
#endif /* _PATCHLEVEL_H_ */
--
2.9.3

View File

@ -1,39 +0,0 @@
From 5b9762d6f0cd36ff1b88bde22efa30ad0ed27ec6 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 20 Jan 2017 15:38:38 -0500
Subject: [PATCH] Bash-4.4 patch 10
---
builtins/read.def | 3 ++-
patchlevel.h | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/builtins/read.def b/builtins/read.def
index 48fda33..33821f3 100644
--- a/builtins/read.def
+++ b/builtins/read.def
@@ -181,7 +181,8 @@ read_builtin (list)
WORD_LIST *list;
{
register char *varname;
- int size, i, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2;
+ int size, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2;
+ volatile int i;
int input_is_tty, input_is_pipe, unbuffered_read, skip_ctlesc, skip_ctlnul;
int raw, edit, nchars, silent, have_timeout, ignore_delim, fd, lastsig, t_errno;
unsigned int tmsec, tmusec;
diff --git a/patchlevel.h b/patchlevel.h
index 02f1d60..8002af7 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_ */
--
2.9.3

View File

@ -1,39 +0,0 @@
From 76bb456d8fcd870cd31b7bf9d90798cd97cee2ab Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 20 Jan 2017 15:38:49 -0500
Subject: [PATCH] Bash-4.4 patch 11
---
patchlevel.h | 2 +-
sig.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/patchlevel.h b/patchlevel.h
index 8002af7..772676c 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_ */
diff --git a/sig.c b/sig.c
index ad01631..e5bb739 100644
--- a/sig.c
+++ b/sig.c
@@ -585,7 +585,8 @@ termsig_handler (sig)
#if defined (JOB_CONTROL)
if (sig == SIGHUP && (interactive || (subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB))))
hangup_all_jobs ();
- end_job_control ();
+ if ((subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB)) == 0)
+ end_job_control ();
#endif /* JOB_CONTROL */
#if defined (PROCESS_SUBSTITUTION)
--
2.9.3

View File

@ -1,119 +0,0 @@
From bc007799f0e1362100375bb95d952d28de4c62fb Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 27 Jan 2017 11:25:44 -0500
Subject: [PATCH] Bash-4.4 patch 12
---
patchlevel.h | 2 +-
subst.c | 32 ++++++++++++++++++++------------
2 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/patchlevel.h b/patchlevel.h
index 772676c..93dbe0d 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 11
+#define PATCHLEVEL 12
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index 027a13e..dbf0157 100644
--- a/subst.c
+++ b/subst.c
@@ -2825,11 +2825,15 @@ list_string (string, separators, quoted)
/* Parse a single word from STRING, using SEPARATORS to separate fields.
ENDPTR is set to the first character after the word. This is used by
- the `read' builtin. This is never called with SEPARATORS != $IFS;
- it should be simplified.
+ the `read' builtin.
+
+ This is never called with SEPARATORS != $IFS, and takes advantage of that.
XXX - this function is very similar to list_string; they should be
combined - XXX */
+
+#define islocalsep(c) (local_cmap[(unsigned char)(c)] != 0)
+
char *
get_word_from_string (stringp, separators, endptr)
char **stringp, *separators, **endptr;
@@ -2837,6 +2841,7 @@ get_word_from_string (stringp, separators, endptr)
register char *s;
char *current_word;
int sindex, sh_style_split, whitesep, xflags;
+ unsigned char local_cmap[UCHAR_MAX+1]; /* really only need single-byte chars here */
size_t slen;
if (!stringp || !*stringp || !**stringp)
@@ -2846,20 +2851,23 @@ get_word_from_string (stringp, separators, endptr)
separators[1] == '\t' &&
separators[2] == '\n' &&
separators[3] == '\0';
- for (xflags = 0, s = ifs_value; s && *s; s++)
+ memset (local_cmap, '\0', sizeof (local_cmap));
+ for (xflags = 0, s = separators; s && *s; s++)
{
if (*s == CTLESC) xflags |= SX_NOCTLESC;
if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL;
+ local_cmap[(unsigned char)*s] = 1; /* local charmap of separators */
}
s = *stringp;
slen = 0;
/* Remove sequences of whitespace at the beginning of STRING, as
- long as those characters appear in IFS. */
- if (sh_style_split || !separators || !*separators)
+ long as those characters appear in SEPARATORS. This happens if
+ SEPARATORS == $' \t\n' or if IFS is unset. */
+ if (sh_style_split || separators == 0)
{
- for (; *s && spctabnl (*s) && isifs (*s); s++);
+ for (; *s && spctabnl (*s) && islocalsep (*s); s++);
/* If the string is nothing but whitespace, update it and return. */
if (!*s)
@@ -2878,9 +2886,9 @@ get_word_from_string (stringp, separators, endptr)
This obeys the field splitting rules in Posix.2. */
sindex = 0;
- /* Don't need string length in ADVANCE_CHAR or string_extract_verbatim
- unless multibyte chars are possible. */
- slen = (MB_CUR_MAX > 1) ? STRLEN (s) : 1;
+ /* Don't need string length in ADVANCE_CHAR unless multibyte chars are
+ possible, but need it in string_extract_verbatim for bounds checking */
+ slen = STRLEN (s);
current_word = string_extract_verbatim (s, slen, &sindex, separators, xflags);
/* Set ENDPTR to the first character after the end of the word. */
@@ -2899,19 +2907,19 @@ get_word_from_string (stringp, separators, endptr)
/* Now skip sequences of space, tab, or newline characters if they are
in the list of separators. */
- while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex]))
+ while (s[sindex] && spctabnl (s[sindex]) && islocalsep (s[sindex]))
sindex++;
/* If the first separator was IFS whitespace and the current character is
a non-whitespace IFS character, it should be part of the current field
delimiter, not a separate delimiter that would result in an empty field.
Look at POSIX.2, 3.6.5, (3)(b). */
- if (s[sindex] && whitesep && isifs (s[sindex]) && !spctabnl (s[sindex]))
+ if (s[sindex] && whitesep && islocalsep (s[sindex]) && !spctabnl (s[sindex]))
{
sindex++;
/* An IFS character that is not IFS white space, along with any adjacent
IFS white space, shall delimit a field. */
- while (s[sindex] && spctabnl (s[sindex]) && isifs (s[sindex]))
+ while (s[sindex] && spctabnl (s[sindex]) && islocalsep(s[sindex]))
sindex++;
}
--
2.9.3

View File

@ -1,38 +0,0 @@
From 1aef9c7b55dcef4af239caf93e01419e1c8e04ad Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 29 Jan 2018 16:03:33 -0500
Subject: [PATCH] Bash-4.4 patch 13
---
patchlevel.h | 2 +-
redir.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/patchlevel.h b/patchlevel.h
index 93dbe0db..779671cd 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 12
+#define PATCHLEVEL 13
#endif /* _PATCHLEVEL_H_ */
diff --git a/redir.c b/redir.c
index 25488eaf..1858b0b0 100644
--- a/redir.c
+++ b/redir.c
@@ -469,6 +469,8 @@ here_document_to_fd (redirectee, ri)
return (fd);
}
+ SET_CLOSE_ON_EXEC (fd);
+
errno = r = 0; /* XXX */
/* write_here_document returns 0 on success, errno on failure. */
if (redirectee->word)
--
2.13.6

View File

@ -1,85 +0,0 @@
From 2fb21d75bfddd724b0e45d4a51455a166467e496 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 29 Jan 2018 16:03:47 -0500
Subject: [PATCH] Bash-4.4 patch 14
---
execute_cmd.c | 19 ++++++++++++++++---
patchlevel.h | 2 +-
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/execute_cmd.c b/execute_cmd.c
index 2a3df6d6..76a80766 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -726,6 +726,8 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
{
ofifo = num_fifos ();
ofifo_list = copy_fifo_list ((int *)&osize);
+ begin_unwind_frame ("internal_fifos");
+ add_unwind_protect (xfree, ofifo_list);
saved_fifo = 1;
}
else
@@ -741,7 +743,10 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
dispose_exec_redirects ();
#if defined (PROCESS_SUBSTITUTION)
if (saved_fifo)
- free ((void *)ofifo_list);
+ {
+ free ((void *)ofifo_list);
+ discard_unwind_frame ("internal_fifos");
+ }
#endif
return (last_command_exit_value = EXECUTION_FAILURE);
}
@@ -1060,6 +1065,7 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
if (nfifo > ofifo)
close_new_fifos ((char *)ofifo_list, osize);
free ((void *)ofifo_list);
+ discard_unwind_frame ("internal_fifos");
}
#endif
@@ -4977,9 +4983,14 @@ execute_builtin_or_function (words, builtin, var, redirects,
char *ofifo_list;
#endif
-#if defined (PROCESS_SUBSTITUTION)
+#if defined (PROCESS_SUBSTITUTION)
+ begin_unwind_frame ("saved_fifos");
+ /* If we return, we longjmp and don't get a chance to restore the old
+ fifo list, so we add an unwind protect to free it */
ofifo = num_fifos ();
ofifo_list = copy_fifo_list (&osize);
+ if (ofifo_list)
+ add_unwind_protect (xfree, ofifo_list);
#endif
if (do_redirections (redirects, RX_ACTIVE|RX_UNDOABLE) != 0)
@@ -5063,7 +5074,9 @@ execute_builtin_or_function (words, builtin, var, redirects,
nfifo = num_fifos ();
if (nfifo > ofifo)
close_new_fifos (ofifo_list, osize);
- free (ofifo_list);
+ if (ofifo_list)
+ free (ofifo_list);
+ discard_unwind_frame ("saved_fifos");
#endif
return (result);
diff --git a/patchlevel.h b/patchlevel.h
index 779671cd..09a3cc84 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 13
+#define PATCHLEVEL 14
#endif /* _PATCHLEVEL_H_ */
--
2.13.6

View File

@ -1,38 +0,0 @@
From 9cce630e80008e74fa9a1d9408367341caf363f2 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 29 Jan 2018 16:04:01 -0500
Subject: [PATCH] Bash-4.4 patch 15
---
patchlevel.h | 2 +-
subst.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/patchlevel.h b/patchlevel.h
index 09a3cc84..6e9ed3fc 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 14
+#define PATCHLEVEL 15
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index dbf0157e..fc00cab0 100644
--- a/subst.c
+++ b/subst.c
@@ -5906,6 +5906,8 @@ process_substitute (string, open_for_read_in_child)
parent. */
expanding_redir = 0;
+ remove_quoted_escapes (string);
+
subshell_level++;
result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST));
subshell_level--;
--
2.13.6

View File

@ -1,68 +0,0 @@
From c9f1b04651dae16e33f0aa8974c5122e26b362ae Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 29 Jan 2018 16:04:20 -0500
Subject: [PATCH] Bash-4.4 patch 16
---
lib/sh/zread.c | 23 +++++++++--------------
patchlevel.h | 2 +-
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/lib/sh/zread.c b/lib/sh/zread.c
index 868f9705..496f20b8 100644
--- a/lib/sh/zread.c
+++ b/lib/sh/zread.c
@@ -37,7 +37,10 @@ extern int errno;
# define SEEK_CUR 1
#endif
+extern int executing_builtin;
+
extern void check_signals_and_traps (void);
+extern void check_signals (void);
extern int signal_is_trapped (int);
/* Read LEN bytes from FD into BUF. Retry the read on EINTR. Any other
@@ -50,21 +53,13 @@ zread (fd, buf, len)
{
ssize_t r;
-#if 0
-#if defined (HAVE_SIGINTERRUPT)
- if (signal_is_trapped (SIGCHLD))
- siginterrupt (SIGCHLD, 1);
-#endif
-#endif
-
while ((r = read (fd, buf, len)) < 0 && errno == EINTR)
- check_signals_and_traps (); /* XXX - should it be check_signals()? */
-
-#if 0
-#if defined (HAVE_SIGINTERRUPT)
- siginterrupt (SIGCHLD, 0);
-#endif
-#endif
+ /* XXX - bash-5.0 */
+ /* We check executing_builtin and run traps here for backwards compatibility */
+ if (executing_builtin)
+ check_signals_and_traps (); /* XXX - should it be check_signals()? */
+ else
+ check_signals ();
return r;
}
diff --git a/patchlevel.h b/patchlevel.h
index 6e9ed3fc..9074f4dd 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 15
+#define PATCHLEVEL 16
#endif /* _PATCHLEVEL_H_ */
--
2.13.6

View File

@ -1,41 +0,0 @@
From b3a5ec8dd510a68dc850f3f516c0cf9afd87451f Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 29 Jan 2018 16:04:37 -0500
Subject: [PATCH] Bash-4.4 patch 17
---
builtins/read.def | 5 +++++
patchlevel.h | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/builtins/read.def b/builtins/read.def
index 33821f3f..803bea35 100644
--- a/builtins/read.def
+++ b/builtins/read.def
@@ -690,6 +690,11 @@ add_char:
input_string[i] = '\0';
CHECK_ALRM;
+#if defined (READLINE)
+ if (edit)
+ free (rlbuf);
+#endif
+
if (retval < 0)
{
t_errno = errno;
diff --git a/patchlevel.h b/patchlevel.h
index 9074f4dd..98e714da 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 16
+#define PATCHLEVEL 17
#endif /* _PATCHLEVEL_H_ */
--
2.13.6

View File

@ -1,38 +0,0 @@
From eb78197af36bb0fb95493ebf8fce104be6832ec9 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 29 Jan 2018 16:04:56 -0500
Subject: [PATCH] Bash-4.4 patch 18
---
builtins/read.def | 2 +-
patchlevel.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtins/read.def b/builtins/read.def
index 803bea35..b54b3af6 100644
--- a/builtins/read.def
+++ b/builtins/read.def
@@ -610,7 +610,7 @@ read_builtin (list)
}
CHECK_ALRM;
-
+ QUIT; /* in case we didn't call check_signals() */
#if defined (READLINE)
}
#endif
diff --git a/patchlevel.h b/patchlevel.h
index 98e714da..f0ee56e4 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 17
+#define PATCHLEVEL 18
#endif /* _PATCHLEVEL_H_ */
--
2.13.6

View File

@ -1,40 +0,0 @@
From b0776d8c49ab4310fa056ce1033985996c5b9807 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Tue, 6 Feb 2018 16:22:34 -0500
Subject: [PATCH] Bash-4.4 patch 19
---
lib/readline/display.c | 4 +++-
patchlevel.h | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/readline/display.c b/lib/readline/display.c
index 41fb0531..2d2e768a 100644
--- a/lib/readline/display.c
+++ b/lib/readline/display.c
@@ -771,7 +771,9 @@ rl_redisplay ()
appear in the first and last lines of the prompt */
wadjust = (newlines == 0)
? prompt_invis_chars_first_line
- : ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line);
+ : ((newlines == prompt_lines_estimate)
+ ? (wrap_offset - prompt_invis_chars_first_line)
+ : 0);
/* fix from Darin Johnson <darin@acuson.com> for prompt string with
invisible characters that is longer than the screen width. The
diff --git a/patchlevel.h b/patchlevel.h
index f0ee56e4..a711c495 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 18
+#define PATCHLEVEL 19
#endif /* _PATCHLEVEL_H_ */
--
2.13.6

View File

@ -1,59 +0,0 @@
From 280bd77d8d3e7f7c90c9fa07de3d1e8f8e18ac29 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 14 Nov 2016 14:27:06 -0500
Subject: [PATCH] Bash-4.4 patch 2
---
patchlevel.h | 2 +-
subst.c | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/patchlevel.h b/patchlevel.h
index 40db1a3..a988d85 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 1
+#define PATCHLEVEL 2
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index f1a4df1..4d498ef 100644
--- a/subst.c
+++ b/subst.c
@@ -5931,6 +5931,7 @@ read_comsub (fd, quoted, rflag)
char *istring, buf[128], *bufp, *s;
int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul;
ssize_t bufn;
+ int nullbyte;
istring = (char *)NULL;
istring_index = istring_size = bufn = tflag = 0;
@@ -5938,6 +5939,8 @@ read_comsub (fd, quoted, rflag)
for (skip_ctlesc = skip_ctlnul = 0, s = ifs_value; s && *s; s++)
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. */
while (1)
@@ -5956,7 +5959,11 @@ read_comsub (fd, quoted, rflag)
if (c == 0)
{
#if 1
- internal_warning ("%s", _("command substitution: ignored null byte in input"));
+ if (nullbyte == 0)
+ {
+ internal_warning ("%s", _("command substitution: ignored null byte in input"));
+ nullbyte = 1;
+ }
#endif
continue;
}
--
2.9.3

View File

@ -1,136 +0,0 @@
From 354efb96f1e4574f458e994163bbe31c76769573 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 1 Jun 2018 10:19:56 -0400
Subject: [PATCH] saved background process status hash table loop fixes
---
jobs.c | 62 +++++++++++++++++++++++++++++++++++++++++-----------
patchlevel.h | 2 +-
2 files changed, 50 insertions(+), 14 deletions(-)
diff --git a/jobs.c b/jobs.c
index fc966036..2684632d 100644
--- a/jobs.c
+++ b/jobs.c
@@ -812,8 +812,22 @@ bgp_add (pid, status)
ps_index_t *bucket, psi;
struct pidstat *ps;
- bucket = pshash_getbucket (pid);
- psi = bgp_getindex ();
+ /* bucket == existing chain of pids hashing to same value
+ psi = where were going to put this pid/status */
+
+ bucket = pshash_getbucket (pid); /* index into pidstat_table */
+ psi = bgp_getindex (); /* bgpids.head, index into storage */
+
+ /* XXX - what if psi == *bucket? */
+ if (psi == *bucket)
+ {
+#ifdef DEBUG
+ internal_warning ("hashed pid %d (pid %d) collides with bgpids.head, skipping", psi, pid);
+#endif
+ bgpids.storage[psi].pid = NO_PID; /* make sure */
+ psi = bgp_getindex (); /* skip to next one */
+ }
+
ps = &bgpids.storage[psi];
ps->pid = pid;
@@ -841,32 +855,47 @@ pshash_delindex (psi)
ps_index_t psi;
{
struct pidstat *ps;
+ ps_index_t *bucket;
ps = &bgpids.storage[psi];
if (ps->pid == NO_PID)
return;
- if (ps->bucket_next != NO_PID)
+ if (ps->bucket_next != NO_PIDSTAT)
bgpids.storage[ps->bucket_next].bucket_prev = ps->bucket_prev;
- if (ps->bucket_prev != NO_PID)
+ if (ps->bucket_prev != NO_PIDSTAT)
bgpids.storage[ps->bucket_prev].bucket_next = ps->bucket_next;
else
- *(pshash_getbucket (ps->pid)) = ps->bucket_next;
+ {
+ bucket = pshash_getbucket (ps->pid);
+ *bucket = ps->bucket_next; /* deleting chain head in hash table */
+ }
+
+ /* clear out this cell, just in case */
+ ps->pid = NO_PID;
+ ps->bucket_next = ps->bucket_prev = NO_PIDSTAT;
}
static int
bgp_delete (pid)
pid_t pid;
{
- ps_index_t psi;
+ ps_index_t psi, orig_psi;
if (bgpids.storage == 0 || bgpids.nalloc == 0 || bgpids.npid == 0)
return 0;
/* Search chain using hash to find bucket in pidstat_table */
- for (psi = *(pshash_getbucket (pid)); psi != NO_PIDSTAT; psi = bgpids.storage[psi].bucket_next)
- if (bgpids.storage[psi].pid == pid)
- break;
+ for (orig_psi = psi = *(pshash_getbucket (pid)); psi != NO_PIDSTAT; psi = bgpids.storage[psi].bucket_next)
+ {
+ if (bgpids.storage[psi].pid == pid)
+ break;
+ if (orig_psi == bgpids.storage[psi].bucket_next) /* catch reported bug */
+ {
+ internal_warning ("bgp_delete: LOOP: psi (%d) == storage[psi].bucket_next", psi);
+ return 0;
+ }
+ }
if (psi == NO_PIDSTAT)
return 0; /* not found */
@@ -904,15 +933,22 @@ static int
bgp_search (pid)
pid_t pid;
{
- ps_index_t psi;
+ ps_index_t psi, orig_psi;
if (bgpids.storage == 0 || bgpids.nalloc == 0 || bgpids.npid == 0)
return -1;
/* Search chain using hash to find bucket in pidstat_table */
- for (psi = *(pshash_getbucket (pid)); psi != NO_PIDSTAT; psi = bgpids.storage[psi].bucket_next)
- if (bgpids.storage[psi].pid == pid)
- return (bgpids.storage[psi].status);
+ for (orig_psi = psi = *(pshash_getbucket (pid)); psi != NO_PIDSTAT; psi = bgpids.storage[psi].bucket_next)
+ {
+ if (bgpids.storage[psi].pid == pid)
+ return (bgpids.storage[psi].status);
+ if (orig_psi == bgpids.storage[psi].bucket_next) /* catch reported bug */
+ {
+ internal_warning ("bgp_search: LOOP: psi (%d) == storage[psi].bucket_next", psi);
+ return -1;
+ }
+ }
return -1;
}
diff --git a/patchlevel.h b/patchlevel.h
index a711c495..4a65dc0f 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 19
+#define PATCHLEVEL 20
#endif /* _PATCHLEVEL_H_ */
--
2.29.2

View File

@ -1,52 +0,0 @@
From 4f59a8babc53a9f975078c4a003bdc8831c5ee22 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 14 Nov 2016 14:27:23 -0500
Subject: [PATCH] Bash-4.4 patch 3
---
lib/glob/sm_loop.c | 9 +++++++++
patchlevel.h | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/lib/glob/sm_loop.c b/lib/glob/sm_loop.c
index c3a2aa3..65179e2 100644
--- a/lib/glob/sm_loop.c
+++ b/lib/glob/sm_loop.c
@@ -330,6 +330,12 @@ PARSE_COLLSYM (p, vp)
for (pc = 0; p[pc]; pc++)
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)
*vp = val;
@@ -483,6 +489,9 @@ BRACKMATCH (p, test, flags)
c = *p++;
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. */
return (CHAR *)0;
diff --git a/patchlevel.h b/patchlevel.h
index a988d85..e7e960c 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 2
+#define PATCHLEVEL 3
#endif /* _PATCHLEVEL_H_ */
--
2.9.3

View File

@ -1,81 +0,0 @@
From 2965eca924466a48c5597ac5c6c86d470e718908 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 14 Nov 2016 14:27:35 -0500
Subject: [PATCH] Bash-4.4 patch 4
---
jobs.c | 15 +++++++++++++++
jobs.h | 1 +
patchlevel.h | 2 +-
subst.c | 5 +----
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/jobs.c b/jobs.c
index cef3c79..fc96603 100644
--- a/jobs.c
+++ b/jobs.c
@@ -453,6 +453,21 @@ cleanup_the_pipeline ()
discard_pipeline (disposer);
}
+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 ()
{
diff --git a/jobs.h b/jobs.h
index 4ba3513..6df0607 100644
--- a/jobs.h
+++ b/jobs.h
@@ -190,6 +190,7 @@ extern JOB **jobs;
extern void making_children __P((void));
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));
extern void start_pipeline __P((void));
diff --git a/patchlevel.h b/patchlevel.h
index e7e960c..c059f0b 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 3
+#define PATCHLEVEL 4
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index 4d498ef..298187d 100644
--- a/subst.c
+++ b/subst.c
@@ -5808,10 +5808,7 @@ process_substitute (string, open_for_read_in_child)
{
#if defined (JOB_CONTROL)
if (last_procsub_child)
- {
- discard_pipeline (last_procsub_child);
- last_procsub_child = (PROCESS *)NULL;
- }
+ discard_last_procsub_child ();
last_procsub_child = restore_pipeline (0);
#endif
--
2.9.3

View File

@ -1,42 +0,0 @@
From f459cbd8be37b28be1dc90315e0ab51d7f211301 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Mon, 14 Nov 2016 14:27:55 -0500
Subject: [PATCH] Bash-4.4 patch 5
---
builtins/evalstring.c | 3 ---
patchlevel.h | 2 +-
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/builtins/evalstring.c b/builtins/evalstring.c
index e221591..6dc756c 100644
--- a/builtins/evalstring.c
+++ b/builtins/evalstring.c
@@ -104,12 +104,9 @@ should_suppress_fork (command)
running_trap == 0 &&
*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) &&
((command->flags & CMD_INVERT_RETURN) == 0));
diff --git a/patchlevel.h b/patchlevel.h
index c059f0b..1bc098b 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 4
+#define PATCHLEVEL 5
#endif /* _PATCHLEVEL_H_ */
--
2.9.3

View File

@ -1,50 +0,0 @@
From 44bfefc553993613c0aff992bc4f3078d738ee1d Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 20 Jan 2017 11:47:31 -0500
Subject: [PATCH] Bash-4.4 patch 6
---
builtins/pushd.def | 7 ++++++-
patchlevel.h | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/builtins/pushd.def b/builtins/pushd.def
index 82653c4..6579e4c 100644
--- a/builtins/pushd.def
+++ b/builtins/pushd.def
@@ -365,7 +365,7 @@ popd_builtin (list)
break;
}
- if (which > directory_list_offset || (directory_list_offset == 0 && which == 0))
+ if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0))
{
pushd_error (directory_list_offset, which_word ? which_word : "");
return (EXECUTION_FAILURE);
@@ -387,6 +387,11 @@ popd_builtin (list)
remove that directory from the list and shift the remainder
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--;
diff --git a/patchlevel.h b/patchlevel.h
index 1bc098b..14bff9f 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 5
+#define PATCHLEVEL 6
#endif /* _PATCHLEVEL_H_ */
--
2.9.3

View File

@ -1,114 +0,0 @@
From 4f747edc625815f449048579f6e65869914dd715 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 20 Jan 2017 11:47:55 -0500
Subject: [PATCH] Bash-4.4 patch 7
---
bashline.c | 22 ++++++++++++----------
patchlevel.h | 2 +-
subst.c | 4 ++++
3 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/bashline.c b/bashline.c
index f4fe9f1..0275844 100644
--- a/bashline.c
+++ b/bashline.c
@@ -142,7 +142,7 @@ static int executable_completion __P((const char *, int));
static rl_icppfunc_t *save_directory_hook __P((void));
static void restore_directory_hook __P((rl_icppfunc_t));
-static int directory_exists __P((const char *));
+static int directory_exists __P((const char *, int));
static void cleanup_expansion_error __P((void));
static void maybe_make_readline_line __P((char *));
@@ -3102,18 +3102,20 @@ restore_directory_hook (hookf)
rl_directory_rewrite_hook = hookf;
}
-/* Check whether not the (dequoted) version of DIRNAME, with any trailing slash
- removed, exists. */
+/* Check whether not DIRNAME, with any trailing slash removed, exists. If
+ SHOULD_DEQUOTE is non-zero, we dequote the directory name first. */
static int
-directory_exists (dirname)
+directory_exists (dirname, should_dequote)
const char *dirname;
+ int should_dequote;
{
char *new_dirname;
int dirlen, r;
struct stat sb;
- /* First, dequote the directory name */
- new_dirname = bash_dequote_filename ((char *)dirname, rl_completion_quote_character);
+ /* We save the string and chop the trailing slash because stat/lstat behave
+ inconsistently if one is present. */
+ new_dirname = should_dequote ? bash_dequote_filename ((char *)dirname, rl_completion_quote_character) : savestring (dirname);
dirlen = STRLEN (new_dirname);
if (new_dirname[dirlen - 1] == '/')
new_dirname[dirlen - 1] = '\0';
@@ -3145,7 +3147,7 @@ bash_filename_stat_hook (dirname)
else if (t = mbschr (local_dirname, '`')) /* XXX */
should_expand_dirname = '`';
- if (should_expand_dirname && directory_exists (local_dirname))
+ if (should_expand_dirname && directory_exists (local_dirname, 0))
should_expand_dirname = 0;
if (should_expand_dirname)
@@ -3155,7 +3157,7 @@ bash_filename_stat_hook (dirname)
have to worry about restoring this setting. */
global_nounset = unbound_vars_is_error;
unbound_vars_is_error = 0;
- wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_COMPLETE); /* does the right thing */
+ wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_NOPROCSUB|W_COMPLETE); /* does the right thing */
unbound_vars_is_error = global_nounset;
if (wl)
{
@@ -3244,13 +3246,13 @@ bash_directory_completion_hook (dirname)
should_expand_dirname = '`';
}
- if (should_expand_dirname && directory_exists (local_dirname))
+ if (should_expand_dirname && directory_exists (local_dirname, 1))
should_expand_dirname = 0;
if (should_expand_dirname)
{
new_dirname = savestring (local_dirname);
- wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_COMPLETE); /* does the right thing */
+ wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_NOPROCSUB|W_COMPLETE); /* does the right thing */
if (wl)
{
*dirname = string_list (wl);
diff --git a/patchlevel.h b/patchlevel.h
index 14bff9f..deb9c5b 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 6
+#define PATCHLEVEL 7
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index 298187d..027a13e 100644
--- a/subst.c
+++ b/subst.c
@@ -9458,6 +9458,10 @@ add_twochars:
tword->flags |= word->flags & (W_ASSIGNARG|W_ASSIGNRHS); /* affects $@ */
if (word->flags & W_COMPLETE)
tword->flags |= W_COMPLETE; /* for command substitutions */
+ if (word->flags & W_NOCOMSUB)
+ tword->flags |= W_NOCOMSUB;
+ if (word->flags & W_NOPROCSUB)
+ tword->flags |= W_NOPROCSUB;
temp = (char *)NULL;
--
2.9.3

View File

@ -1,71 +0,0 @@
From b9f81c2977b82490cd4dc70b0bb292bfbf86bd2c Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 20 Jan 2017 15:38:10 -0500
Subject: [PATCH] Bash-4.4 patch 8
---
expr.c | 15 +++++++++------
patchlevel.h | 2 +-
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/expr.c b/expr.c
index 1ddb693..172964a 100644
--- a/expr.c
+++ b/expr.c
@@ -578,24 +578,23 @@ expcond ()
rval = cval = explor ();
if (curtok == QUES) /* found conditional expr */
{
- readtok ();
- if (curtok == 0 || curtok == COL)
- evalerror (_("expression expected"));
if (cval == 0)
{
set_noeval = 1;
noeval++;
}
+ readtok ();
+ if (curtok == 0 || curtok == COL)
+ evalerror (_("expression expected"));
+
val1 = EXP_HIGHEST ();
if (set_noeval)
noeval--;
if (curtok != COL)
evalerror (_("`:' expected for conditional expression"));
- readtok ();
- if (curtok == 0)
- evalerror (_("expression expected"));
+
set_noeval = 0;
if (cval)
{
@@ -603,7 +602,11 @@ expcond ()
noeval++;
}
+ readtok ();
+ if (curtok == 0)
+ evalerror (_("expression expected"));
val2 = expcond ();
+
if (set_noeval)
noeval--;
rval = cval ? val1 : val2;
diff --git a/patchlevel.h b/patchlevel.h
index deb9c5b..16c8740 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 7
+#define PATCHLEVEL 8
#endif /* _PATCHLEVEL_H_ */
--
2.9.3

View File

@ -1,80 +0,0 @@
From e59fb114e9c0436890d110cfdda4d794a63496e7 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Fri, 20 Jan 2017 15:38:29 -0500
Subject: [PATCH] Bash-4.4 patch 9
---
lib/readline/history.c | 16 +++++++---------
patchlevel.h | 2 +-
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/lib/readline/history.c b/lib/readline/history.c
index 9ff25a7..129c57a 100644
--- a/lib/readline/history.c
+++ b/lib/readline/history.c
@@ -279,6 +279,7 @@ add_history (string)
const char *string;
{
HIST_ENTRY *temp;
+ int new_length;
if (history_stifled && (history_length == history_max_entries))
{
@@ -295,13 +296,9 @@ add_history (string)
/* Copy the rest of the entries, moving down one slot. Copy includes
trailing NULL. */
-#if 0
- for (i = 0; i < history_length; i++)
- the_history[i] = the_history[i + 1];
-#else
memmove (the_history, the_history + 1, history_length * sizeof (HIST_ENTRY *));
-#endif
+ new_length = history_length;
history_base++;
}
else
@@ -315,7 +312,7 @@ add_history (string)
else
history_size = DEFAULT_HISTORY_INITIAL_SIZE;
the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
- history_length = 1;
+ new_length = 1;
}
else
{
@@ -325,14 +322,15 @@ add_history (string)
the_history = (HIST_ENTRY **)
xrealloc (the_history, history_size * sizeof (HIST_ENTRY *));
}
- history_length++;
+ new_length = history_length + 1;
}
}
temp = alloc_history_entry ((char *)string, hist_inittime ());
- the_history[history_length] = (HIST_ENTRY *)NULL;
- the_history[history_length - 1] = temp;
+ the_history[new_length] = (HIST_ENTRY *)NULL;
+ the_history[new_length - 1] = temp;
+ history_length = new_length;
}
/* Change the time stamp of the most recent history entry to STRING. */
diff --git a/patchlevel.h b/patchlevel.h
index 16c8740..02f1d60 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 8
+#define PATCHLEVEL 9
#endif /* _PATCHLEVEL_H_ */
--
2.9.3

View File

@ -1,11 +0,0 @@
diff --git a/parse.y b/parse.y
index 85f1c4f..9d1cdf8 100644
--- a/parse.y
+++ b/parse.y
@@ -1453,6 +1453,7 @@ yy_readline_get ()
old_sigint = (SigHandler *)set_signal_handler (SIGINT, sigint_sighandler);
}
+ sh_unset_nodelay_mode (fileno (rl_instream)); /* just in case */
current_readline_line = readline (current_readline_prompt ?
current_readline_prompt : "");

View File

@ -1,11 +0,0 @@
diff --git a/config.h.in b/config.h.in
--- a/config.h.in
+++ b/config.h.in
@@ -449,6 +449,7 @@
#undef SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
#undef PTHREAD_H_DEFINES_STRUCT_TIMESPEC
+#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
#undef HAVE_STRUCT_STAT_ST_ATIMENSEC

View File

@ -1,95 +0,0 @@
diff --git a/include/typemax.h b/include/typemax.h
--- a/include/typemax.h
+++ b/include/typemax.h
@@ -35,14 +35,23 @@
# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
#endif
+#ifndef TYPE_SIGNED_MAGNITUDE
+# define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
+#endif
+
+#ifndef TYPE_WIDTH
+# define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
+#endif
+
#ifndef TYPE_MINIMUM
-# define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
- ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \
- : (t) 0))
+# define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
#endif
#ifndef TYPE_MAXIMUM
-# define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
+# define TYPE_MAXIMUM(t) \
+ ((t) (! TYPE_SIGNED (t) \
+ ? (t) -1 \
+ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
#endif
#ifdef HAVE_LONG_LONG
diff --git a/jobs.c b/jobs.c
--- a/jobs.c
+++ b/jobs.c
@@ -72,6 +72,8 @@
#include "execute_cmd.h"
#include "flags.h"
+#include "typemax.h"
+
#include "builtins/builtext.h"
#include "builtins/common.h"
@@ -92,7 +94,7 @@ extern int killpg __P((pid_t, int));
#endif
#if !MAX_CHILD_MAX
-# define MAX_CHILD_MAX 8192
+# define MAX_CHILD_MAX 32768
#endif
#if !defined (DEBUG)
@@ -751,7 +753,7 @@ stop_pipeline (async, deferred)
static void
bgp_resize ()
{
- ps_index_t nsize;
+ ps_index_t nsize, nsize_cur, nsize_max;
ps_index_t psi;
if (bgpids.nalloc == 0)
@@ -765,11 +767,20 @@ bgp_resize ()
else
nsize = bgpids.nalloc;
- while (nsize < js.c_childmax)
- nsize *= 2;
+ nsize_max = TYPE_MAXIMUM (ps_index_t);
+ nsize_cur = (ps_index_t)js.c_childmax;
+ if (nsize_cur < 0) /* overflow */
+ nsize_cur = MAX_CHILD_MAX;
- if (bgpids.nalloc < js.c_childmax)
- {
+ while (nsize > 0 && nsize < nsize_cur) /* > 0 should catch overflow */
+ nsize <<= 1;
+ if (nsize > nsize_max || nsize <= 0) /* overflow? */
+ nsize = nsize_max;
+ if (nsize > MAX_CHILD_MAX)
+ nsize = nsize_max = MAX_CHILD_MAX; /* hard cap */
+
+ if (bgpids.nalloc < nsize_cur && bgpids.nalloc < nsize_max)
+ {
bgpids.storage = (struct pidstat *)xrealloc (bgpids.storage, nsize * sizeof (struct pidstat));
for (psi = bgpids.nalloc; psi < nsize; psi++)
@@ -787,7 +798,7 @@ bgp_getindex ()
{
ps_index_t psi;
- if (bgpids.nalloc < js.c_childmax || bgpids.head >= bgpids.nalloc)
+ if (bgpids.nalloc < (ps_index_t)js.c_childmax || bgpids.head >= bgpids.nalloc)
bgp_resize ();
pshash_delindex (bgpids.head); /* XXX - clear before reusing */

View File

@ -1,41 +0,0 @@
diff --git a/configure.ac b/configure.ac
index e5162c4..b82a33b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -799,10 +799,13 @@ AC_CHECK_DECLS([confstr])
AC_CHECK_DECLS([printf])
AC_CHECK_DECLS([sbrk])
AC_CHECK_DECLS([setregid])
-AC_CHECK_DECLS[(setresuid, setresgid])
+dnl AC_CHECK_DECLS[(setresuid])
+dnl AC_CHECK_DECLS[(setresgid])
AC_CHECK_DECLS([strcpy])
AC_CHECK_DECLS([strsignal])
+AC_CHECK_FUNCS(setresuid setresgid)
+
dnl Extra test to detect the horribly broken HP/UX 11.00 strtold(3)
AC_CHECK_DECLS([strtold], [
AC_MSG_CHECKING([for broken strtold])
diff --git a/shell.c b/shell.c
index 484d8a9..5c24922 100644
--- a/shell.c
+++ b/shell.c
@@ -1286,7 +1286,7 @@ disable_priv_mode ()
{
int e;
-#if HAVE_DECL_SETRESUID
+#if HAVE_SETRESUID
if (setresuid (current_user.uid, current_user.uid, current_user.uid) < 0)
#else
if (setuid (current_user.uid) < 0)
@@ -1299,7 +1299,7 @@ disable_priv_mode ()
exit (e);
#endif
}
-#if HAVE_DECL_SETRESGID
+#if HAVE_SETRESGID
if (setresgid (current_user.gid, current_user.gid, current_user.gid) < 0)
#else
if (setgid (current_user.gid) < 0)

View File

@ -1,61 +0,0 @@
diff --git a/config.h.in b/config.h.in
index 1a89e85..2df4786 100644
--- a/config.h.in
+++ b/config.h.in
@@ -801,6 +801,14 @@
#undef HAVE_SETREGID
#undef HAVE_DECL_SETREGID
+/* Define if you have the setregid function. */
+#undef HAVE_SETRESGID
+#undef HAVE_DECL_SETRESGID
+
+/* Define if you have the setresuid function. */
+#undef HAVE_SETRESUID
+#undef HAVE_DECL_SETRESUID
+
/* Define if you have the setvbuf function. */
#undef HAVE_SETVBUF
diff --git a/configure.ac b/configure.ac
index a3f6d8f..e5162c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -799,6 +799,7 @@ AC_CHECK_DECLS([confstr])
AC_CHECK_DECLS([printf])
AC_CHECK_DECLS([sbrk])
AC_CHECK_DECLS([setregid])
+AC_CHECK_DECLS[(setresuid, setresgid])
AC_CHECK_DECLS([strcpy])
AC_CHECK_DECLS([strsignal])
diff --git a/shell.c b/shell.c
index 4aae182..484d8a9 100644
--- a/shell.c
+++ b/shell.c
@@ -1286,7 +1286,11 @@ disable_priv_mode ()
{
int e;
+#if HAVE_DECL_SETRESUID
+ if (setresuid (current_user.uid, current_user.uid, current_user.uid) < 0)
+#else
if (setuid (current_user.uid) < 0)
+#endif
{
e = errno;
sys_error (_("cannot set uid to %d: effective uid %d"), current_user.uid, current_user.euid);
@@ -1295,7 +1299,11 @@ disable_priv_mode ()
exit (e);
#endif
}
+#if HAVE_DECL_SETRESGID
+ if (setresgid (current_user.gid, current_user.gid, current_user.gid) < 0)
+#else
if (setgid (current_user.gid) < 0)
+#endif
sys_error (_("cannot set gid to %d: effective gid %d"), current_user.gid, current_user.egid);
current_user.euid = current_user.uid;
--
2.25.4

View File

@ -1,19 +0,0 @@
diff --git a/builtins/history.def b/builtins/history.def
--- a/builtins/history.def
+++ b/builtins/history.def
@@ -256,10 +256,13 @@ histtime (hlist, histtimefmt)
{
static char timestr[128];
time_t t;
+ struct tm *tm;
t = history_get_time (hlist);
- if (t)
- strftime (timestr, sizeof (timestr), histtimefmt, localtime (&t));
+
+ tm = t ? localtime (&t) : 0;
+ if (t && tm)
+ strftime (timestr, sizeof (timestr), histtimefmt, tm);
else if (hlist->timestamp && hlist->timestamp[0])
snprintf (timestr, sizeof (timestr), _("%s: invalid timestamp"),
(hlist->timestamp[0] == '#') ? hlist->timestamp + 1: hlist->timestamp);

View File

@ -1,12 +0,0 @@
diff --git a/parse.y b/parse.y
--- a/parse.y
+++ b/parse.y
@@ -4193,7 +4193,7 @@ eof_error:
FREE (nestret);
}
- if MBTEST(ch == '$')
+ if MBTEST(ch == '$' && (tflags & LEX_WASDOL) == 0)
tflags |= LEX_WASDOL;
else
tflags &= ~LEX_WASDOL;

View File

@ -1,84 +0,0 @@
diff --git a/bashhist.c b/bashhist.c
index 9979f99..793c81f 100644
--- a/bashhist.c
+++ b/bashhist.c
@@ -754,6 +754,12 @@ extern char *shell_name;
#define OPENLOG_OPTS 0
#endif
+#if defined (SYSLOG_SHOPT)
+int syslog_history = SYSLOG_SHOPT;
+#else
+int syslog_history = 1;
+#endif
+
void
bash_syslog_history (line)
const char *line;
@@ -851,7 +857,8 @@ bash_add_history (line)
really_add_history (line);
#if defined (SYSLOG_HISTORY)
- bash_syslog_history (line);
+ if (syslog_history)
+ bash_syslog_history (line);
#endif
using_history ();
diff --git a/builtins/shopt.def b/builtins/shopt.def
index 2febb7e..38c398e 100644
--- a/builtins/shopt.def
+++ b/builtins/shopt.def
@@ -118,6 +118,10 @@ extern char *shell_name;
extern int debugging_mode;
#endif
+#if defined (SYSLOG_HISTORY) && defined (SYSLOG_SHOPT)
+extern int syslog_history;
+#endif
+
static void shopt_error __P((char *));
static int set_shellopts_after_change __P((char *, int));
@@ -223,6 +227,9 @@ static struct {
#endif
{ "shift_verbose", &print_shift_error, (shopt_set_func_t *)NULL },
{ "sourcepath", &source_uses_path, (shopt_set_func_t *)NULL },
+#if defined (SYSLOG_HISTORY) && defined (SYSLOG_SHOPT)
+ { "syslog_history", &syslog_history, (shopt_set_func_t *)NULL },
+#endif
{ "xpg_echo", &xpg_echo, (shopt_set_func_t *)NULL },
{ (char *)0, (int *)0, (shopt_set_func_t *)NULL }
};
diff --git a/config-top.h b/config-top.h
index cb0e002..39cf6b5 100644
--- a/config-top.h
+++ b/config-top.h
@@ -122,6 +122,13 @@
# define OPENLOG_OPTS LOG_PID
#endif
+/* Define if you want syslogging history to be controllable at runtime via a
+ shell option; if defined, the value is the default for the syslog_history
+ shopt option */
+#if defined (SYSLOG_HISTORY)
+#define SYSLOG_SHOPT 0
+#endif
+
/* Define if you want to include code in shell.c to support wordexp(3) */
/* #define WORDEXP_OPTION */
diff --git a/doc/bash.1 b/doc/bash.1
index d6cee1d..9dfa0b3 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -9889,6 +9889,9 @@ If set, the
to find the directory containing the file supplied as an argument.
This option is enabled by default.
.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.

16
STAGE1-bash Normal file
View File

@ -0,0 +1,16 @@
srpm bash
mcd $BUILDDIR/bash
cat <<EOF > config.cache
bash_cv_func_ctype_nonascii=yes
bash_cv_opendir_not_robust=no
bash_cv_ulimit_maxfds=yes
bash_cv_func_sigsetjmp=present
bash_cv_printf_a_format=yes
bash_cv_job_control_missing=present
bash_cv_sys_named_pipes=present
bash_cv_unusable_rtsigs=no
EOF
$SRC/bash-*/configure --prefix=/ --cache-file=config.cache --build=$BUILD --host=$TARGET
make $J
make $J install DESTDIR=${ROOTFS}
(cd $ROOTFS/bin; ln -sf bash sh)

View File

@ -1,8 +1,8 @@
diff --git a/config.h.in b/config.h.in diff --git a/config.h.in b/config.h.in
index a5ad9e7..62a6b32 100644 index ab316d4..11d1d68 100644
--- a/config.h.in --- a/config.h.in
+++ b/config.h.in +++ b/config.h.in
@@ -748,6 +748,9 @@ @@ -775,6 +775,9 @@
/* Define if you have the pselect function. */ /* Define if you have the pselect function. */
#undef HAVE_PSELECT #undef HAVE_PSELECT
@ -12,7 +12,7 @@ index a5ad9e7..62a6b32 100644
/* Define if you have the putenv function. */ /* Define if you have the putenv function. */
#undef HAVE_PUTENV #undef HAVE_PUTENV
@@ -946,6 +949,9 @@ @@ -981,6 +984,9 @@
/* Define if you have the <dlfcn.h> header file. */ /* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H #undef HAVE_DLFCN_H
@ -23,29 +23,20 @@ index a5ad9e7..62a6b32 100644
#undef HAVE_GRP_H #undef HAVE_GRP_H
diff --git a/configure.ac b/configure.ac diff --git a/configure.ac b/configure.ac
index ce4e9b6..eda95d6 100644 index 2fe3e7d..f1b7f1b 100644
--- a/configure.ac --- a/configure.ac
+++ b/configure.ac +++ b/configure.ac
@@ -700,7 +700,7 @@ BASH_HEADER_INTTYPES @@ -827,7 +827,7 @@ dnl checks for system calls
AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \ AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getentropy getgroups \
memory.h locale.h termcap.h termio.h termios.h dlfcn.h \ gethostname getpagesize getpeername getrandom getrlimit \
stdbool.h stddef.h stdint.h netdb.h pwd.h grp.h strings.h \ getrusage gettimeofday kill killpg lstat pselect readlink \
- regex.h syslog.h ulimit.h) - select setdtablesize setitimer tcgetpgrp uname ulimit waitpid)
+ regex.h syslog.h ulimit.h elf.h) + select setdtablesize setitimer tcgetpgrp uname ulimit waitpid pread)
AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h sys/ioctl.h \
sys/param.h sys/socket.h sys/stat.h \
sys/time.h sys/times.h sys/types.h sys/wait.h)
@@ -771,7 +771,7 @@ dnl checks for system calls
AC_CHECK_FUNCS(dup2 eaccess fcntl getdtablesize getgroups gethostname \
getpagesize getpeername getrlimit getrusage gettimeofday \
kill killpg lstat pselect readlink sbrk select setdtablesize \
- setitimer tcgetpgrp uname ulimit waitpid)
+ setitimer tcgetpgrp uname ulimit waitpid pread)
AC_REPLACE_FUNCS(rename) AC_REPLACE_FUNCS(rename)
dnl checks for c library functions dnl checks for c library functions
diff --git a/execute_cmd.c b/execute_cmd.c diff --git a/execute_cmd.c b/execute_cmd.c
index 2a3df6d..b5cd405 100644 index d2a0dd7..d2555ad 100644
--- a/execute_cmd.c --- a/execute_cmd.c
+++ b/execute_cmd.c +++ b/execute_cmd.c
@@ -41,6 +41,10 @@ @@ -41,6 +41,10 @@
@ -59,7 +50,7 @@ index 2a3df6d..b5cd405 100644
#include "posixtime.h" #include "posixtime.h"
#if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE) #if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE)
@@ -5486,6 +5490,14 @@ shell_execve (command, args, env) @@ -5832,6 +5836,14 @@ shell_execve (command, args, env)
{ {
/* The file has the execute bits set, but the kernel refuses to /* The file has the execute bits set, but the kernel refuses to
run it for some reason. See why. */ run it for some reason. See why. */
@ -74,7 +65,7 @@ index 2a3df6d..b5cd405 100644
#if defined (HAVE_HASH_BANG_EXEC) #if defined (HAVE_HASH_BANG_EXEC)
READ_SAMPLE_BUF (command, sample, sample_len); READ_SAMPLE_BUF (command, sample, sample_len);
if (sample_len > 0) if (sample_len > 0)
@@ -5495,6 +5507,7 @@ shell_execve (command, args, env) @@ -5841,6 +5853,7 @@ shell_execve (command, args, env)
char *interp; char *interp;
int ilen; int ilen;
@ -82,10 +73,11 @@ index 2a3df6d..b5cd405 100644
interp = getinterp (sample, sample_len, (int *)NULL); interp = getinterp (sample, sample_len, (int *)NULL);
ilen = strlen (interp); ilen = strlen (interp);
errno = i; errno = i;
@@ -5510,6 +5523,136 @@ shell_execve (command, args, env) @@ -5856,7 +5869,138 @@ shell_execve (command, args, env)
return (EX_NOEXEC); return (EX_NOEXEC);
} }
#endif #endif
- errno = i;
+#if defined (HAVE_ELF_H) +#if defined (HAVE_ELF_H)
+ if (i == ENOENT + if (i == ENOENT
+ && sample_len > EI_NIDENT + && sample_len > EI_NIDENT
@ -216,9 +208,8 @@ index 2a3df6d..b5cd405 100644
+#if defined (HAVE_HASH_BANG_EXEC) || defined (HAVE_ELF_H) +#if defined (HAVE_HASH_BANG_EXEC) || defined (HAVE_ELF_H)
+ close (fd); + close (fd);
+#endif +#endif
errno = i; +
+ errno = i;
file_error (command); file_error (command);
} }
-- return (last_command_exit_value);
2.9.3

View File

@ -1,12 +1,13 @@
diff -up bash-4.0/config-top.h.ssh_source_bash bash-4.0/config-top.h diff --git a/config-top.h b/config-top.h
--- bash-4.0/config-top.h.ssh_source_bash 2009-01-21 15:20:06.000000000 +0100 index e5cc147..f5e0a52 100644
+++ bash-4.0/config-top.h 2009-01-21 15:25:46.000000000 +0100 --- a/config-top.h
@@ -90,7 +90,7 @@ +++ b/config-top.h
@@ -106,7 +106,7 @@
sshd and source the .bashrc if so (like the rshd behavior). This checks sshd and source the .bashrc if so (like the rshd behavior). This checks
for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment, for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment,
which can be fooled under certain not-uncommon circumstances. */ which can be fooled under certain not-uncommon circumstances. */
-/* #define SSH_SOURCE_BASHRC */ -/* #define SSH_SOURCE_BASHRC */
+#define SSH_SOURCE_BASHRC +#define SSH_SOURCE_BASHRC
/* Define if you want the case-capitalizing operators (~[~]) and the /* Define if you want the case-toggling operators (~[~]) and the
`capcase' variable attribute (declare -c). */ `capcase' variable attribute (declare -c). */

View File

@ -1,7 +1,8 @@
diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c diff --git a/execute_cmd.c b/execute_cmd.c
--- bash-4.2/execute_cmd.c.coverity 2011-02-24 13:04:35.000000000 +0100 index a988400..412128c 100644
+++ bash-4.2/execute_cmd.c 2011-02-24 13:49:13.000000000 +0100 --- a/execute_cmd.c
@@ -5036,7 +5036,7 @@ shell_execve (command, args, env) +++ b/execute_cmd.c
@@ -5760,7 +5760,7 @@ shell_execve (command, args, env)
Elf32_Ehdr ehdr; Elf32_Ehdr ehdr;
Elf32_Phdr *phdr; Elf32_Phdr *phdr;
Elf32_Shdr *shdr; Elf32_Shdr *shdr;
@ -10,7 +11,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
/* We have to copy the data since the sample buffer /* We have to copy the data since the sample buffer
might not be aligned correctly to be accessed as might not be aligned correctly to be accessed as
@@ -5044,12 +5044,12 @@ shell_execve (command, args, env) @@ -5768,12 +5768,12 @@ shell_execve (command, args, env)
memcpy (&ehdr, sample, sizeof (Elf32_Ehdr)); memcpy (&ehdr, sample, sizeof (Elf32_Ehdr));
nshdr = ehdr.e_shnum; nshdr = ehdr.e_shnum;
@ -25,7 +26,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
ehdr.e_shoff); ehdr.e_shoff);
#else #else
if (lseek (fd, ehdr.e_shoff, SEEK_SET) != -1) if (lseek (fd, ehdr.e_shoff, SEEK_SET) != -1)
@@ -5091,11 +5091,11 @@ shell_execve (command, args, env) @@ -5815,11 +5815,11 @@ shell_execve (command, args, env)
} }
nphdr = ehdr.e_phnum; nphdr = ehdr.e_phnum;
@ -39,7 +40,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
ehdr.e_phoff); ehdr.e_phoff);
#else #else
if (lseek (fd, ehdr.e_phoff, SEEK_SET) != -1) if (lseek (fd, ehdr.e_phoff, SEEK_SET) != -1)
@@ -5120,7 +5120,7 @@ shell_execve (command, args, env) @@ -5844,7 +5844,7 @@ shell_execve (command, args, env)
Elf64_Ehdr ehdr; Elf64_Ehdr ehdr;
Elf64_Phdr *phdr; Elf64_Phdr *phdr;
Elf64_Shdr *shdr; Elf64_Shdr *shdr;
@ -48,7 +49,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
/* We have to copy the data since the sample buffer /* We have to copy the data since the sample buffer
might not be aligned correctly to be accessed as might not be aligned correctly to be accessed as
@@ -5128,11 +5128,11 @@ shell_execve (command, args, env) @@ -5852,11 +5852,11 @@ shell_execve (command, args, env)
memcpy (&ehdr, sample, sizeof (Elf64_Ehdr)); memcpy (&ehdr, sample, sizeof (Elf64_Ehdr));
nshdr = ehdr.e_shnum; nshdr = ehdr.e_shnum;
@ -62,7 +63,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
ehdr.e_shoff); ehdr.e_shoff);
#else #else
if (lseek (fd, ehdr.e_shoff, SEEK_SET) != -1) if (lseek (fd, ehdr.e_shoff, SEEK_SET) != -1)
@@ -5174,11 +5174,11 @@ shell_execve (command, args, env) @@ -5898,11 +5898,11 @@ shell_execve (command, args, env)
} }
nphdr = ehdr.e_phnum; nphdr = ehdr.e_phnum;
@ -76,7 +77,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
ehdr.e_phoff); ehdr.e_phoff);
#else #else
if (lseek (fd, ehdr.e_phoff, SEEK_SET) != -1) if (lseek (fd, ehdr.e_phoff, SEEK_SET) != -1)
@@ -5200,8 +5200,8 @@ shell_execve (command, args, env) @@ -5924,8 +5924,8 @@ shell_execve (command, args, env)
if (offset != -1) if (offset != -1)
{ {
@ -87,7 +88,7 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
char *interp = NULL; char *interp = NULL;
do do
@@ -5250,7 +5250,8 @@ shell_execve (command, args, env) @@ -5974,7 +5974,8 @@ shell_execve (command, args, env)
} }
#endif #endif
#if defined (HAVE_HASH_BANG_EXEC) || defined (HAVE_ELF_H) #if defined (HAVE_HASH_BANG_EXEC) || defined (HAVE_ELF_H)
@ -95,5 +96,8 @@ diff -up bash-4.2/execute_cmd.c.coverity bash-4.2/execute_cmd.c
+ if (fd >= 0) + if (fd >= 0)
+ close (fd); + close (fd);
#endif #endif
errno = i; errno = i;
file_error (command); --
2.17.2

View File

@ -0,0 +1,13 @@
diff --git a/locale.c b/locale.c
index 17ccc58..a6c07a3 100644
--- a/locale.c
+++ b/locale.c
@@ -78,8 +78,6 @@ set_default_locale ()
{
#if defined (HAVE_SETLOCALE)
default_locale = setlocale (LC_ALL, "");
- if (default_locale)
- default_locale = savestring (default_locale);
#else
default_locale = savestring ("C");
#endif /* HAVE_SETLOCALE */

View File

@ -1,29 +1,29 @@
diff --git a/parse.y b/parse.y diff --git a/parse.y b/parse.y
index 30425a5..85f1c4f 100644 index df1231d..2449fa8 100644
--- a/parse.y --- a/parse.y
+++ b/parse.y +++ b/parse.y
@@ -4228,6 +4228,8 @@ xparse_dolparen (base, string, indp, flags) @@ -4482,6 +4482,8 @@ xparse_dolparen (base, string, indp, flags)
save_parser_state (&ps); save_parser_state (&ps);
save_input_line_state (&ls); save_input_line_state (&ls);
orig_eof_token = shell_eof_token; orig_eof_token = shell_eof_token;
+ /* avoid echoing every substitution again */ + /* avoid echoing every substitution again */
+ echo_input_at_read = 0; + echo_input_at_read = 0;
#if defined (ALIAS) || defined (DPAREN_ARITHMETIC)
/*(*/ saved_pushed_strings = pushed_string_list; /* separate parsing context */
parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/ pushed_string_list = (STRING_SAVER *)NULL;
diff --git a/subst.c b/subst.c diff --git a/subst.c b/subst.c
index f1a4df1..a93a4ce 100644 index 9ccbf33..8a9ee5c 100644
--- a/subst.c --- a/subst.c
+++ b/subst.c +++ b/subst.c
@@ -8513,6 +8513,7 @@ param_expand (string, sindex, quoted, expanded_something, @@ -9453,6 +9453,7 @@ param_expand (string, sindex, quoted, expanded_something,
WORD_LIST *list; WORD_LIST *list, *l;
WORD_DESC *tdesc, *ret; WORD_DESC *tdesc, *ret;
int tflag; int tflag, nullarg;
+ int old_echo_input; + int old_echo_input;
/*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/ /*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
zindex = *sindex; zindex = *sindex;
@@ -8831,6 +8832,9 @@ arithsub: @@ -9843,6 +9844,9 @@ arithsub:
} }
comsub: comsub:
@ -33,7 +33,7 @@ index f1a4df1..a93a4ce 100644
if (pflags & PF_NOCOMSUB) if (pflags & PF_NOCOMSUB)
/* we need zindex+1 because string[zindex] == RPAREN */ /* we need zindex+1 because string[zindex] == RPAREN */
temp1 = substring (string, *sindex, zindex+1); temp1 = substring (string, *sindex, zindex+1);
@@ -8843,6 +8847,7 @@ comsub: @@ -9855,6 +9859,7 @@ comsub:
} }
FREE (temp); FREE (temp);
temp = temp1; temp = temp1;
@ -41,6 +41,3 @@ index f1a4df1..a93a4ce 100644
break; break;
/* Do POSIX.2d9-style arithmetic substitution. This will probably go /* Do POSIX.2d9-style arithmetic substitution. This will probably go
--
2.9.3

View File

@ -0,0 +1,13 @@
diff --git a/doc/bash.1 b/doc/bash.1
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -9889,6 +9889,9 @@ If set, the
to find the directory containing the file supplied as an argument.
This option is enabled by default.
.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.

12
bash-5.1-mbrtowc.patch Normal file
View File

@ -0,0 +1,12 @@
diff --git a/subst.c b/subst.c
--- a/subst.c
+++ b/subst.c
@@ -6240,7 +6240,7 @@ read_comsub (fd, quoted, flags, rflag)
/* read a multibyte character from buf */
/* punt on the hard case for now */
memset (&ps, '\0', sizeof (mbstate_t));
- mblen = mbrtowc (&wc, bufp-1, bufn+1, &ps);
+ mblen = mbrtowc (&wc, bufp-1, bufn, &ps);
if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1)
istring[istring_index++] = c;
else

50
bash-5.1-patch-1.patch Normal file
View File

@ -0,0 +1,50 @@
diff --git a/Makefile.in b/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -1315,6 +1315,7 @@ bashline.o: trap.h flags.h assoc.h $(BASHINCDIR)/ocache.h
bashline.o: $(DEFSRC)/common.h $(GLOB_LIBSRC)/glob.h alias.h
bashline.o: pcomplete.h ${BASHINCDIR}/chartypes.h input.h
bashline.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h
+bashline.o: ${DEFDIR}/builtext.h
bracecomp.o: config.h bashansi.h ${BASHINCDIR}/ansi_stdlib.h
bracecomp.o: shell.h syntax.h config.h bashjmp.h ${BASHINCDIR}/posixjmp.h
bracecomp.o: command.h ${BASHINCDIR}/stdc.h error.h
@@ -1435,6 +1436,7 @@ builtins/evalstring.o: quit.h unwind_prot.h ${BASHINCDIR}/maxpath.h jobs.h built
builtins/evalstring.o: dispose_cmd.h make_cmd.h subst.h externs.h
builtins/evalstring.o: jobs.h builtins.h flags.h input.h execute_cmd.h
builtins/evalstring.o: bashhist.h $(DEFSRC)/common.h pathnames.h
+builtins/evalstring.o: ${DEFDIR}/builtext.h
builtins/getopt.o: config.h ${BASHINCDIR}/memalloc.h
builtins/getopt.o: shell.h syntax.h bashjmp.h command.h general.h xmalloc.h error.h
builtins/getopt.o: variables.h arrayfunc.h conftypes.h quit.h ${BASHINCDIR}/maxpath.h unwind_prot.h dispose_cmd.h
diff --git a/builtins/Makefile.in b/builtins/Makefile.in
--- a/builtins/Makefile.in
+++ b/builtins/Makefile.in
@@ -361,7 +361,7 @@ evalstring.o: $(topdir)/dispose_cmd.h $(topdir)/make_cmd.h $(topdir)/subst.h
evalstring.o: $(topdir)/externs.h $(topdir)/jobs.h $(topdir)/builtins.h
evalstring.o: $(topdir)/flags.h $(topdir)/input.h $(topdir)/execute_cmd.h
evalstring.o: $(topdir)/bashhist.h $(srcdir)/common.h
-evalstring.o: $(topdir)/trap.h $(topdir)/redir.h ../pathnames.h
+evalstring.o: $(topdir)/trap.h $(topdir)/redir.h ../pathnames.h ./builtext.h
#evalstring.o: $(topdir)/y.tab.h
getopt.o: ../config.h $(BASHINCDIR)/memalloc.h
getopt.o: $(topdir)/shell.h $(topdir)/syntax.h $(topdir)/bashjmp.h $(topdir)/command.h
diff --git a/patchlevel.h b/patchlevel.h
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -1,6 +1,6 @@
/* patchlevel.h -- current bash patch level */
-/* Copyright (C) 2001-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2020 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -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 0
+#define PATCHLEVEL 1
#endif /* _PATCHLEVEL_H_ */

29
bash-5.1-patch-2.patch Normal file
View File

@ -0,0 +1,29 @@
diff --git a/builtins/wait.def b/builtins/wait.def
--- a/builtins/wait.def
+++ b/builtins/wait.def
@@ -213,11 +213,11 @@ wait_builtin (list)
}
status = wait_for_any_job (wflags, &pstat);
- if (status < 0)
- status = 127;
-
if (vname && status >= 0)
bind_var_to_int (vname, pstat.pid);
+
+ if (status < 0)
+ status = 127;
if (list)
unset_waitlist ();
WAIT_RETURN (status);
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 1
+#define PATCHLEVEL 2
#endif /* _PATCHLEVEL_H_ */

27
bash-5.1-patch-3.patch Normal file
View File

@ -0,0 +1,27 @@
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 2
+#define PATCHLEVEL 3
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
--- a/subst.c
+++ b/subst.c
@@ -6356,8 +6356,10 @@ command_substitute (string, quoted, flags)
#if defined (JOB_CONTROL)
old_pipeline_pgrp = pipeline_pgrp;
- /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */
- if ((subshell_environment & SUBSHELL_PIPE) == 0)
+ /* Don't reset the pipeline pgrp if we're already a subshell in a pipeline or
+ we've already forked to run a disk command (and are expanding redirections,
+ for example). */
+ if ((subshell_environment & (SUBSHELL_FORK|SUBSHELL_PIPE)) == 0)
pipeline_pgrp = shell_pgrp;
cleanup_the_pipeline ();
#endif /* JOB_CONTROL */

97
bash-5.1-patch-4.patch Normal file
View File

@ -0,0 +1,97 @@
diff --git a/arrayfunc.c b/arrayfunc.c
--- a/arrayfunc.c
+++ b/arrayfunc.c
@@ -597,6 +597,27 @@ assign_assoc_from_kvlist (var, nlist, h, flags)
free (aval);
}
}
+
+/* Return non-zero if L appears to be a key-value pair associative array
+ compound assignment. */
+int
+kvpair_assignment_p (l)
+ WORD_LIST *l;
+{
+ return (l && (l->word->flags & W_ASSIGNMENT) == 0 && l->word->word[0] != '['); /*]*/
+}
+
+char *
+expand_and_quote_kvpair_word (w)
+ char *w;
+{
+ char *t, *r;
+
+ t = w ? expand_assignment_string_to_string (w, 0) : 0;
+ r = sh_single_quote (t ? t : "");
+ free (t);
+ return r;
+}
#endif
/* Callers ensure that VAR is not NULL. Associative array assignments have not
@@ -640,7 +661,7 @@ assign_compound_array_list (var, nlist, flags)
last_ind = (a && (flags & ASS_APPEND)) ? array_max_index (a) + 1 : 0;
#if ASSOC_KVPAIR_ASSIGNMENT
- if (assoc_p (var) && nlist && (nlist->word->flags & W_ASSIGNMENT) == 0 && nlist->word->word[0] != '[') /*]*/
+ if (assoc_p (var) && kvpair_assignment_p (nlist))
{
iflags = flags & ~ASS_APPEND;
assign_assoc_from_kvlist (var, nlist, nhash, iflags);
diff --git a/arrayfunc.h b/arrayfunc.h
--- a/arrayfunc.h
+++ b/arrayfunc.h
@@ -67,6 +67,9 @@ extern SHELL_VAR *assign_array_var_from_string PARAMS((SHELL_VAR *, char *, int)
extern char *expand_and_quote_assoc_word PARAMS((char *, int));
extern void quote_compound_array_list PARAMS((WORD_LIST *, int));
+extern int kvpair_assignment_p PARAMS((WORD_LIST *));
+extern char *expand_and_quote_kvpair_word PARAMS((char *));
+
extern int unbind_array_element PARAMS((SHELL_VAR *, char *, int));
extern int skipsubscript PARAMS((const char *, int, int));
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 3
+#define PATCHLEVEL 4
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
--- a/subst.c
+++ b/subst.c
@@ -11604,6 +11604,7 @@ expand_oneword (value, flags)
{
WORD_LIST *l, *nl;
char *t;
+ int kvpair;
if (flags == 0)
{
@@ -11618,11 +11619,21 @@ expand_oneword (value, flags)
{
/* Associative array */
l = parse_string_to_word_list (value, 1, "array assign");
+#if ASSOC_KVPAIR_ASSIGNMENT
+ kvpair = kvpair_assignment_p (l);
+#endif
+
/* For associative arrays, with their arbitrary subscripts, we have to
expand and quote in one step so we don't have to search for the
closing right bracket more than once. */
for (nl = l; nl; nl = nl->next)
{
+#if ASSOC_KVPAIR_ASSIGNMENT
+ if (kvpair)
+ /* keys and values undergo the same set of expansions */
+ t = expand_and_quote_kvpair_word (nl->word->word);
+ else
+#endif
if ((nl->word->flags & W_ASSIGNMENT) == 0)
t = sh_single_quote (nl->word->word ? nl->word->word : "");
else

85
bash-5.1-patch-5.patch Normal file
View File

@ -0,0 +1,85 @@
From cc978a670597afc3251baca3a7db553f36946c22 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Tue, 4 May 2021 14:29:06 -0400
Subject: [PATCH] Bash-5.1 patch 5: fix memory leaks in compound array
assignments
---
arrayfunc.c | 11 +++--------
patchlevel.h | 2 +-
subst.c | 2 ++
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/arrayfunc.c b/arrayfunc.c
index 8231ba1e..9338dfc7 100644
--- a/arrayfunc.c
+++ b/arrayfunc.c
@@ -564,12 +564,9 @@ assign_assoc_from_kvlist (var, nlist, h, flags)
{
WORD_LIST *list;
char *akey, *aval, *k, *v;
- int free_aval;
for (list = nlist; list; list = list->next)
{
- free_aval = 0;
-
k = list->word->word;
v = list->next ? list->next->word->word : 0;
@@ -577,24 +574,22 @@ assign_assoc_from_kvlist (var, nlist, h, flags)
list = list->next;
akey = expand_assignment_string_to_string (k, 0);
- aval = expand_assignment_string_to_string (v, 0);
-
if (akey == 0 || *akey == 0)
{
err_badarraysub (k);
FREE (akey);
continue;
}
+
+ aval = expand_assignment_string_to_string (v, 0);
if (aval == 0)
{
aval = (char *)xmalloc (1);
aval[0] = '\0'; /* like do_assignment_internal */
- free_aval = 1;
}
bind_assoc_var_internal (var, h, akey, aval, flags);
- if (free_aval)
- free (aval);
+ free (aval);
}
}
diff --git a/patchlevel.h b/patchlevel.h
index e1429c24..c7f39aec 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 4
+#define PATCHLEVEL 5
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index 6132316a..1d24188e 100644
--- a/subst.c
+++ b/subst.c
@@ -11673,6 +11673,8 @@ expand_compound_assignment_word (tlist, flags)
free (value);
value = string_list (l);
+ dispose_words (l);
+
wlen = STRLEN (value);
/* Now, let's rebuild the string */
--
2.29.2

44
bash-5.1-patch-6.patch Normal file
View File

@ -0,0 +1,44 @@
From f3cd936b81006df41a1c8509891dea1edeaef8e6 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Tue, 4 May 2021 14:30:17 -0400
Subject: [PATCH] Bash-5.1 patch 6: make sure child processes forked to execute
command substitutions are in the right process group
---
patchlevel.h | 2 +-
subst.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/patchlevel.h b/patchlevel.h
index c7f39aec..6257aeeb 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 5
+#define PATCHLEVEL 6
#endif /* _PATCHLEVEL_H_ */
diff --git a/subst.c b/subst.c
index 1d24188e..462752de 100644
--- a/subst.c
+++ b/subst.c
@@ -6412,6 +6412,13 @@ command_substitute (string, quoted, flags)
/* The currently executing shell is not interactive. */
interactive = 0;
+#if defined (JOB_CONTROL)
+ /* Invariant: in child processes started to run command substitutions,
+ pipeline_pgrp == shell_pgrp. Other parts of the shell assume this. */
+ if (pipeline_pgrp > 0 && pipeline_pgrp != shell_pgrp)
+ shell_pgrp = pipeline_pgrp;
+#endif
+
set_sigint_handler (); /* XXX */
free_pushed_string_input ();
--
2.29.2

71
bash-5.1-patch-7.patch Normal file
View File

@ -0,0 +1,71 @@
From b72f88db852104cf49cfb4762eda6e8f4fd20a70 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Tue, 4 May 2021 14:31:05 -0400
Subject: [PATCH] Bash-5.1 patch 7: fix version comparisons in readline startup
files
---
lib/readline/bind.c | 15 ++++++++-------
patchlevel.h | 2 +-
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/lib/readline/bind.c b/lib/readline/bind.c
index 87596dce..76103786 100644
--- a/lib/readline/bind.c
+++ b/lib/readline/bind.c
@@ -1234,7 +1234,7 @@ parser_if (char *args)
#endif /* VI_MODE */
else if (_rl_strnicmp (args, "version", 7) == 0)
{
- int rlversion, versionarg, op, previ, major, minor;
+ int rlversion, versionarg, op, previ, major, minor, opresult;
_rl_parsing_conditionalized_out = 1;
rlversion = RL_VERSION_MAJOR*10 + RL_VERSION_MINOR;
@@ -1294,24 +1294,25 @@ parser_if (char *args)
switch (op)
{
case OP_EQ:
- _rl_parsing_conditionalized_out = rlversion == versionarg;
+ opresult = rlversion == versionarg;
break;
case OP_NE:
- _rl_parsing_conditionalized_out = rlversion != versionarg;
+ opresult = rlversion != versionarg;
break;
case OP_GT:
- _rl_parsing_conditionalized_out = rlversion > versionarg;
+ opresult = rlversion > versionarg;
break;
case OP_GE:
- _rl_parsing_conditionalized_out = rlversion >= versionarg;
+ opresult = rlversion >= versionarg;
break;
case OP_LT:
- _rl_parsing_conditionalized_out = rlversion < versionarg;
+ opresult = rlversion < versionarg;
break;
case OP_LE:
- _rl_parsing_conditionalized_out = rlversion <= versionarg;
+ opresult = rlversion <= versionarg;
break;
}
+ _rl_parsing_conditionalized_out = 1 - opresult;
}
/* Check to see if the first word in ARGS is the same as the
value stored in rl_readline_name. */
diff --git a/patchlevel.h b/patchlevel.h
index 6257aeeb..c5ed66ab 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 6
+#define PATCHLEVEL 7
#endif /* _PATCHLEVEL_H_ */
--
2.29.2

49
bash-5.1-patch-8.patch Normal file
View File

@ -0,0 +1,49 @@
From ce23728687ce9e584333367075c9deef413553fa Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Tue, 4 May 2021 14:31:53 -0400
Subject: [PATCH] Bash-5.1 patch 8: clean up FIFOs created by redirections in
child processes
---
execute_cmd.c | 8 +++++++-
patchlevel.h | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/execute_cmd.c b/execute_cmd.c
index d2a0dd71..90129e06 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -5556,11 +5556,17 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
#if defined (PROCESS_SUBSTITUTION)
/* Try to remove named pipes that may have been created as the
result of redirections. */
- unlink_fifo_list ();
+ unlink_all_fifos ();
#endif /* PROCESS_SUBSTITUTION */
exit (EXECUTION_FAILURE);
}
+#if defined (PROCESS_SUBSTITUTION) && !defined (HAVE_DEV_FD)
+ /* This should only contain FIFOs created as part of redirection
+ expansion. */
+ unlink_all_fifos ();
+#endif
+
if (async)
interactive = old_interactive;
diff --git a/patchlevel.h b/patchlevel.h
index c5ed66ab..10fde2ee 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 7
+#define PATCHLEVEL 8
#endif /* _PATCHLEVEL_H_ */
--
2.29.2

View File

@ -0,0 +1,12 @@
diff --git a/lib/readline/rltty.c b/lib/readline/rltty.c
--- a/lib/readline/rltty.c
+++ b/lib/readline/rltty.c
@@ -694,6 +694,8 @@ rl_deprep_terminal (void)
fprintf (rl_outstream, BRACK_PASTE_FINI);
if (_rl_eof_found)
fprintf (rl_outstream, "\n");
+ else if (_rl_echoing_p == 0)
+ fprintf (rl_outstream, "\n");
}
if (_rl_enable_keypad)

View File

@ -0,0 +1,12 @@
diff --git a/subst.c b/subst.c
--- a/subst.c
+++ b/subst.c
@@ -7959,7 +7959,7 @@ parameter_brace_transform (varname, value, ind, xform, rtype, quoted, pflags, fl
return ((char *)NULL);
}
- if (valid_parameter_transform (xform) == 0)
+ if (xform[0] == 0 || valid_parameter_transform (xform) == 0)
{
this_command_name = oname;
#if 0 /* TAG: bash-5.2 Martin Schulte <gnu@schrader-schulte.de> 10/2020 */

View File

@ -0,0 +1,15 @@
diff --git a/execute_cmd.c b/execute_cmd.c
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -5496,11 +5496,7 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out,
{
/* If we're optimizing out the fork (implicit `exec'), decrement the
shell level like `exec' would do. */
-#if 0 /* TAG: bash-5.2 psmith 10/11/2020 */
if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE && (subshell_environment & SUBSHELL_PIPE) == 0)
-#else
- if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE)
-#endif
adjust_shell_level (-1);
maybe_make_export_env ();

View File

@ -1,8 +1,8 @@
diff --git a/builtins.h b/builtins.h diff --git a/builtins.h b/builtins.h
index 0cfea18..a6ef958 100644 index dac95fd..5b7e811 100644
--- a/builtins.h --- a/builtins.h
+++ b/builtins.h +++ b/builtins.h
@@ -42,6 +42,7 @@ @@ -45,6 +45,7 @@
#define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */ #define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */
#define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */ #define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */
#define LOCALVAR_BUILTIN 0x40 /* This builtin creates local variables */ #define LOCALVAR_BUILTIN 0x40 /* This builtin creates local variables */
@ -11,7 +11,7 @@ index 0cfea18..a6ef958 100644
#define BASE_INDENT 4 #define BASE_INDENT 4
diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c diff --git a/builtins/mkbuiltins.c b/builtins/mkbuiltins.c
index 4f51201..283bfea 100644 index e243021..0a7a0e5 100644
--- a/builtins/mkbuiltins.c --- a/builtins/mkbuiltins.c
+++ b/builtins/mkbuiltins.c +++ b/builtins/mkbuiltins.c
@@ -69,10 +69,15 @@ extern char *strcpy (); @@ -69,10 +69,15 @@ extern char *strcpy ();
@ -30,7 +30,7 @@ index 4f51201..283bfea 100644
#define BASE_INDENT 4 #define BASE_INDENT 4
@@ -173,11 +178,20 @@ char *posix_builtins[] = @@ -173,11 +178,19 @@ char *posix_builtins[] =
(char *)NULL (char *)NULL
}; };
@ -40,7 +40,6 @@ index 4f51201..283bfea 100644
+ ".", "command", "exec", "source", "inlib", + ".", "command", "exec", "source", "inlib",
+ (char *)NULL + (char *)NULL
+}; +};
+
+ +
/* Forward declarations. */ /* Forward declarations. */
static int is_special_builtin (); static int is_special_builtin ();
@ -51,17 +50,16 @@ index 4f51201..283bfea 100644
#if !defined (HAVE_RENAME) #if !defined (HAVE_RENAME)
static int rename (); static int rename ();
@@ -831,6 +845,9 @@ builtin_handler (self, defs, arg) @@ -831,6 +844,8 @@ builtin_handler (self, defs, arg)
new->flags |= BUILTIN_FLAG_LOCALVAR; new->flags |= BUILTIN_FLAG_LOCALVAR;
if (is_posix_builtin (name)) if (is_posix_builtin (name))
new->flags |= BUILTIN_FLAG_POSIX_BUILTIN; new->flags |= BUILTIN_FLAG_POSIX_BUILTIN;
+ if (is_requires_builtin (name)) + if (is_requires_builtin (name))
+ new->flags |= BUILTIN_FLAG_REQUIRES; + new->flags |= BUILTIN_FLAG_REQUIRES;
+
array_add ((char *)new, defs->builtins); array_add ((char *)new, defs->builtins);
building_builtin = 1; building_builtin = 1;
@@ -1250,12 +1267,13 @@ write_builtins (defs, structfile, externfile) @@ -1250,12 +1265,13 @@ write_builtins (defs, structfile, externfile)
else else
fprintf (structfile, "(sh_builtin_func_t *)0x0, "); fprintf (structfile, "(sh_builtin_func_t *)0x0, ");
@ -76,7 +74,7 @@ index 4f51201..283bfea 100644
document_name (builtin)); document_name (builtin));
/* Don't translate short document summaries that are identical /* Don't translate short document summaries that are identical
@@ -1645,6 +1663,13 @@ is_posix_builtin (name) @@ -1645,6 +1661,13 @@ is_posix_builtin (name)
return (_find_in_table (name, posix_builtins)); return (_find_in_table (name, posix_builtins));
} }
@ -91,10 +89,10 @@ index 4f51201..283bfea 100644
static int static int
rename (from, to) rename (from, to)
diff --git a/doc/bash.1 b/doc/bash.1 diff --git a/doc/bash.1 b/doc/bash.1
index c21e877..04ce845 100644 index 5af7d42..7539368 100644
--- a/doc/bash.1 --- a/doc/bash.1
+++ b/doc/bash.1 +++ b/doc/bash.1
@@ -238,6 +238,14 @@ The shell becomes restricted (see @@ -239,6 +239,14 @@ The shell becomes restricted (see
.B "RESTRICTED SHELL" .B "RESTRICTED SHELL"
below). below).
.TP .TP
@ -110,10 +108,10 @@ index c21e877..04ce845 100644
Equivalent to \fB\-v\fP. Equivalent to \fB\-v\fP.
.TP .TP
diff --git a/doc/bashref.texi b/doc/bashref.texi diff --git a/doc/bashref.texi b/doc/bashref.texi
index 06957b6..e3fe925 100644 index 9e23f58..d02151e 100644
--- a/doc/bashref.texi --- a/doc/bashref.texi
+++ b/doc/bashref.texi +++ b/doc/bashref.texi
@@ -6243,6 +6243,13 @@ standard. @xref{Bash POSIX Mode}, for a description of the Bash @@ -6554,6 +6554,13 @@ standard. @xref{Bash POSIX Mode}, for a description of the Bash
@item --restricted @item --restricted
Make the shell a restricted shell (@pxref{The Restricted Shell}). Make the shell a restricted shell (@pxref{The Restricted Shell}).
@ -128,31 +126,24 @@ index 06957b6..e3fe925 100644
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 diff --git a/eval.c b/eval.c
index db863e7..5a5af32 100644 index 1d967da..f197033 100644
--- a/eval.c --- a/eval.c
+++ b/eval.c +++ b/eval.c
@@ -56,6 +56,7 @@ extern int need_here_doc; @@ -137,7 +137,8 @@ reader_loop ()
extern int current_command_number, current_command_line_count, line_number;
extern int expand_aliases;
extern char *ps0_prompt;
+extern int rpm_requires;
#if defined (HAVE_POSIX_SIGNALS)
extern sigset_t top_level_mask;
@@ -148,7 +149,7 @@ reader_loop ()
if (read_command () == 0) if (read_command () == 0)
{ {
- if (interactive_shell == 0 && read_but_dont_execute) - if (interactive_shell == 0 && read_but_dont_execute)
+
+ if (interactive_shell == 0 && (read_but_dont_execute && !rpm_requires)) + if (interactive_shell == 0 && (read_but_dont_execute && !rpm_requires))
{ {
last_command_exit_value = EXECUTION_SUCCESS; set_exit_status (EXECUTION_SUCCESS);
dispose_command (global_command); dispose_command (global_command);
diff --git a/execute_cmd.c b/execute_cmd.c diff --git a/execute_cmd.c b/execute_cmd.c
index b5cd405..88c7a5c 100644 index d2555ad..397e283 100644
--- a/execute_cmd.c --- a/execute_cmd.c
+++ b/execute_cmd.c +++ b/execute_cmd.c
@@ -533,6 +533,8 @@ async_redirect_stdin () @@ -543,6 +543,8 @@ async_redirect_stdin ()
#define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0) #define DESCRIBE_PID(pid) do { if (interactive) describe_pid (pid); } while (0)
@ -160,8 +151,8 @@ index b5cd405..88c7a5c 100644
+ +
/* Execute the command passed in COMMAND, perhaps doing it asynchronously. /* Execute the command passed in COMMAND, perhaps doing it asynchronously.
COMMAND is exactly what read_command () places into GLOBAL_COMMAND. COMMAND is exactly what read_command () places into GLOBAL_COMMAND.
ASYNCHROUNOUS, if non-zero, says to do this command in the background. ASYNCHRONOUS, if non-zero, says to do this command in the background.
@@ -565,7 +567,13 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out, @@ -574,7 +576,13 @@ execute_command_internal (command, asynchronous, pipe_in, pipe_out,
if (breaking || continuing) if (breaking || continuing)
return (last_command_exit_value); return (last_command_exit_value);
@ -176,9 +167,9 @@ index b5cd405..88c7a5c 100644
return (EXECUTION_SUCCESS); return (EXECUTION_SUCCESS);
QUIT; QUIT;
@@ -5752,7 +5760,7 @@ execute_intern_function (name, funcdef) @@ -2836,7 +2844,7 @@ execute_for_command (for_command)
save_line_number = line_number;
if (check_identifier (name, posixly_correct) == 0) if (check_identifier (for_command->name, 1) == 0)
{ {
- if (posixly_correct && interactive_shell == 0) - if (posixly_correct && interactive_shell == 0)
+ if (posixly_correct && interactive_shell == 0 && rpm_requires == 0) + if (posixly_correct && interactive_shell == 0 && rpm_requires == 0)
@ -186,50 +177,33 @@ index b5cd405..88c7a5c 100644
last_command_exit_value = EX_BADUSAGE; last_command_exit_value = EX_BADUSAGE;
jump_to_top_level (ERREXIT); jump_to_top_level (ERREXIT);
diff --git a/execute_cmd.h b/execute_cmd.h diff --git a/execute_cmd.h b/execute_cmd.h
index 62bec82..d42dc85 100644 index 465030a..9c7fd1c 100644
--- a/execute_cmd.h --- a/execute_cmd.h
+++ b/execute_cmd.h +++ b/execute_cmd.h
@@ -22,6 +22,8 @@ @@ -22,6 +22,9 @@
#define _EXECUTE_CMD_H_ #define _EXECUTE_CMD_H_
#include "stdc.h" #include "stdc.h"
+#include "variables.h" +#include "variables.h"
+#include "command.h" +#include "command.h"
+
#if defined (ARRAY_VARS) #if defined (ARRAY_VARS)
struct func_array_state struct func_array_state
diff --git a/make_cmd.c b/make_cmd.c diff --git a/make_cmd.c b/make_cmd.c
index b42e9ff..a982fe0 100644 index 2d7ac96..ac53526 100644
--- a/make_cmd.c --- a/make_cmd.c
+++ b/make_cmd.c +++ b/make_cmd.c
@@ -42,11 +42,15 @@ @@ -35,6 +35,8 @@
#include "flags.h" #include "bashintl.h"
#include "make_cmd.h"
#include "dispose_cmd.h" #include "shell.h"
+#include "execute_cmd.h"
#include "variables.h"
#include "subst.h"
#include "input.h"
#include "ocache.h"
#include "externs.h"
+#include "builtins.h" +#include "builtins.h"
+
+#include "builtins/common.h" +#include "builtins/common.h"
#include "execute_cmd.h"
#if defined (JOB_CONTROL) #include "parser.h"
#include "jobs.h" #include "flags.h"
@@ -57,6 +61,10 @@ @@ -828,6 +830,30 @@ make_coproc_command (name, command)
extern int line_number, current_command_line_count, parser_state;
extern int last_command_exit_value;
extern int shell_initialized;
+extern int rpm_requires;
+
+static char *alphabet_set = "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int here_doc_first_line = 0;
@@ -839,6 +847,27 @@ make_coproc_command (name, command)
return (make_command (cm_coproc, (SIMPLE_COM *)temp)); return (make_command (cm_coproc, (SIMPLE_COM *)temp));
} }
@ -238,6 +212,9 @@ index b42e9ff..a982fe0 100644
+const char *deptype; +const char *deptype;
+char *filename; +char *filename;
+{ +{
+ static char *alphabet_set = "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+
+ if (strchr(filename, '$') || (filename[0] != '/' && strchr(filename, '/'))) + if (strchr(filename, '$') || (filename[0] != '/' && strchr(filename, '/')))
+ return; + return;
+ +
@ -257,7 +234,7 @@ index b42e9ff..a982fe0 100644
/* Reverse the word list and redirection list in the simple command /* Reverse the word list and redirection list in the simple command
has just been parsed. It seems simpler to do this here the one has just been parsed. It seems simpler to do this here the one
time then by any other method that I can think of. */ time then by any other method that I can think of. */
@@ -856,6 +885,27 @@ clean_simple_command (command) @@ -845,6 +871,28 @@ clean_simple_command (command)
REVERSE_LIST (command->value.Simple->redirects, REDIRECT *); REVERSE_LIST (command->value.Simple->redirects, REDIRECT *);
} }
@ -281,15 +258,16 @@ index b42e9ff..a982fe0 100644
+ output_requirement (find_function(cmd0) ? "function" : "executable", cmd0); + output_requirement (find_function(cmd0) ? "function" : "executable", cmd0);
+ } + }
+ } /*rpm_requires*/ + } /*rpm_requires*/
+
+ +
parser_state &= ~PST_REDIRLIST; parser_state &= ~PST_REDIRLIST;
return (command); return (command);
} }
diff --git a/shell.c b/shell.c diff --git a/shell.c b/shell.c
index 7f63969..a0fb7ce 100644 index ce8087f..7dcd000 100644
--- a/shell.c --- a/shell.c
+++ b/shell.c +++ b/shell.c
@@ -201,6 +201,9 @@ int have_devfd = 0; @@ -194,6 +194,9 @@ int have_devfd = 0;
/* The name of the .(shell)rc file. */ /* The name of the .(shell)rc file. */
static char *bashrc_file = DEFAULT_BASHRC; static char *bashrc_file = DEFAULT_BASHRC;
@ -299,7 +277,7 @@ index 7f63969..a0fb7ce 100644
/* Non-zero means to act more like the Bourne shell on startup. */ /* Non-zero means to act more like the Bourne shell on startup. */
static int act_like_sh; static int act_like_sh;
@@ -264,6 +267,7 @@ static const struct { @@ -260,6 +263,7 @@ static const struct {
{ "protected", Int, &protected_mode, (char **)0x0 }, { "protected", Int, &protected_mode, (char **)0x0 },
#endif #endif
{ "rcfile", Charp, (int *)0x0, &bashrc_file }, { "rcfile", Charp, (int *)0x0, &bashrc_file },
@ -307,7 +285,7 @@ index 7f63969..a0fb7ce 100644
#if defined (RESTRICTED_SHELL) #if defined (RESTRICTED_SHELL)
{ "restricted", Int, &restricted, (char **)0x0 }, { "restricted", Int, &restricted, (char **)0x0 },
#endif #endif
@@ -500,6 +504,12 @@ main (argc, argv, env) @@ -502,6 +506,12 @@ main (argc, argv, env)
if (dump_translatable_strings) if (dump_translatable_strings)
read_but_dont_execute = 1; read_but_dont_execute = 1;
@ -320,6 +298,15 @@ index 7f63969..a0fb7ce 100644
if (running_setuid && privileged_mode == 0) if (running_setuid && privileged_mode == 0)
disable_priv_mode (); disable_priv_mode ();
-- diff --git a/shell.h b/shell.h
2.9.3 index 8b41792..29b0efb 100644
--- a/shell.h
+++ b/shell.h
@@ -99,6 +99,7 @@ extern int interactive, interactive_shell;
extern int startup_state;
extern int reading_shell_script;
extern int shell_initialized;
+extern int rpm_requires;
extern int bash_argv_initialized;
extern int subshell_environment;
extern int current_command_number;

View File

@ -1,5 +1,5 @@
diff --git a/tests/exec.right b/tests/exec.right diff --git a/tests/exec.right b/tests/exec.right
index 81224fa..ff77f09 100644 index 0a249dd..fe8a127 100644
--- a/tests/exec.right --- a/tests/exec.right
+++ b/tests/exec.right +++ b/tests/exec.right
@@ -51,7 +51,6 @@ this is ohio-state @@ -51,7 +51,6 @@ this is ohio-state
@ -11,20 +11,20 @@ index 81224fa..ff77f09 100644
1 1
1 1
diff --git a/tests/execscript b/tests/execscript diff --git a/tests/execscript b/tests/execscript
index 3415ae3..75c48a4 100644 index 2809676..1216828 100644
--- a/tests/execscript --- a/tests/execscript
+++ b/tests/execscript +++ b/tests/execscript
@@ -108,8 +108,6 @@ ${THIS_SH} ./exec6.sub @@ -108,8 +108,6 @@ ${THIS_SH} ./exec6.sub
# checks for properly deciding what constitutes an executable file # checks for properly deciding what constitutes an executable file
${THIS_SH} ./exec7.sub ${THIS_SH} ./exec7.sub
-${THIS_SH} -i ./exec8.sub -${THIS_SH} -i ${PWD}/exec8.sub
- -
${THIS_SH} ./exec9.sub ${THIS_SH} ./exec9.sub
${THIS_SH} ./exec10.sub ${THIS_SH} ./exec10.sub
diff --git a/tests/read.right b/tests/read.right diff --git a/tests/read.right b/tests/read.right
index 73cb704..a92fe7f 100644 index 1144083..09cd422 100644
--- a/tests/read.right --- a/tests/read.right
+++ b/tests/read.right +++ b/tests/read.right
@@ -33,14 +33,6 @@ a = abcdefg @@ -33,14 +33,6 @@ a = abcdefg
@ -35,18 +35,18 @@ index 73cb704..a92fe7f 100644
- -
-timeout 2: ok -timeout 2: ok
- -
-./read2.sub: line 23: read: -3: invalid timeout specification -./read2.sub: line 36: read: -3: invalid timeout specification
-1 -1
- -
-abcde -abcde
./read3.sub: line 4: read: -1: invalid number ./read3.sub: line 17: read: -1: invalid number
abc abc
ab ab
diff --git a/tests/read.tests b/tests/read.tests diff --git a/tests/read.tests b/tests/read.tests
index fe27dae..10346f7 100644 index 7384f05..43fcf8d 100644
--- a/tests/read.tests --- a/tests/read.tests
+++ b/tests/read.tests +++ b/tests/read.tests
@@ -82,9 +82,6 @@ echo " foo" | { IFS=$':' ; read line; recho "$line"; } @@ -95,9 +95,6 @@ echo " foo" | { IFS=$':' ; read line; recho "$line"; }
# test read -d delim behavior # test read -d delim behavior
${THIS_SH} ./read1.sub ${THIS_SH} ./read1.sub
@ -56,6 +56,3 @@ index fe27dae..10346f7 100644
# test read -n nchars behavior # test read -n nchars behavior
${THIS_SH} ./read3.sub ${THIS_SH} ./read3.sub
--
2.9.3

View File

@ -1,19 +1,18 @@
#% define beta_tag rc2 #% define beta_tag rc2
%global _hardened_build 1 %define patchleveltag .8
%define patchleveltag .20 %define baseversion 5.1
%define baseversion 4.4
%bcond_without tests %bcond_without tests
Version: %{baseversion}%{patchleveltag} Version: %{baseversion}%{patchleveltag}
Name: bash Name: bash
Summary: The GNU Bourne Again shell Summary: The GNU Bourne Again shell
Release: 5%{?dist} Release: 9%{?dist}
License: GPLv3+ License: GPLv3+
Url: https://www.gnu.org/software/bash Url: https://www.gnu.org/software/bash
Source0: https://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz Source0: https://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz
# For now there isn't any doc # For now there isn't any doc
#Source2: ftp://ftp.gnu.org/gnu/bash/bash-doc-%{version}.tar.gz #Source2: ftp://ftp.gnu.org/gnu/bash/bash-doc-%%{version}.tar.gz
Source1: dot-bashrc Source1: dot-bashrc
Source2: dot-bash_profile Source2: dot-bash_profile
@ -21,22 +20,28 @@ Source3: dot-bash_logout
# Official upstream patches # Official upstream patches
# Patches are converted to apply with '-p1' # Patches are converted to apply with '-p1'
%{lua:for i=1,20 do print(string.format("Patch%u: bash-4.4-patch-%u.patch\n", i, i)) end} %{lua:for i=1,8 do print(string.format("Patch%u: bash-5.1-patch-%u.patch\n", i, i)) end}
# Other patches # Other patches
Patch101: bash-2.02-security.patch # We don't want to add '/etc:/usr/etc' in standard utils path.
Patch102: bash-2.03-paths.patch Patch101: bash-2.03-paths.patch
Patch103: bash-2.03-profile.patch # Non-interactive shells beginning with argv[0][0] == '-' should run the startup files when not in posix mode.
Patch104: bash-2.05a-interpreter.patch Patch102: bash-2.03-profile.patch
Patch105: bash-2.05b-debuginfo.patch # https://bugzilla.redhat.com/show_bug.cgi?id=60870
Patch106: bash-2.05b-manso.patch Patch103: bash-2.05a-interpreter.patch
Patch107: bash-2.05b-pgrp_sync.patch # Generate info for debuginfo files.
Patch108: bash-2.05b-xcc.patch Patch104: bash-2.05b-debuginfo.patch
Patch110: bash-3.2-ssh_source_bash.patch # Pid passed to setpgrp() can not be pid of a zombie process.
Patch112: bash-infotags.patch Patch105: bash-2.05b-pgrp_sync.patch
Patch113: bash-requires.patch # Source bashrc file when bash is run under ssh.
Patch114: bash-setlocale.patch Patch107: bash-3.2-ssh_source_bash.patch
Patch115: bash-tty-tests.patch # Use makeinfo to generate .texi file
Patch108: bash-infotags.patch
# Try to pick up latest `--rpm-requires` patch from http://git.altlinux.org/gears/b/bash4.git
Patch109: bash-requires.patch
Patch110: bash-setlocale.patch
# Disable tty tests while doing bash builds
Patch111: bash-tty-tests.patch
# 484809, check if interp section is NOBITS # 484809, check if interp section is NOBITS
Patch116: bash-4.0-nobits.patch Patch116: bash-4.0-nobits.patch
@ -48,22 +53,22 @@ Patch117: bash-4.1-examples.patch
# when output does not succeed due to EPIPE # when output does not succeed due to EPIPE
Patch118: bash-4.1-broken_pipe.patch Patch118: bash-4.1-broken_pipe.patch
# Enable system-wide .bash_logout for login shells # # Enable system-wide .bash_logout for login shells
Patch119: bash-4.2-rc2-logout.patch Patch119: bash-4.2-rc2-logout.patch
# Static analyzis shows some issues in bash-2.05a-interpreter.patch # Static analyzis shows some issues in bash-2.05a-interpreter.patch
Patch120: bash-4.2-coverity.patch Patch120: bash-4.2-coverity.patch
# Don't call malloc in signal handler
Patch121: bash-4.1-defer-sigchld-trap.patch
# 799958, updated info about trap # 799958, updated info about trap
# This patch should be upstreamed.
Patch122: bash-4.2-manpage_trap.patch Patch122: bash-4.2-manpage_trap.patch
# https://www.securecoding.cert.org/confluence/display/seccode/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow # https://www.securecoding.cert.org/confluence/display/seccode/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow
# This patch should be upstreamed.
Patch123: bash-4.2-size_type.patch Patch123: bash-4.2-size_type.patch
# 1112710 - mention ulimit -c and -f POSIX block size # 1112710 - mention ulimit -c and -f POSIX block size
# This patch should be upstreamed.
Patch124: bash-4.3-man-ulimit.patch Patch124: bash-4.3-man-ulimit.patch
# 1102815 - fix double echoes in vi visual mode # 1102815 - fix double echoes in vi visual mode
@ -76,53 +81,32 @@ Patch126: bash-4.3-memleak-lc_all.patch
# this patch disables it # this patch disables it
Patch127: bash-4.4-no-loadable-builtins.patch Patch127: bash-4.4-no-loadable-builtins.patch
# 1068697 - Explicitly unset nonblocking mode while reading from stdin # 2020519 - [Regression] Add a runtime option to enable history logging to syslog
# This should be dropped while rebasing to bash-4.5 # This option is undocumented in upstream and is documented by this patch
Patch128: bash-4.4-unset-nonblock-stdin.patch Patch128: bash-5.0-syslog-history.patch
# 1389838 - command builtin should not abort on variable assignment errors # 2115206 - String matching behaves differently on aarch64
# This should be dropped while rebasing to bash-4.5 Patch129: bash-5.1-mbrtowc.patch
Patch129: bash-4.4-assignment-error.patch
# 1458008 - test builtin ignores subsecond while comparing file modification times # 2141576 - CVE-2022-3715 bash: a heap-buffer-overflow in valid_parameter_transform
# This should be dropped while rebasing to bash-4.5 Patch130: bash-5.2-check-xform.patch
Patch130: bash-4.5-test-modification-time.patch
# 1556867 - case in a for loop inside subshell causes syntax error
# This should be dropped while rebasing to bash-4.5
Patch131: bash-4.4-case-in-command-subst.patch
Patch132: bash-4.4-coverity.patch
# 1687835 - [RFE] Add a runtime option to enable history logging to syslog
# This should be dropped while rebasing to bash-5.0
Patch133: bash-5.0-syslog-history.patch
# 1727952 - Parsing commands break when using $$ in command substitution $(..)
# https://lists.gnu.org/archive/html/bug-bash/2017-01/msg00065.html
Patch134: bash-5.0-shellpid-subshell.patch
# 1793943 - CVE-2019-18276: when effective UID is not equal to its real UID the saved UID is
# not dropped
Patch135: bash-5.0-cve-2019-18276.patch
Patch136: bash-5.0-cve-2019-18276-2.patch
# 1890888 - Took long time to return when bash -c 'exit 2 & wait $!' run in the big size LimitNPROC
# values
Patch137: bash-5.0-bgp-resize.patch
# 1794884 - HISTTIMEFORMAT causes Segmentation fault under certain conditions
Patch138: bash-5.0-histtimeformat-segfault.patch
#2062291 - Segfault in 'buffered_getchar()' function in bash
Patch139: bash-4.4-fix-buffered_getchar-crash.patch
# Enable audit logs # Enable audit logs
Patch140: bash-4.3-audit.patch Patch131: bash-4.3-audit.patch
# Fix an issue with adding newline in bracketed paste mode
Patch132: bash-5.2-add-newline.patch
# RHEL-20020 - Fix a performance regression while using large number of environment variables
Patch133: bash-5.2-pipeline-exec.patch
BuildRequires: gcc
BuildRequires: texinfo bison BuildRequires: texinfo bison
BuildRequires: ncurses-devel BuildRequires: ncurses-devel
BuildRequires: autoconf, gettext BuildRequires: autoconf, gettext
# Required for bash tests
BuildRequires: glibc-all-langpacks
BuildRequires: make
BuildRequires: audit-libs-devel BuildRequires: audit-libs-devel
Requires: filesystem >= 3 Requires: filesystem >= 3
Provides: /bin/sh Provides: /bin/sh
@ -136,8 +120,7 @@ incorporates useful features from the Korn shell (ksh) and the C shell
%package devel %package devel
Summary: Development headers for %{name} Summary: Development headers for %{name}
Requires: %{name} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconf-pkg-config
%description devel %description devel
This package contains development headers for %{name}. This package contains development headers for %{name}.
@ -165,7 +148,12 @@ autoconf
# Recycles pids is neccessary. When bash's last fork's pid was X # Recycles pids is neccessary. When bash's last fork's pid was X
# and new fork's pid is also X, bash has to wait for this same pid. # and new fork's pid is also X, bash has to wait for this same pid.
# Without Recycles pids bash will not wait. # Without Recycles pids bash will not wait.
make "CPPFLAGS=-D_GNU_SOURCE -DRECYCLES_PIDS -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"' `getconf LFS_CFLAGS` -DSYSLOG_HISTORY" %{?_smp_mflags} MFLAGS="CPPFLAGS=-D_GNU_SOURCE -DRECYCLES_PIDS -DDEFAULT_PATH_VALUE='\"/usr/local/bin:/usr/bin\"' `getconf LFS_CFLAGS` -DSYSLOG_HISTORY -DSYSLOG_SHOPT=0"
# work around missing deps in Makefiles
make "$MFLAGS" version.h
make "$MFLAGS" %{?_smp_mflags} -C builtins
make "$MFLAGS" %{?_smp_mflags}
%install %install
if [ -e autoconf ]; then if [ -e autoconf ]; then
@ -178,7 +166,7 @@ sed -i -e 's,bashref\.info,bash.info,' doc/bashref.info
%make_install install-headers %make_install install-headers
mkdir -p %{buildroot}/etc mkdir -p %{buildroot}/%{_sysconfdir}
# make manpages for bash builtins as per suggestion in DOC/README # make manpages for bash builtins as per suggestion in DOC/README
pushd doc pushd doc
@ -215,7 +203,7 @@ rm -f %{buildroot}/%{_mandir}/man1/false.1
ln -sf bash %{buildroot}%{_bindir}/sh ln -sf bash %{buildroot}%{_bindir}/sh
rm -f %{buildroot}%{_infodir}/dir rm -f %{buildroot}%{_infodir}/dir
mkdir -p %{buildroot}/etc/skel mkdir -p %{buildroot}%{_sysconfdir}/skel
install -p -m644 %SOURCE1 %{buildroot}/etc/skel/.bashrc install -p -m644 %SOURCE1 %{buildroot}/etc/skel/.bashrc
install -p -m644 %SOURCE2 %{buildroot}/etc/skel/.bash_profile install -p -m644 %SOURCE2 %{buildroot}/etc/skel/.bash_profile
install -p -m644 %SOURCE3 %{buildroot}/etc/skel/.bash_logout install -p -m644 %SOURCE3 %{buildroot}/etc/skel/.bash_logout
@ -258,7 +246,7 @@ mkdir -p %{buildroot}/%{_pkgdocdir}/doc
rm -rf examples/loadables rm -rf examples/loadables
for file in CHANGES COMPAT NEWS NOTES POSIX RBASH README examples for file in CHANGES COMPAT NEWS NOTES POSIX RBASH README examples
do do
cp -rp "$file" %{buildroot}/%{_pkgdocdir}/"$file" cp -rp "$file" %{buildroot}%{_pkgdocdir}/"$file"
echo "%%doc %{_pkgdocdir}/$file" >> %{name}-doc.files echo "%%doc %{_pkgdocdir}/$file" >> %{name}-doc.files
done done
echo "%%doc %{_pkgdocdir}/doc" >> %{name}-doc.files echo "%%doc %{_pkgdocdir}/doc" >> %{name}-doc.files
@ -288,7 +276,7 @@ end
%postun -p <lua> %postun -p <lua>
-- Run it only if we are uninstalling -- Run it only if we are uninstalling
if arg[2] == "0" if arg[2] == 0
then then
t={} t={}
for line in io.lines("/etc/shells") for line in io.lines("/etc/shells")
@ -344,72 +332,107 @@ end
%{_libdir}/pkgconfig/%{name}.pc %{_libdir}/pkgconfig/%{name}.pc
%changelog %changelog
* Fri Feb 09 2024 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.20-5 * Tue Feb 13 2024 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.8-9
- Fix a performance regression while using large number of environment variables
Resolves: RHEL-20020
* Mon Feb 12 2024 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.8-8
- Fix an issue with adding newline in bracketed paste mode
Resolves: #2168963
* Wed Jan 24 2024 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.8-7
- Restore audit logs in bash-4.3 or newer versions - Restore audit logs in bash-4.3 or newer versions
Resolves: RHEL-24990 Resolves: RHEL-22619
* Tue Apr 05 2022 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.20-4 * Tue Nov 22 2022 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.8-6
- Fix a crash in buffered_getchar() function - Add a null check in parameter_brace_transform() function
Resolves: #2062291 Resolves: CVE-2022-3715
* Thu Sep 30 2021 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.20-3 * Mon Aug 08 2022 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.8-5
- Bump version number - Fix an off by one error while calling mbrtowc()
Resolves: #2004189 Resolves: #2115206
* Mon Jul 26 2021 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.20-2 * Fri Nov 05 2021 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.8-4
- Fix crash if a timestamp in a history file overflowed a time_t
Resolves: #1794884
* Fri Mar 26 2021 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.20-1
- Fix infinite loop in long running scripts
Resolves: #1943495
* Wed Nov 04 2020 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-14
- Fix hang when limit for nproc is very high
Resolves: #1890888
* Fri Oct 09 2020 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-13
- Correctly drop saved UID when effective UID is not equal to its real UID
Resolves: #1793943
* Mon Jun 22 2020 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-12
- Avoid duplicating user path entries
Resolves: #1667008
* Mon Jun 22 2020 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-11
- Drop saved UID when effective UID is not equal to its real UID
Resolves: #1793943
* Thu Aug 22 2019 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-10
- Fix runtime option to enable history logging to syslog - Fix runtime option to enable history logging to syslog
Related: #1687835 Resolves: #2020519
* Wed Jul 10 2019 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-9 * Thu Sep 30 2021 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.8-3
- Fix `$$` expansion in subshell
Resolves: #1727952
* Mon May 27 2019 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-8
- Add a runtime option to enable history logging to syslog
Resolves: #1687835
* Mon Jan 14 2019 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-7
- Bump version number - Bump version number
Resolves: #1650059 Resolves: #2006138
* Tue Oct 09 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-6 * Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 5.1.8-2
- Set custom PATH in non-login shells - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Resolves: #1627074 Related: rhbz#1991688
* Thu Sep 20 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-5 * Fri Jul 23 2021 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.8-1
- Update to bash-5.1 patchlevel 8
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 5.1.0-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jan 6 10:40:25 CET 2021 Siteshwar Vashisht <svashisht@redhat.com> - 5.1.0-1
- Rebase to bash 5.1
Resolves: #1904866
* Fri Dec 4 14:44:06 CET 2020 Siteshwar Vashisht <svashisht@redhat.com> - 5.0.17-3
- Enable sourcing files from ~/.bashrc.d
Resolves: #1726397
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.17-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jun 01 2020 Siteshwar Vashisht <svashisht@redhat.com> - 5.0.17-1
- Update to bash-5.0 patchlevel 17
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Dec 06 2019 Siteshwar Vashisht <svashisht@redhat.com> - 5.0.11-1
- Update to bash-5.0 patchlevel 11
Resolves: #1745602
* Fri Aug 02 2019 Kamil Dudka <kdudka@redhat.com> - 5.0.7-3
- Sanitize public header file <shell.h>
Resolves: #1736676
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue May 07 2019 Siteshwar Vashisht <svashisht@redhat.com> - 5.0.7-1
- Update to bash-5.0 patchlevel 7
* Thu Feb 14 2019 Siteshwar Vashisht <svashisht@redhat.com> - 5.0.2-1
- Rebase to bash 5.0
Resolves: #1675080
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.23-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Jan 10 2019 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.23-6
- Avoid duplicating user path entries
Resolves: #1652639
* Mon Oct 08 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.23-5
- Fix some issues identified by coverity - Fix some issues identified by coverity
Resolves: #1602450
* Mon Aug 06 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-4 * Mon Sep 10 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.23-4
- Bump version number - Set custom PATH in non-login shells
Resolves: #1615131
* Tue Jun 26 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-3 * Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.23-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jun 25 2018 Miro Hrončok <mhroncok@redhat.com> - 4.4.23-2
- Move user bin directories in front of the PATH - Move user bin directories in front of the PATH
Resolves: #1595223 See: https://fedoraproject.org/wiki/Changes/UserPathPrioritization
Resolves: #1595098
* Tue Jun 12 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.23-1
- Update to bash-4.4 patchlevel 23
Resolves: #1585510
* Thu Mar 15 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-2 * Thu Mar 15 2018 Siteshwar Vashisht <svashisht@redhat.com> - 4.4.19-2
- Fix handling case statement in command subsitution - Fix handling case statement in command subsitution

View File

@ -16,3 +16,12 @@ export PATH
# export SYSTEMD_PAGER= # export SYSTEMD_PAGER=
# User specific aliases and functions # User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

11
plans/shell.fmf Normal file
View File

@ -0,0 +1,11 @@
summary:
Run relevant tests from the shell tests repository
discover:
how: fmf
url: https://src.fedoraproject.org/tests/shell
filter: component:bash
execute:
how: tmt
environment:
PACKAGES: bash
SH_BIN: bash

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (bash-5.1.tar.gz) = c44a0ce381469219548a3a27589af3fea4f22eda1ca4e9434b59fc16da81b471c29ce18e31590e0860a6a251a664b68c2b45e3a17d22cfc02799ffd9a208390c