From ed01fac9bcb777519f01924d8d279ba23726c2cb Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Sat, 21 Jan 2017 05:25:05 +0100 Subject: [PATCH] Update to bash-4.4 patchlevel 11 --- bash-4.4-patch-10.patch | 39 ++++++++++++++ bash-4.4-patch-11.patch | 39 ++++++++++++++ bash-4.4-patch-6.patch | 50 ++++++++++++++++++ bash-4.4-patch-7.patch | 114 ++++++++++++++++++++++++++++++++++++++++ bash-4.4-patch-8.patch | 71 +++++++++++++++++++++++++ bash-4.4-patch-9.patch | 80 ++++++++++++++++++++++++++++ bash.spec | 7 ++- 7 files changed, 398 insertions(+), 2 deletions(-) create mode 100644 bash-4.4-patch-10.patch create mode 100644 bash-4.4-patch-11.patch create mode 100644 bash-4.4-patch-6.patch create mode 100644 bash-4.4-patch-7.patch create mode 100644 bash-4.4-patch-8.patch create mode 100644 bash-4.4-patch-9.patch diff --git a/bash-4.4-patch-10.patch b/bash-4.4-patch-10.patch new file mode 100644 index 0000000..ec0fbfe --- /dev/null +++ b/bash-4.4-patch-10.patch @@ -0,0 +1,39 @@ +From 5b9762d6f0cd36ff1b88bde22efa30ad0ed27ec6 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +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 + diff --git a/bash-4.4-patch-11.patch b/bash-4.4-patch-11.patch new file mode 100644 index 0000000..d3ec76a --- /dev/null +++ b/bash-4.4-patch-11.patch @@ -0,0 +1,39 @@ +From 76bb456d8fcd870cd31b7bf9d90798cd97cee2ab Mon Sep 17 00:00:00 2001 +From: Chet Ramey +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 + diff --git a/bash-4.4-patch-6.patch b/bash-4.4-patch-6.patch new file mode 100644 index 0000000..a6e3551 --- /dev/null +++ b/bash-4.4-patch-6.patch @@ -0,0 +1,50 @@ +From 44bfefc553993613c0aff992bc4f3078d738ee1d Mon Sep 17 00:00:00 2001 +From: Chet Ramey +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 + diff --git a/bash-4.4-patch-7.patch b/bash-4.4-patch-7.patch new file mode 100644 index 0000000..2db3d82 --- /dev/null +++ b/bash-4.4-patch-7.patch @@ -0,0 +1,114 @@ +From 4f747edc625815f449048579f6e65869914dd715 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +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 + diff --git a/bash-4.4-patch-8.patch b/bash-4.4-patch-8.patch new file mode 100644 index 0000000..fc435f9 --- /dev/null +++ b/bash-4.4-patch-8.patch @@ -0,0 +1,71 @@ +From b9f81c2977b82490cd4dc70b0bb292bfbf86bd2c Mon Sep 17 00:00:00 2001 +From: Chet Ramey +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 + diff --git a/bash-4.4-patch-9.patch b/bash-4.4-patch-9.patch new file mode 100644 index 0000000..b759e01 --- /dev/null +++ b/bash-4.4-patch-9.patch @@ -0,0 +1,80 @@ +From e59fb114e9c0436890d110cfdda4d794a63496e7 Mon Sep 17 00:00:00 2001 +From: Chet Ramey +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 + diff --git a/bash.spec b/bash.spec index f5f6477..3e129f2 100644 --- a/bash.spec +++ b/bash.spec @@ -1,6 +1,6 @@ #% define beta_tag rc2 %global _hardened_build 1 -%define patchleveltag .5 +%define patchleveltag .11 %define baseversion 4.4 %bcond_without tests %{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} @@ -22,7 +22,7 @@ Source3: dot-bash_logout # Official upstream patches # Patches are converted to apply with '-p1' -%{lua:for i=1,5 do print(string.format("Patch%u: bash-4.4-patch-%u.patch\n", i, i)) end} +%{lua:for i=1,11 do print(string.format("Patch%u: bash-4.4-patch-%u.patch\n", i, i)) end} # Other patches Patch101: bash-2.02-security.patch @@ -295,6 +295,9 @@ end %doc doc/*.ps doc/*.0 doc/*.html doc/article.txt %changelog +* Sat Jan 21 2017 Siteshwar Vashisht - 4.4.11-1 +- Update to bash-4.4 patchlevel 11 + * Mon Jan 16 2017 Siteshwar Vashisht - 4.4.5-1 - Update to bash-4.4 patchlevel 5