This commit is contained in:
Ertuğrul Erata
2017-01-28 21:03:37 +03:00
parent 1c6bc393de
commit 6f9999c4eb
22 changed files with 967 additions and 74 deletions
@@ -1,9 +1,10 @@
diff -up bash-4.2-rc2/config.h.in.interpreter bash-4.2-rc2/config.h.in
--- bash-4.2-rc2/config.h.in.interpreter 2011-02-09 07:59:21.000000000 +0100
+++ bash-4.2-rc2/config.h.in 2011-02-09 07:59:21.000000000 +0100
@@ -706,6 +706,9 @@
/* Define if you have the pathconf function. */
#undef HAVE_PATHCONF
diff --git a/config.h.in b/config.h.in
index a5ad9e7..62a6b32 100644
--- a/config.h.in
+++ b/config.h.in
@@ -748,6 +748,9 @@
/* Define if you have the pselect function. */
#undef HAVE_PSELECT
+/* Define if you have the pread function. */
+#undef HAVE_PREAD
@@ -11,7 +12,7 @@ diff -up bash-4.2-rc2/config.h.in.interpreter bash-4.2-rc2/config.h.in
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
@@ -898,6 +901,9 @@
@@ -946,6 +949,9 @@
/* Define if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -21,30 +22,32 @@ diff -up bash-4.2-rc2/config.h.in.interpreter bash-4.2-rc2/config.h.in
/* Define if you have the <grp.h> header file. */
#undef HAVE_GRP_H
diff -up bash-4.2-rc2/configure.in.interpreter bash-4.2-rc2/configure.in
--- bash-4.2-rc2/configure.in.interpreter 2011-01-16 21:31:12.000000000 +0100
+++ bash-4.2-rc2/configure.ac 2011-02-09 08:02:27.000000000 +0100
@@ -659,7 +659,7 @@ BASH_HEADER_INTTYPES
diff --git a/configure.ac b/configure.ac
index ce4e9b6..eda95d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -700,7 +700,7 @@ BASH_HEADER_INTTYPES
AC_CHECK_HEADERS(unistd.h stdlib.h stdarg.h varargs.h limits.h string.h \
memory.h locale.h termcap.h termio.h termios.h dlfcn.h \
stdbool.h stddef.h stdint.h netdb.h pwd.h grp.h strings.h \
- regex.h syslog.h ulimit.h)
+ regex.h syslog.h ulimit.h elf.h)
AC_CHECK_HEADERS(sys/pte.h sys/stream.h sys/select.h sys/file.h \
sys/resource.h sys/param.h sys/socket.h sys/stat.h \
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)
@@ -723,7 +723,7 @@ dnl checks for system calls
@@ -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 readlink sbrk select setdtablesize \
kill killpg lstat pselect readlink sbrk select setdtablesize \
- setitimer tcgetpgrp uname ulimit waitpid)
+ setitimer tcgetpgrp uname ulimit waitpid pread)
AC_REPLACE_FUNCS(rename)
dnl checks for c library functions
diff -up bash-4.2-rc2/execute_cmd.c.interpreter bash-4.2-rc2/execute_cmd.c
--- bash-4.2-rc2/execute_cmd.c.interpreter 2011-01-20 04:24:47.000000000 +0100
+++ bash-4.2-rc2/execute_cmd.c 2011-02-09 07:59:21.000000000 +0100
diff --git a/execute_cmd.c b/execute_cmd.c
index 2a3df6d..b5cd405 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -41,6 +41,10 @@
# include <unistd.h>
#endif
@@ -56,31 +59,30 @@ diff -up bash-4.2-rc2/execute_cmd.c.interpreter bash-4.2-rc2/execute_cmd.c
#include "posixtime.h"
#if defined (HAVE_SYS_RESOURCE_H) && !defined (RLIMTYPE)
@@ -4975,14 +4979,22 @@ shell_execve (command, args, env)
@@ -5486,6 +5490,14 @@ shell_execve (command, args, env)
{
/* The file has the execute bits set, but the kernel refuses to
run it for some reason. See why. */
+#if defined (HAVE_HASH_BANG_EXEC) || defined (HAVE_ELF_H)
+ int fd = open (command, O_RDONLY);
+ int fd = open (command, O_RDONLY);
+
+ if (fd >= 0)
+ sample_len = read (fd, sample, sizeof (sample));
+ else
+ sample_len = -1;
+ if (fd >= 0)
+ sample_len = read (fd, sample, sizeof (sample));
+ else
+ sample_len = -1;
+#endif
#if defined (HAVE_HASH_BANG_EXEC)
- READ_SAMPLE_BUF (command, sample, sample_len);
sample[sample_len - 1] = '\0';
if (sample_len > 2 && sample[0] == '#' && sample[1] == '!')
{
READ_SAMPLE_BUF (command, sample, sample_len);
if (sample_len > 0)
@@ -5495,6 +5507,7 @@ shell_execve (command, args, env)
char *interp;
int ilen;
+ close (fd);
+ close (fd);
interp = getinterp (sample, sample_len, (int *)NULL);
ilen = strlen (interp);
errno = i;
@@ -4997,6 +5009,136 @@ shell_execve (command, args, env)
@@ -5510,6 +5523,136 @@ shell_execve (command, args, env)
return (EX_NOEXEC);
}
#endif
@@ -217,3 +219,6 @@ diff -up bash-4.2-rc2/execute_cmd.c.interpreter bash-4.2-rc2/execute_cmd.c
errno = i;
file_error (command);
}
--
2.9.3
@@ -1,7 +1,8 @@
diff -up bash-3.2/config-top.h.logout bash-3.2/config-top.h
--- bash-3.2/config-top.h.logout 2011-04-14 08:55:55.000000000 +0200
+++ bash-3.2/config-top.h 2011-04-14 08:55:55.000000000 +0200
@@ -78,7 +78,7 @@
diff --git a/config-top.h b/config-top.h
index 026d4a4..cb0e002 100644
--- a/config-top.h
+++ b/config-top.h
@@ -92,7 +92,7 @@
/* #define SYS_BASHRC "/etc/bash.bashrc" */
/* System-wide .bash_logout for login shells. */
@@ -10,12 +11,13 @@ diff -up bash-3.2/config-top.h.logout bash-3.2/config-top.h
/* Define this to make non-interactive shells begun with argv[0][0] == '-'
run the startup files when not in posix mode. */
diff -up bash-3.2/doc/bash.1.logout bash-3.2/doc/bash.1
--- bash-3.2/doc/bash.1.logout 2011-04-14 09:16:32.000000000 +0200
+++ bash-3.2/doc/bash.1 2011-04-14 11:59:33.000000000 +0200
@@ -326,8 +326,8 @@ option may be used when the shell is sta
.PP
When a login shell exits,
diff --git a/doc/bash.1 b/doc/bash.1
index 04ce845..bfde55e 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -335,8 +335,8 @@ option may be used when the shell is started to inhibit this behavior.
When an interactive login shell exits,
or a non-interactive login shell executes the \fBexit\fP builtin command,
.B bash
-reads and executes commands from the file \fI~/.bash_logout\fP, if it
-exists.
@@ -24,7 +26,7 @@ diff -up bash-3.2/doc/bash.1.logout bash-3.2/doc/bash.1
.PP
When an interactive shell that is not a login shell is started,
.B bash
@@ -8814,6 +8814,9 @@ The \fBbash\fP executable
@@ -10558,6 +10558,9 @@ The \fBbash\fP executable
.FN /etc/profile
The systemwide initialization file, executed for login shells
.TP
@@ -34,3 +36,6 @@ diff -up bash-3.2/doc/bash.1.logout bash-3.2/doc/bash.1
.FN ~/.bash_profile
The personal initialization file, executed for login shells
.TP
--
2.9.3
@@ -0,0 +1,47 @@
*** ../bash-4.3-patched/shell.h 2012-12-25 21:11:01.000000000 -0500
--- shell.h 2014-06-03 09:24:28.000000000 -0400
***************
*** 169,173 ****
int expand_aliases;
int echo_input_at_read;
!
} sh_parser_state_t;
--- 169,174 ----
int expand_aliases;
int echo_input_at_read;
! int need_here_doc;
!
} sh_parser_state_t;
*** ../bash-4.3-patched/parse.y 2014-05-14 09:16:40.000000000 -0400
--- parse.y 2014-04-30 09:27:59.000000000 -0400
***************
*** 2643,2647 ****
r = 0;
! while (need_here_doc)
{
parser_state |= PST_HEREDOC;
--- 2643,2647 ----
r = 0;
! while (need_here_doc > 0)
{
parser_state |= PST_HEREDOC;
***************
*** 6076,6079 ****
--- 6076,6080 ----
ps->expand_aliases = expand_aliases;
ps->echo_input_at_read = echo_input_at_read;
+ ps->need_here_doc = need_here_doc;
ps->token = token;
***************
*** 6124,6127 ****
--- 6125,6129 ----
expand_aliases = ps->expand_aliases;
echo_input_at_read = ps->echo_input_at_read;
+ need_here_doc = ps->need_here_doc;
FREE (token);
@@ -0,0 +1,24 @@
*** ../bash-4.3-patched/execute_cmd.c 2014-01-31 10:54:52.000000000 -0500
--- execute_cmd.c 2014-06-19 08:05:49.000000000 -0400
***************
*** 2410,2414 ****
lstdin = wait_for (lastpid);
#if defined (JOB_CONTROL)
! exec_result = job_exit_status (lastpipe_jid);
#endif
unfreeze_jobs_list ();
--- 2425,2438 ----
lstdin = wait_for (lastpid);
#if defined (JOB_CONTROL)
! /* If wait_for removes the job from the jobs table, use result of last
! command as pipeline's exit status as usual. The jobs list can get
! frozen and unfrozen at inconvenient times if there are multiple pipelines
! running simultaneously. */
! if (INVALID_JOB (lastpipe_jid) == 0)
! exec_result = job_exit_status (lastpipe_jid);
! else if (pipefail_opt)
! exec_result = exec_result | lstdin; /* XXX */
! /* otherwise we use exec_result */
!
#endif
unfreeze_jobs_list ();
@@ -0,0 +1,15 @@
diff --git a/doc/bash.1 b/doc/bash.1
index 6e8aebb..e846e68 100644
--- a/doc/bash.1
+++ b/doc/bash.1
@@ -10333,6 +10333,7 @@ and
which are in 512-byte increments.
The return status is 0 unless an invalid option or argument is supplied,
or an error occurs while setting a new limit.
+In POSIX Mode 512-byte blocks are used for the `-c' and `-f' options.
.RE
.TP
\fBumask\fP [\fB\-p\fP] [\fB\-S\fP] [\fImode\fP]
--
2.9.3
@@ -0,0 +1,12 @@
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);
@@ -0,0 +1,46 @@
diff --git a/parse.y b/parse.y
index 30425a5..85f1c4f 100644
--- a/parse.y
+++ b/parse.y
@@ -4228,6 +4228,8 @@ xparse_dolparen (base, string, indp, flags)
save_parser_state (&ps);
save_input_line_state (&ls);
orig_eof_token = shell_eof_token;
+ /* avoid echoing every substitution again */
+ echo_input_at_read = 0;
/*(*/
parser_state |= PST_CMDSUBST|PST_EOFTOKEN; /* allow instant ')' */ /*(*/
diff --git a/subst.c b/subst.c
index f1a4df1..a93a4ce 100644
--- a/subst.c
+++ b/subst.c
@@ -8513,6 +8513,7 @@ param_expand (string, sindex, quoted, expanded_something,
WORD_LIST *list;
WORD_DESC *tdesc, *ret;
int tflag;
+ int old_echo_input;
/*itrace("param_expand: `%s' pflags = %d", string+*sindex, pflags);*/
zindex = *sindex;
@@ -8831,6 +8832,9 @@ arithsub:
}
comsub:
+ old_echo_input = echo_input_at_read;
+ /* avoid echoing every substitution again */
+ echo_input_at_read = 0;
if (pflags & PF_NOCOMSUB)
/* we need zindex+1 because string[zindex] == RPAREN */
temp1 = substring (string, *sindex, zindex+1);
@@ -8843,6 +8847,7 @@ comsub:
}
FREE (temp);
temp = temp1;
+ echo_input_at_read = old_echo_input;
break;
/* Do POSIX.2d9-style arithmetic substitution. This will probably go
--
2.9.3
@@ -0,0 +1,28 @@
*** ../bash-4.3-patched/parse.y 2014-04-07 11:56:12.000000000 -0400
--- parse.y 2014-06-11 10:25:53.000000000 -0400
***************
*** 2789,2797 ****
case OR_OR:
case '&':
case DO:
case THEN:
case ELSE:
case '{': /* } */
! case '(': /* ) */
case BANG: /* ! time pipeline */
case TIME: /* time time pipeline */
--- 2789,2802 ----
case OR_OR:
case '&':
+ case WHILE:
case DO:
+ case UNTIL:
+ case IF:
case THEN:
+ case ELIF:
case ELSE:
case '{': /* } */
! case '(': /* )( */
! case ')': /* only valid in case statement */
case BANG: /* ! time pipeline */
case TIME: /* time time pipeline */
@@ -0,0 +1,18 @@
*** ../bash-4.3-patched/lib/readline/misc.c 2012-09-01 18:03:11.000000000 -0400
--- lib/readline/misc.c 2014-06-30 13:41:19.000000000 -0400
***************
*** 462,465 ****
--- 462,466 ----
/* Set up rl_line_buffer and other variables from history entry */
rl_replace_from_history (entry, 0); /* entry->line is now current */
+ entry->data = 0; /* entry->data is now current undo list */
/* Undo all changes to this history entry */
while (rl_undo_list)
***************
*** 469,473 ****
FREE (entry->line);
entry->line = savestring (rl_line_buffer);
- entry->data = 0;
}
entry = previous_history ();
--- 470,473 ----
@@ -0,0 +1,15 @@
diff --git a/Makefile.in b/Makefile.in
index a1f9483..24c646a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -800,7 +800,6 @@ install: .made installdirs
infodir=$(infodir) htmldir=$(htmldir) DESTDIR=$(DESTDIR) $@ )
-( cd $(DEFDIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
-( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
- -( cd $(LOADABLES_DIR) && $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ )
install-strip:
$(MAKE) $(MFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
--
2.9.3
@@ -0,0 +1,49 @@
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
@@ -0,0 +1,39 @@
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
@@ -0,0 +1,39 @@
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
@@ -0,0 +1,59 @@
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
@@ -0,0 +1,52 @@
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
@@ -0,0 +1,81 @@
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
@@ -0,0 +1,42 @@
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
@@ -0,0 +1,50 @@
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
@@ -0,0 +1,114 @@
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
@@ -0,0 +1,71 @@
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
@@ -0,0 +1,80 @@
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
+35 -33
View File
@@ -12,30 +12,23 @@
<IsA>app:console</IsA>
<Summary>The standard GNU Bourne again shell</Summary>
<Description>Bash is the GNU Project's Bourne Again SHell, a complete implementation of the IEEE POSIX and Open Group shell specification with interactive command line editing, csh-like features such as history substitution.</Description>
<Archive sha1sum="33b1bcc5dca1b72f28b2baeca6efa0d422097964" type="targz">mirrors://gnu/bash/bash-4.3.30.tar.gz</Archive>
<Archive sha1sum="8de012df1e4f3e91f571c3eb8ec45b43d7c747eb" type="targz">mirrors://gnu/bash/bash-4.4.tar.gz</Archive>
<BuildDependencies>
<Dependency>ncurses-devel</Dependency>
</BuildDependencies>
<Patches>
<!-- Official Patches ftp://ftp.cwru.edu/pub/bash/bash-4.3-patches/ -->
<Patch level="0" compressionType="gzip">official/bash43-031.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-032.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-033.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-034.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-035.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-036.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-037.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-038.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-039.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-040.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-041.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-042.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-043.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-044.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-045.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-046.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-047.tar.gz</Patch>
<Patch level="0" compressionType="gzip">official/bash43-048.tar.gz</Patch>
<!-- Official Patches -->
<Patch level="1">official/bash-4.4-patch-1.patch</Patch>
<Patch level="1">official/bash-4.4-patch-2.patch</Patch>
<Patch level="1">official/bash-4.4-patch-3.patch</Patch>
<Patch level="1">official/bash-4.4-patch-4.patch</Patch>
<Patch level="1">official/bash-4.4-patch-5.patch</Patch>
<Patch level="1">official/bash-4.4-patch-6.patch</Patch>
<Patch level="1">official/bash-4.4-patch-7.patch</Patch>
<Patch level="1">official/bash-4.4-patch-8.patch</Patch>
<Patch level="1">official/bash-4.4-patch-9.patch</Patch>
<Patch level="1">official/bash-4.4-patch-10.patch</Patch>
<Patch level="1">official/bash-4.4-patch-11.patch</Patch>
<!-- Fedora patches -->
<Patch level="1">fedora/bash-2.02-security.patch</Patch>
@@ -45,24 +38,26 @@
<Patch level="1">fedora/bash-2.05b-debuginfo.patch</Patch>
<Patch level="1">fedora/bash-2.05b-manso.patch</Patch>
<Patch level="1">fedora/bash-2.05b-pgrp_sync.patch</Patch>
<Patch level="1">fedora/bash-2.05b-readline-oom.patch</Patch>
<Patch level="1">fedora/bash-2.05b-xcc.patch</Patch>
<Patch level="1">fedora/bash-3.2-audit.patch</Patch>
<Patch level="1">fedora/bash-3.2-ssh_source_bash.patch</Patch>
<Patch level="1">fedora/bash-4.0-nobits.patch</Patch>
<Patch level="1">fedora/bash-4.1-broken_pipe.patch</Patch>
<Patch level="1">fedora/bash-4.1-defer-sigchld-trap.patch</Patch>
<Patch level="1">fedora/bash-4.1-examples.patch</Patch>
<Patch level="1">fedora/bash-4.2-coverity.patch</Patch>
<Patch level="1">fedora/bash-4.2-manpage_trap.patch</Patch>
<Patch level="1">fedora/bash-4.2-rc2-logout.patch</Patch>
<Patch level="1">fedora/bash-4.2-size_type.patch</Patch>
<Patch level="1">fedora/bash-bashbug.patch</Patch>
<!--Patch level="1">fedora/bash-bashbug.patch</Patch>
<Patch level="1">fedora/bash-infotags.patch</Patch>
<Patch level="1">fedora/bash-requires.patch</Patch>
<Patch level="1">fedora/bash-requires.patch</Patch-->
<Patch level="1">fedora/bash-setlocale.patch</Patch>
<Patch level="1">fedora/bash-tty-tests.patch</Patch>
<!-- <Patch level="1">fedora/bash-4.2-trap.patch</Patch> -->
<Patch level="1">fedora/bash-tty-tests.patch</Patch>
<Patch level="1">fedora/bash-4.0-nobits.patch</Patch>
<Patch level="1">fedora/bash-4.1-examples.patch</Patch>
<Patch level="1">fedora/bash-4.1-broken_pipe.patch</Patch>
<Patch level="1">fedora/bash-4.2-rc2-logout.patch</Patch>
<Patch level="1">fedora/bash-4.2-coverity.patch</Patch>
<Patch level="1">fedora/bash-4.1-defer-sigchld-trap.patch</Patch>
<Patch level="1">fedora/bash-4.2-manpage_trap.patch</Patch>
<Patch level="1">fedora/bash-4.2-size_type.patch</Patch>
<Patch level="1">fedora/bash-4.3-man-ulimit.patch</Patch>
<Patch level="1">fedora/bash-4.3-noecho.patch</Patch>
<Patch level="1">fedora/bash-4.3-memleak-lc_all.patch</Patch>
<Patch level="1">fedora/bash-4.4-no-loadable-builtins.patch</Patch>
</Patches>
</Source>
@@ -87,6 +82,13 @@
</Package>
<History>
<Update release="5">
<Date>2017-01-28</Date>
<Version>4.4</Version>
<Comment>Version bump.</Comment>
<Name>Ertuğrul Erata</Name>
<Email>ertugrulerata@gmail.com</Email>
</Update>
<Update release="4">
<Date>2017-01-06</Date>
<Version>4.3_p48</Version>