diff options
Diffstat (limited to 'data')
75 files changed, 1755 insertions, 3787 deletions
diff --git a/data/bash/_metadata/maintainer b/data/bash/_metadata/maintainer deleted file mode 120000 index 0fa66e077..000000000 --- a/data/bash/_metadata/maintainer +++ /dev/null @@ -1 +0,0 @@ -../../../people/saurik
\ No newline at end of file diff --git a/data/bash/_metadata/readline.ver.iphoneos-arm b/data/bash/_metadata/readline.ver.iphoneos-arm index 042fbf08c..48b0c7a0d 100644 --- a/data/bash/_metadata/readline.ver.iphoneos-arm +++ b/data/bash/_metadata/readline.ver.iphoneos-arm @@ -1 +1 @@ -6.0-7 +7.0.5-1 diff --git a/data/bash/_metadata/readline.ver.iphoneos-arm64 b/data/bash/_metadata/readline.ver.iphoneos-arm64 new file mode 100644 index 000000000..48b0c7a0d --- /dev/null +++ b/data/bash/_metadata/readline.ver.iphoneos-arm64 @@ -0,0 +1 @@ +7.0.5-1 diff --git a/data/bash/_metadata/version b/data/bash/_metadata/version index e2cdb5695..36a9353f4 100644 --- a/data/bash/_metadata/version +++ b/data/bash/_metadata/version @@ -1 +1 @@ -4.0.44 +4.4.23 diff --git a/data/bash/bash-4.0.tar.gz b/data/bash/bash-4.0.tar.gz Binary files differdeleted file mode 100644 index b5b6b9d4e..000000000 --- a/data/bash/bash-4.0.tar.gz +++ /dev/null diff --git a/data/bash/bash-4.4.tar.gz b/data/bash/bash-4.4.tar.gz Binary files differnew file mode 100644 index 000000000..a31238473 --- /dev/null +++ b/data/bash/bash-4.4.tar.gz diff --git a/data/bash/bash40-001 b/data/bash/bash40-001 deleted file mode 100644 index 5c6bb34b2..000000000 --- a/data/bash/bash40-001 +++ /dev/null @@ -1,162 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-001 - -Bug-Reported-by: Mike Frysinger <vapier@gentoo.org> -Bug-Reference-ID: <200902211821.42188.vapier@gentoo.org> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00147.html - -Bug-Description: - -Bash has problems parsing certain constructs inside Posix-style $(...) -command substitutions, mostly with backslash-quoting and reserved word -recognition. This is an issue because the contents are parsed at the -time the word containing the command substitution is read. - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-03-06 20:32:35.000000000 -0500 -*************** -*** 2928,2931 **** ---- 2932,2936 ---- - #define LEX_HEREDELIM 0x100 /* reading here-doc delimiter */ - #define LEX_STRIPDOC 0x200 /* <<- strip tabs from here doc delim */ -+ #define LEX_INWORD 0x400 - - #define COMSUB_META(ch) ((ch) == ';' || (ch) == '&' || (ch) == '|') -*************** -*** 3180,3184 **** - int *lenp, flags; - { -! int count, ch, peekc, tflags, lex_rwlen, lex_firstind; - int nestlen, ttranslen, start_lineno; - char *ret, *nestret, *ttrans, *heredelim; ---- 3188,3192 ---- - int *lenp, flags; - { -! int count, ch, peekc, tflags, lex_rwlen, lex_wlen, lex_firstind; - int nestlen, ttranslen, start_lineno; - char *ret, *nestret, *ttrans, *heredelim; -*************** -*** 3201,3205 **** - - start_lineno = line_number; -! lex_rwlen = 0; - - heredelim = 0; ---- 3209,3213 ---- - - start_lineno = line_number; -! lex_rwlen = lex_wlen = 0; - - heredelim = 0; -*************** -*** 3268,3271 **** ---- 3276,3319 ---- - } - -+ if (tflags & LEX_PASSNEXT) /* last char was backslash */ -+ { -+ /*itrace("parse_comsub:%d: lex_passnext -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ -+ tflags &= ~LEX_PASSNEXT; -+ if (qc != '\'' && ch == '\n') /* double-quoted \<newline> disappears. */ -+ { -+ if (retind > 0) -+ retind--; /* swallow previously-added backslash */ -+ continue; -+ } -+ -+ RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); -+ if MBTEST(ch == CTLESC || ch == CTLNUL) -+ ret[retind++] = CTLESC; -+ ret[retind++] = ch; -+ continue; -+ } -+ -+ /* If this is a shell break character, we are not in a word. If not, -+ we either start or continue a word. */ -+ if MBTEST(shellbreak (ch)) -+ { -+ tflags &= ~LEX_INWORD; -+ /*itrace("parse_comsub:%d: lex_inword -> 0 ch = `%c' (%d)", line_number, ch, __LINE__);*/ -+ } -+ else -+ { -+ if (tflags & LEX_INWORD) -+ { -+ lex_wlen++; -+ /*itrace("parse_comsub:%d: lex_inword == 1 ch = `%c' lex_wlen = %d (%d)", line_number, ch, lex_wlen, __LINE__);*/ -+ } -+ else -+ { -+ /*itrace("parse_comsub:%d: lex_inword -> 1 ch = `%c' (%d)", line_number, ch, __LINE__);*/ -+ tflags |= LEX_INWORD; -+ lex_wlen = 0; -+ } -+ } -+ - /* Skip whitespace */ - if MBTEST(shellblank (ch) && lex_rwlen == 0) -*************** -*** 3400,3428 **** - } - else -! ch = peekc; /* fall through and continue XXX - this skips comments if peekc == '#' */ - } -! /* Not exactly right yet, should handle shell metacharacters, too. If -! any changes are made to this test, make analogous changes to subst.c: -! extract_delimited_string(). */ -! else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (retind == 0 || ret[retind-1] == '\n' || shellblank (ret[retind - 1]))) - tflags |= LEX_INCOMMENT; - -! if (tflags & LEX_PASSNEXT) /* last char was backslash */ -! { -! tflags &= ~LEX_PASSNEXT; -! if (qc != '\'' && ch == '\n') /* double-quoted \<newline> disappears. */ -! { -! if (retind > 0) -! retind--; /* swallow previously-added backslash */ -! continue; -! } -! -! RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); -! if MBTEST(ch == CTLESC || ch == CTLNUL) -! ret[retind++] = CTLESC; -! ret[retind++] = ch; -! continue; -! } -! else if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ - { - RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); ---- 3442,3454 ---- - } - else -! ch = peekc; /* fall through and continue XXX */ - } -! else if MBTEST((tflags & LEX_CKCOMMENT) && (tflags & LEX_INCOMMENT) == 0 && ch == '#' && (((tflags & LEX_RESWDOK) && lex_rwlen == 0) || ((tflags & LEX_INWORD) && lex_wlen == 0))) -! { -! /*itrace("parse_comsub:%d: lex_incomment -> 1 (%d)", line_number, __LINE__);*/ - tflags |= LEX_INCOMMENT; -+ } - -! if MBTEST(ch == CTLESC || ch == CTLNUL) /* special shell escapes */ - { - RESIZE_MALLOCED_BUFFER (ret, retind, 2, retsize, 64); -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 0 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 1 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-002 b/data/bash/bash40-002 deleted file mode 100644 index 18bd25e7b..000000000 --- a/data/bash/bash40-002 +++ /dev/null @@ -1,43 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-002 - -Bug-Reported-by: phil@Arcturus.universe -Bug-Reference-ID: <20090221143709.13878.qmail@Arcturus.universe> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00142.html - -Bug-Description: - -A line inadvertenly omitted from a submitted patch results in core dumps -when attempting filename completion while using the bash-completion -package. - -Patch: - -*** ../bash-4.0/pcomplete.c 2009-02-01 17:12:31.000000000 -0500 ---- pcomplete.c 2009-02-22 17:08:25.000000000 -0500 -*************** -*** 1033,1036 **** ---- 1033,1037 ---- - - pps = &ps; -+ save_parser_state (pps); - begin_unwind_frame ("gen-shell-function-matches"); - add_unwind_protect (restore_parser_state, (char *)pps); -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 1 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 2 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-003 b/data/bash/bash40-003 deleted file mode 100644 index cc941d5e9..000000000 --- a/data/bash/bash40-003 +++ /dev/null @@ -1,70 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-003 - -Bug-Reported-by: Bernd Eggink <monoped@sudrala.de> -Bug-Reference-ID: <49A323F5.60503@sudrala.de> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00177.html - -Bug-Description: - -Under certain circumstances, constructs containing command substitutions -prevent PS1 from being re-evaluated and updated before being displayed. - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-02-25 15:58:25.000000000 -0500 -*************** -*** 1616,1623 **** - int *ret; - -! ret = (int *)xmalloc (3 * sizeof (int)); - ret[0] = last_read_token; - ret[1] = token_before_that; - ret[2] = two_tokens_ago; - return ret; - } ---- 1616,1624 ---- - int *ret; - -! ret = (int *)xmalloc (4 * sizeof (int)); - ret[0] = last_read_token; - ret[1] = token_before_that; - ret[2] = two_tokens_ago; -+ ret[3] = current_token; - return ret; - } -*************** -*** 1632,1635 **** ---- 1633,1637 ---- - token_before_that = ts[1]; - two_tokens_ago = ts[2]; -+ current_token = ts[3]; - } - -*************** -*** 2669,2672 **** ---- 2671,2675 ---- - word_desc_to_read = (WORD_DESC *)NULL; - -+ current_token = '\n'; /* XXX */ - last_read_token = '\n'; - token_to_read = '\n'; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 2 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 3 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-004 b/data/bash/bash40-004 deleted file mode 100644 index 6ab6c4ee6..000000000 --- a/data/bash/bash40-004 +++ /dev/null @@ -1,47 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-004 - -Bug-Reported-by: Mike Frysinger <vapier@gentoo.org> -Bug-Reference-ID: <200902231720.30519.vapier@gentoo.org> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00176.html - -Bug-Description: - -In some cases, enabling the `checkjobs' shell option will cause the shell -to core dump when executing the `exit' builtin. - -Patch: - -*** ../bash-4.0/builtins/exit.def 2009-01-04 14:32:22.000000000 -0500 ---- builtins/exit.def 2009-02-23 22:56:58.000000000 -0500 -*************** -*** 114,118 **** - if (jobs[i] && STOPPED (i)) - stopmsg = JSTOPPED; -! else if (check_jobs_at_exit && stopmsg == 0 && RUNNING (i)) - stopmsg = JRUNNING; - ---- 114,118 ---- - if (jobs[i] && STOPPED (i)) - stopmsg = JSTOPPED; -! else if (check_jobs_at_exit && stopmsg == 0 && jobs[i] && RUNNING (i)) - stopmsg = JRUNNING; - -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 3 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 4 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-005 b/data/bash/bash40-005 deleted file mode 100644 index ccfde66da..000000000 --- a/data/bash/bash40-005 +++ /dev/null @@ -1,63 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-005 - -Bug-Reported-by: Pierre Gaston <pierre.gaston@gmail.com> -Bug-Reference-ID: <c440c9800902242338n69f594a4nd66b8748def9cf18@mail.gmail.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00206.html - -Bug-Description: - -The `declare' builtin dumped core when attempting to assign associative -array indices containing some special characters, even when they were -quoted before being expanded. - -Patch: - -*** ../bash-4.0/builtins/declare.def 2009-01-04 14:32:22.000000000 -0500 ---- builtins/declare.def 2009-02-26 11:40:16.000000000 -0500 -*************** -*** 296,299 **** ---- 296,306 ---- - if (t = strchr (name, '[')) /* ] */ - { -+ /* If offset != 0 we have already validated any array reference */ -+ if (offset == 0 && valid_array_reference (name) == 0) -+ { -+ sh_invalidid (name); -+ assign_error++; -+ NEXT_VARIABLE (); -+ } - subscript_start = t; - *t = '\0'; -*************** -*** 485,489 **** - /* declare -a name[[n]] or declare name[n] makes name an indexed - array variable. */ -! else if ((making_array_special || (flags_on & att_array)) && array_p (var) == 0) - var = convert_var_to_array (var); - #endif /* ARRAY_VARS */ ---- 492,496 ---- - /* declare -a name[[n]] or declare name[n] makes name an indexed - array variable. */ -! else if ((making_array_special || (flags_on & att_array)) && array_p (var) == 0 && assoc_p (var) == 0) - var = convert_var_to_array (var); - #endif /* ARRAY_VARS */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 4 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 5 - - #endif /* _PATCHLEVEL_H_ */ - diff --git a/data/bash/bash40-006 b/data/bash/bash40-006 deleted file mode 100644 index 3d044c72e..000000000 --- a/data/bash/bash40-006 +++ /dev/null @@ -1,43 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-006 - -Bug-Reported-by: Evgeniy Zhemchugov <jini.zh@gmail.com> -Bug-Reference-ID: <e7bc8dd30902241016m8bd543ej775717d007df975b@mail.gmail.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00202.html - -Bug-Description: - -Bash did not parse pipelines using the |& construct correctly if the -pipeline elements were not simple commands. - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-02-25 17:25:56.000000000 -0500 -*************** -*** 4478,4481 **** ---- 4478,4482 ---- - case AND_AND: - case BANG: -+ case BAR_AND: - case DO: - case DONE: -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 5 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 6 - - #endif /* _PATCHLEVEL_H_ */ - diff --git a/data/bash/bash40-007 b/data/bash/bash40-007 deleted file mode 100644 index 29071e129..000000000 --- a/data/bash/bash40-007 +++ /dev/null @@ -1,263 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-007 - -Bug-Reported-by: AnMaster <anmaster@tele2.se> -Bug-Reference-ID: <49A41C18.80807@tele2.se> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00188.html - -Bug-Description: - -Bash had a number of problems parsing associative array subscripts containing -special characters. The subscripts are supposed to be read as if they are -enclosed between double quotes. - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-02-25 17:25:56.000000000 -0500 -*************** -*** 2919,2922 **** ---- 2919,2923 ---- - #define P_COMMAND 0x08 /* parsing a command, so look for comments */ - #define P_BACKQUOTE 0x10 /* parsing a backquoted command substitution */ -+ #define P_ARRAYSUB 0x20 /* parsing a [...] array subscript for assignment */ - - /* Lexical state while parsing a grouping construct or $(...). */ -*************** -*** 3134,3137 **** ---- 3134,3139 ---- - FREE (nestret); - } -+ else if ((flags & P_ARRAYSUB) && (tflags & LEX_WASDOL) && (ch == '(' || ch == '{' || ch == '[')) /* ) } ] */ -+ goto parse_dollar_word; - } - /* Parse an old-style command substitution within double quotes as a -*************** -*** 3150,3153 **** ---- 3150,3154 ---- - /* check for $(), $[], or ${} inside quoted string. */ - { -+ parse_dollar_word: - if (open == ch) /* undo previous increment */ - count--; -*************** -*** 4277,4281 **** - (token_index == 0 && (parser_state&PST_COMPASSIGN)))) - { -! ttok = parse_matched_pair (cd, '[', ']', &ttoklen, 0); - if (ttok == &matched_pair_error) - return -1; /* Bail immediately. */ ---- 4277,4281 ---- - (token_index == 0 && (parser_state&PST_COMPASSIGN)))) - { -! ttok = parse_matched_pair (cd, '[', ']', &ttoklen, P_ARRAYSUB); - if (ttok == &matched_pair_error) - return -1; /* Bail immediately. */ -*** ../bash-4.0/arrayfunc.c 2009-01-04 14:32:21.000000000 -0500 ---- arrayfunc.c 2009-02-25 07:58:54.000000000 -0500 -*************** -*** 605,666 **** - } - -! /* This function assumes s[i] == '['; returns with s[ret] == ']' if -! an array subscript is correctly parsed. */ -! int -! skipsubscript (s, i) -! const char *s; -! int i; -! { -! int count, c; -! #if defined (HANDLE_MULTIBYTE) -! mbstate_t state, state_bak; -! size_t slength, mblength; -! #endif -! -! #if defined (HANDLE_MULTIBYTE) -! memset (&state, '\0', sizeof (mbstate_t)); -! slength = strlen (s + i); -! #endif -! -! count = 1; -! while (count) -! { -! /* Advance one (possibly multibyte) character in S starting at I. */ -! #if defined (HANDLE_MULTIBYTE) -! if (MB_CUR_MAX > 1) -! { -! state_bak = state; -! mblength = mbrlen (s + i, slength, &state); -! -! if (MB_INVALIDCH (mblength)) -! { -! state = state_bak; -! i++; -! slength--; -! } -! else if (MB_NULLWCH (mblength)) -! return i; -! else -! { -! i += mblength; -! slength -= mblength; -! } -! } -! else -! #endif -! ++i; -! -! c = s[i]; -! -! if (c == 0) -! break; -! else if (c == '[') -! count++; -! else if (c == ']') -! count--; -! } -! -! return i; -! } - - /* This function is called with SUB pointing to just after the beginning ---- 605,609 ---- - } - -! /* skipsubscript moved to subst.c to use private functions. 2009/02/24. */ - - /* This function is called with SUB pointing to just after the beginning -*** ../bash-4.0/subst.c 2009-01-28 14:34:12.000000000 -0500 ---- subst.c 2009-02-25 09:18:33.000000000 -0500 -*************** -*** 223,226 **** ---- 223,227 ---- - static char *extract_delimited_string __P((char *, int *, char *, char *, char *, int)); - static char *extract_dollar_brace_string __P((char *, int *, int, int)); -+ static int skip_matched_pair __P((const char *, int, int, int, int)); - - static char *pos_params __P((char *, int, int, int)); -*************** -*** 1375,1378 **** ---- 1376,1480 ---- - #define CQ_RETURN(x) do { no_longjmp_on_fatal_error = 0; return (x); } while (0) - -+ /* This function assumes s[i] == open; returns with s[ret] == close; used to -+ parse array subscripts. FLAGS currently unused. */ -+ static int -+ skip_matched_pair (string, start, open, close, flags) -+ const char *string; -+ int start, open, close, flags; -+ { -+ int i, pass_next, backq, si, c, count; -+ size_t slen; -+ char *temp, *ss; -+ DECLARE_MBSTATE; -+ -+ slen = strlen (string + start) + start; -+ no_longjmp_on_fatal_error = 1; -+ -+ i = start + 1; /* skip over leading bracket */ -+ count = 1; -+ pass_next = backq = 0; -+ ss = (char *)string; -+ while (c = string[i]) -+ { -+ if (pass_next) -+ { -+ pass_next = 0; -+ if (c == 0) -+ CQ_RETURN(i); -+ ADVANCE_CHAR (string, slen, i); -+ continue; -+ } -+ else if (c == '\\') -+ { -+ pass_next = 1; -+ i++; -+ continue; -+ } -+ else if (backq) -+ { -+ if (c == '`') -+ backq = 0; -+ ADVANCE_CHAR (string, slen, i); -+ continue; -+ } -+ else if (c == '`') -+ { -+ backq = 1; -+ i++; -+ continue; -+ } -+ else if (c == open) -+ { -+ count++; -+ i++; -+ continue; -+ } -+ else if (c == close) -+ { -+ count--; -+ if (count == 0) -+ break; -+ i++; -+ continue; -+ } -+ else if (c == '\'' || c == '"') -+ { -+ i = (c == '\'') ? skip_single_quoted (ss, slen, ++i) -+ : skip_double_quoted (ss, slen, ++i); -+ /* no increment, the skip functions increment past the closing quote. */ -+ } -+ else if (c == '$' && (string[i+1] == LPAREN || string[i+1] == LBRACE)) -+ { -+ si = i + 2; -+ if (string[si] == '\0') -+ CQ_RETURN(si); -+ -+ if (string[i+1] == LPAREN) -+ temp = extract_delimited_string (ss, &si, "$(", "(", ")", SX_NOALLOC|SX_COMMAND); /* ) */ -+ else -+ temp = extract_dollar_brace_string (ss, &si, 0, SX_NOALLOC); -+ i = si; -+ if (string[i] == '\0') /* don't increment i past EOS in loop */ -+ break; -+ i++; -+ continue; -+ } -+ else -+ ADVANCE_CHAR (string, slen, i); -+ } -+ -+ CQ_RETURN(i); -+ } -+ -+ #if defined (ARRAY_VARS) -+ int -+ skipsubscript (string, start) -+ const char *string; -+ int start; -+ { -+ return (skip_matched_pair (string, start, '[', ']', 0)); -+ } -+ #endif -+ - /* Skip characters in STRING until we find a character in DELIMS, and return - the index of that character. START is the index into string at which we -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 6 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 7 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-008 b/data/bash/bash40-008 deleted file mode 100644 index 7a2576aa6..000000000 --- a/data/bash/bash40-008 +++ /dev/null @@ -1,49 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-008 - -Bug-Reported-by: Mike Frysinger <vapier@gentoo.org> -Bug-Reference-ID: <200902261030.54062.vapier@gentoo.org> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00230.html - -Bug-Description: - -Patch: - -*** ../bash-4.0/parse.y 2009-01-08 08:29:12.000000000 -0500 ---- parse.y 2009-02-26 17:22:15.000000000 -0500 -*************** -*** 3443,3448 **** - else - shell_ungetc (peekc); -! tflags |= LEX_HEREDELIM; -! lex_firstind = -1; - continue; - } ---- 3443,3451 ---- - else - shell_ungetc (peekc); -! if (peekc != '<') -! { -! tflags |= LEX_HEREDELIM; -! lex_firstind = -1; -! } - continue; - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 7 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 8 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-009 b/data/bash/bash40-009 deleted file mode 100644 index f58391929..000000000 --- a/data/bash/bash40-009 +++ /dev/null @@ -1,61 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-009 - -Bug-Reported-by: "Chris F.A. Johnson" <cfajohnson@gmail.com> -Bug-Reference-ID: <4d6b7$49a88cec$cef88ba3$16813@TEKSAVVY.COM> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00255.html - -Bug-Description: - -When the read builtin returned due to a timeout supplied with the -t option, -it did not restore any modified terminal attribtues. - -Patch: - -*** ../bash-4.0/builtins/read.def 2009-01-15 23:11:21.000000000 -0500 ---- builtins/read.def 2009-03-02 10:15:39.000000000 -0500 -*************** -*** 370,381 **** - if (code) - { -! #if 0 - run_unwind_frame ("read_builtin"); -- return (EXECUTION_FAILURE); -- #else - input_string[i] = '\0'; /* make sure it's terminated */ -! retval = 128+SIGALRM;; - goto assign_vars; -- #endif - } - old_alrm = set_signal_handler (SIGALRM, sigalrm); ---- 370,381 ---- - if (code) - { -! /* Tricky. The top of the unwind-protect stack is the free of -! input_string. We want to run all the rest and use input_string, -! so we have to remove it from the stack. */ -! remove_unwind_protect (); - run_unwind_frame ("read_builtin"); - input_string[i] = '\0'; /* make sure it's terminated */ -! retval = 128+SIGALRM; - goto assign_vars; - } - old_alrm = set_signal_handler (SIGALRM, sigalrm); -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 8 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 9 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-010 b/data/bash/bash40-010 deleted file mode 100644 index 3229c5736..000000000 --- a/data/bash/bash40-010 +++ /dev/null @@ -1,63 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-010 - -Bug-Reported-by: Mike Frysinger <vapier@gentoo.org> -Bug-Reference-ID: <200903030122.56206.vapier@gentoo.org> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00023.html - -Bug-Description: - -Bash has problems parsing comments in case statements when they appear in -$(...) subshells. - -Patch: - -*** ../bash-4.0/parse.y 2009-03-07 15:18:35.000000000 -0500 ---- parse.y 2009-03-07 14:16:32.000000000 -0500 -*************** -*** 3413,3419 **** - tflags &= ~LEX_RESWDOK; - } -! else if (shellbreak (ch) == 0) - { -! tflags &= ~LEX_RESWDOK; - /*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ - } ---- 3415,3433 ---- - tflags &= ~LEX_RESWDOK; - } -! 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 */ -! else if MBTEST((tflags & LEX_INCASE) && ch != '\n') -! /* If we can read a reserved word and we're in case, we're at the -! point where we can read a new pattern list or an esac. We -! handle the esac case above. If we read a newline, we want to -! leave LEX_RESWDOK alone. If we read anything else, we want to -! turn off LEX_RESWDOK, since we're going to read a pattern list. */ - { -! tflags &= ~LEX_RESWDOK; -! /*itrace("parse_comsub:%d: lex_incase == 1 found `%c', lex_reswordok -> 0", line_number, ch);*/ -! } -! else if MBTEST(shellbreak (ch) == 0) -! { -! tflags &= ~LEX_RESWDOK; - /*itrace("parse_comsub:%d: found `%c', lex_reswordok -> 0", line_number, ch);*/ - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 9 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 10 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-011 b/data/bash/bash40-011 deleted file mode 100644 index 61d1d3a8a..000000000 --- a/data/bash/bash40-011 +++ /dev/null @@ -1,49 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-011 - -Bug-Reported-by: Matt Zyzik <Matt@ice.filescope.com>n -Bug-Reference-ID: <20090312015018.C00741383ED@ice.filescope.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00092.html - -Bug-Description: - -When using the new |& operator following a simple command with a redirection, -the redirection of stderr through the pipe was not performed under certain -circumstances. - -Patch: - -*** ../bash-4.0-patched/parse.y 2009-03-08 21:24:47.000000000 -0400 ---- parse.y 2009-03-12 21:36:23.000000000 -0400 -*************** -*** 1123,1127 **** - REDIRECT *r; - -! tc = $1; - rd.dest = 1; - r = make_redirection (2, r_duplicating_output, rd); ---- 1123,1127 ---- - REDIRECT *r; - -! tc = $1->type == cm_simple ? (COMMAND *)$1->value.Simple : $1; - rd.dest = 1; - r = make_redirection (2, r_duplicating_output, rd); -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 10 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 11 - - #endif /* _PATCHLEVEL_H_ */ - diff --git a/data/bash/bash40-012 b/data/bash/bash40-012 deleted file mode 100644 index 014eae69a..000000000 --- a/data/bash/bash40-012 +++ /dev/null @@ -1,47 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-012 - -Bug-Reported-by: "Clark J. Wang" <dearvoid@gmail.com> -Bug-Reference-ID: <a96f63770903132300v7816dfb7hb7f48d46048bf3cb@mail.gmail.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00129.html - -Bug-Description: - -A case statement using the ;& pattern terminator followed immediately by -"esac" caused a core dump due to a null pointer dereference. - -Patch: - -*** ../bash-4.0-patched/execute_cmd.c 2009-02-13 16:41:41.000000000 -0500 ---- execute_cmd.c 2009-03-14 13:23:00.000000000 -0400 -*************** -*** 2931,2935 **** - } - while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = clauses->next)); -! if ((clauses->flags & CASEPAT_TESTNEXT) == 0) - EXIT_CASE (); - else ---- 2931,2935 ---- - } - while ((clauses->flags & CASEPAT_FALLTHROUGH) && (clauses = clauses->next)); -! if (clauses == 0 || (clauses->flags & CASEPAT_TESTNEXT) == 0) - EXIT_CASE (); - else -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 11 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 12 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-013 b/data/bash/bash40-013 deleted file mode 100644 index df1fc493b..000000000 --- a/data/bash/bash40-013 +++ /dev/null @@ -1,153 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-013 - -Bug-Reported-by: jidanni@jidanni.org -Bug-Reference-ID: -Bug-Reference-URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519165 - -Bug-Description: - -Though references to $@ when there are no positional parameters will now -cause the shell to exit if the `errexit' option has been enabled, constructs -such as ${@:-foo} should not cause an exit. - -Patch: - -*** ../bash-4.0-patched/subst.c 2009-03-08 21:24:39.000000000 -0400 ---- subst.c 2009-03-14 19:04:10.000000000 -0400 -*************** -*** 86,89 **** ---- 86,90 ---- - /* Flags for the `pflags' argument to param_expand() */ - #define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ -+ #define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */ - - /* These defs make it easier to use the editor. */ -*************** -*** 264,268 **** - static int chk_arithsub __P((const char *, int)); - -! static WORD_DESC *parameter_brace_expand_word __P((char *, int, int)); - static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); - static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); ---- 265,269 ---- - static int chk_arithsub __P((const char *, int)); - -! static WORD_DESC *parameter_brace_expand_word __P((char *, int, int, int)); - static WORD_DESC *parameter_brace_expand_indir __P((char *, int, int, int *, int *)); - static WORD_DESC *parameter_brace_expand_rhs __P((char *, char *, int, int, int *, int *)); -*************** -*** 5196,5202 **** - NAME was found inside of a double-quoted expression. */ - static WORD_DESC * -! parameter_brace_expand_word (name, var_is_special, quoted) - char *name; -! int var_is_special, quoted; - { - WORD_DESC *ret; ---- 5197,5203 ---- - NAME was found inside of a double-quoted expression. */ - static WORD_DESC * -! parameter_brace_expand_word (name, var_is_special, quoted, pflags) - char *name; -! int var_is_special, quoted, pflags; - { - WORD_DESC *ret; -*************** -*** 5230,5234 **** - - ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, -! (int *)NULL, (int *)NULL, 0); - free (tt); - } ---- 5231,5235 ---- - - ret = param_expand (tt, &sindex, quoted, (int *)NULL, (int *)NULL, -! (int *)NULL, (int *)NULL, pflags); - free (tt); - } -*************** -*** 5291,5295 **** - WORD_DESC *w; - -! w = parameter_brace_expand_word (name, var_is_special, quoted); - t = w->word; - /* Have to dequote here if necessary */ ---- 5292,5296 ---- - WORD_DESC *w; - -! w = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND); - t = w->word; - /* Have to dequote here if necessary */ -*************** -*** 5308,5312 **** - return (WORD_DESC *)NULL; - -! w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted); - free (t); - ---- 5309,5313 ---- - return (WORD_DESC *)NULL; - -! w = parameter_brace_expand_word (t, SPECIAL_VAR(t, 0), quoted, 0); - free (t); - -*************** -*** 6659,6663 **** - tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); - else -! tdesc = parameter_brace_expand_word (name, var_is_special, quoted); - - if (tdesc) ---- 6660,6664 ---- - tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); - else -! tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND); - - if (tdesc) -*************** -*** 6990,6994 **** - list = list_rest_of_args (); - -! if (list == 0 && unbound_vars_is_error) - { - uerror[0] = '$'; ---- 6991,6995 ---- - list = list_rest_of_args (); - -! if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) - { - uerror[0] = '$'; -*************** -*** 7052,7056 **** - list = list_rest_of_args (); - -! if (list == 0 && unbound_vars_is_error) - { - uerror[0] = '$'; ---- 7053,7057 ---- - list = list_rest_of_args (); - -! if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) - { - uerror[0] = '$'; - - -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 12 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 13 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-014 b/data/bash/bash40-014 deleted file mode 100644 index eeba336cd..000000000 --- a/data/bash/bash40-014 +++ /dev/null @@ -1,113 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-014 - -Bug-Reported-by: smallnow@gmail.com -Bug-Reference-ID: <49C460FE.40307@gmail.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00166.html - -Bug-Description: - -When the fc builtin is run in a command substitution from a shell with history -enabled, it does not correctly calculate the command on which to operate. - -Patch: - -*** ../bash-4.0-patched/builtins/fc.def 2009-01-04 14:32:22.000000000 -0500 ---- builtins/fc.def 2009-03-21 14:03:43.000000000 -0400 -*************** -*** 89,92 **** ---- 89,93 ---- - extern int literal_history; - extern int posixly_correct; -+ extern int subshell_environment, interactive_shell; - - extern int unlink __P((const char *)); -*************** -*** 173,177 **** - register char *sep; - int numbering, reverse, listing, execute; -! int histbeg, histend, last_hist, retval, opt; - FILE *stream; - REPL *rlist, *rl; ---- 174,178 ---- - register char *sep; - int numbering, reverse, listing, execute; -! int histbeg, histend, last_hist, retval, opt, rh; - FILE *stream; - REPL *rlist, *rl; -*************** -*** 276,279 **** ---- 277,282 ---- - fprintf (stderr, "%s\n", command); - fc_replhist (command); /* replace `fc -s' with command */ -+ /* Posix says that the re-executed commands should be entered into the -+ history. */ - return (parse_and_execute (command, "fc", SEVAL_NOHIST)); - } -*************** -*** 294,298 **** - so we check hist_last_line_added. */ - -! last_hist = i - remember_on_history - hist_last_line_added; - - if (list) ---- 297,306 ---- - so we check hist_last_line_added. */ - -! /* Even though command substitution through parse_and_execute turns off -! remember_on_history, command substitution in a shell when set -o history -! has been enabled (interactive or not) should use it in the last_hist -! calculation as if it were on. */ -! rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); -! last_hist = i - rh - hist_last_line_added; - - if (list) -*************** -*** 457,461 **** - HIST_ENTRY **hlist; - { -! int sign, n, clen; - register int i, j; - register char *s; ---- 465,469 ---- - HIST_ENTRY **hlist; - { -! int sign, n, clen, rh; - register int i, j; - register char *s; -*************** -*** 473,477 **** - so we check hist_last_line_added. This needs to agree with the - calculation of last_hist in fc_builtin above. */ -! i -= remember_on_history + hist_last_line_added; - - /* No specification defaults to most recent command. */ ---- 481,490 ---- - so we check hist_last_line_added. This needs to agree with the - calculation of last_hist in fc_builtin above. */ -! /* Even though command substitution through parse_and_execute turns off -! remember_on_history, command substitution in a shell when set -o history -! has been enabled (interactive or not) should use it in the last_hist -! calculation as if it were on. */ -! rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); -! i -= rh + hist_last_line_added; - - /* No specification defaults to most recent command. */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 13 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 14 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-015 b/data/bash/bash40-015 deleted file mode 100644 index c3e8d3346..000000000 --- a/data/bash/bash40-015 +++ /dev/null @@ -1,84 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-015 - -Bug-Reported-by: Lubomir Rintel <lkundrak@v3.sk> -Bug-Reference-ID: <1237654931.32737.13.camel@localhost.localdomain> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00174.html - -Bug-Description: - -Deferring handling of signals which should cause the shell to terminate until -it is "safe" to run the handler functions does not work for some terminating -signals. - -Patch: - -*** ../bash-4.0-patched/sig.c 2009-01-04 14:32:41.000000000 -0500 ---- sig.c 2009-03-22 14:47:56.000000000 -0400 -*************** -*** 449,452 **** ---- 449,494 ---- - int sig; - { -+ /* If we get called twice with the same signal before handling it, -+ terminate right away. */ -+ if ( -+ #ifdef SIGHUP -+ sig != SIGHUP && -+ #endif -+ #ifdef SIGINT -+ sig != SIGINT && -+ #endif -+ #ifdef SIGDANGER -+ sig != SIGDANGER && -+ #endif -+ #ifdef SIGPIPE -+ sig != SIGPIPE && -+ #endif -+ #ifdef SIGALRM -+ sig != SIGALRM && -+ #endif -+ #ifdef SIGTERM -+ sig != SIGTERM && -+ #endif -+ #ifdef SIGXCPU -+ sig != SIGXCPU && -+ #endif -+ #ifdef SIGXFSZ -+ sig != SIGXFSZ && -+ #endif -+ #ifdef SIGVTALRM -+ sig != SIGVTALRM && -+ #endif -+ #ifdef SIGLOST -+ sig != SIGLOST && -+ #endif -+ #ifdef SIGUSR1 -+ sig != SIGUSR1 && -+ #endif -+ #ifdef SIGUSR2 -+ sig != SIGUSR2 && -+ #endif -+ sig == terminating_signal) -+ terminate_immediately = 1; -+ - terminating_signal = sig; - -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 14 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 15 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-016 b/data/bash/bash40-016 deleted file mode 100644 index ace2e1e5f..000000000 --- a/data/bash/bash40-016 +++ /dev/null @@ -1,104 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-016 - -Bug-Reported-by: Brian J. Murrell" <brian@interlinx.bc.ca> -Bug-Reference-ID: <1237564627.7666.12.camel@pc.interlinx.bc.ca> -Bug-Reference-URL:http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00160.html - -Bug-Description: - -There are several problems with the handling of $LINENO in an ERR trap. - -Patch: - -*** ../bash-4.0-patched/trap.c 2009-01-16 17:07:53.000000000 -0500 ---- trap.c 2009-03-20 21:37:00.000000000 -0400 -*************** -*** 756,760 **** - - flags = SEVAL_NONINT|SEVAL_NOHIST; -! if (sig != DEBUG_TRAP && sig != RETURN_TRAP) - flags |= SEVAL_RESETLINE; - if (function_code == 0) ---- 756,760 ---- - - flags = SEVAL_NONINT|SEVAL_NOHIST; -! if (sig != DEBUG_TRAP && sig != RETURN_TRAP && sig != ERROR_TRAP) - flags |= SEVAL_RESETLINE; - if (function_code == 0) -*** ../bash-4.0-patched/execute_cmd.c 2009-02-13 16:41:41.000000000 -0500 ---- execute_cmd.c 2009-03-21 14:16:11.000000000 -0400 -*************** -*** 569,572 **** ---- 569,573 ---- - /* Fork a subshell, turn off the subshell bit, turn off job - control and call execute_command () on the command again. */ -+ line_number_for_err_trap = line_number; - paren_pid = make_child (savestring (make_command_string (command)), - asynchronous); -*************** -*** 611,615 **** ---- 612,619 ---- - { - last_command_exit_value = exec_result; -+ save_line_number = line_number; -+ line_number = line_number_for_err_trap; - run_error_trap (); -+ line_number = save_line_number; - } - -*************** -*** 767,771 **** ---- 771,777 ---- - { - last_command_exit_value = exec_result; -+ line_number = line_number_for_err_trap; - run_error_trap (); -+ line_number = save_line_number; - } - -*************** -*** 2106,2109 **** ---- 2112,2116 ---- - COMMAND *tc, *second; - int ignore_return, exec_result, was_error_trap, invert; -+ volatile int save_line_number; - - ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; -*************** -*** 2175,2178 **** ---- 2182,2186 ---- - ignore_return = (command->flags & CMD_IGNORE_RETURN) != 0; - -+ line_number_for_err_trap = line_number; - exec_result = execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close); - -*************** -*** 2180,2184 **** ---- 2188,2195 ---- - { - last_command_exit_value = exec_result; -+ save_line_number = line_number; -+ line_number = line_number_for_err_trap; - run_error_trap (); -+ line_number = save_line_number; - } - -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 15 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 16 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-017 b/data/bash/bash40-017 deleted file mode 100644 index ff42d7781..000000000 --- a/data/bash/bash40-017 +++ /dev/null @@ -1,47 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-017 - -Bug-Reported-by: Lubomir Rintel <lkundrak@v3.sk> -Bug-Reference-ID: <1237654931.32737.13.camel@localhost.localdomain> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00174.html - -Bug-Description: - -Adding a null line to a here-document (e.g., by hitting EOF) causes the -shell to dump core attempting to dereference the NULL pointer. - -Patch: - -*** ../bash-4.0-patched/parse.y 2009-03-08 21:24:47.000000000 -0400 ---- parse.y 2009-03-21 14:38:42.000000000 -0400 -*************** -*** 1880,1884 **** - ret = read_a_line (remove_quoted_newline); - #if defined (HISTORY) -! if (remember_on_history && (parser_state & PST_HEREDOC)) - { - /* To make adding the the here-document body right, we need to rely ---- 1880,1884 ---- - ret = read_a_line (remove_quoted_newline); - #if defined (HISTORY) -! if (ret && remember_on_history && (parser_state & PST_HEREDOC)) - { - /* To make adding the the here-document body right, we need to rely -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 16 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 17 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-018 b/data/bash/bash40-018 deleted file mode 100644 index 35f33e5fe..000000000 --- a/data/bash/bash40-018 +++ /dev/null @@ -1,78 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-018 - -Bug-Reported-by: Dan Price <dp@eng.sun.com> -Bug-Reference-ID: <20090324171502.GA20582@eng.sun.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00184.html - -Bug-Description: - -A missing include file results in an empty function definition and a no-op -when checking whether or not the window size has changed. - -Patch: - -*** ../bash-4.0-patched/lib/sh/winsize.c 2008-08-12 13:53:51.000000000 -0400 ---- lib/sh/winsize.c 2009-04-06 10:44:20.000000000 -0400 -*************** -*** 31,44 **** - #include <sys/ioctl.h> - -! #if !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) -! /* For struct winsize on SCO */ -! /* sys/ptem.h has winsize but needs mblk_t from sys/stream.h */ -! # if defined (HAVE_SYS_PTEM_H) && defined (TIOCGWINSZ) && defined (SIGWINCH) -! # if defined (HAVE_SYS_STREAM_H) -! # include <sys/stream.h> -! # endif - # include <sys/ptem.h> -! # endif /* HAVE_SYS_PTEM_H && TIOCGWINSZ && SIGWINCH */ -! #endif /* !STRUCT_WINSIZE_IN_SYS_IOCTL */ - - #include <stdio.h> ---- 31,57 ---- - #include <sys/ioctl.h> - -! /* Try to find the definitions of `struct winsize' and TIOGCWINSZ */ -! -! #if defined (GWINSZ_IN_SYS_IOCTL) && !defined (TIOCGWINSZ) -! # include <sys/ioctl.h> -! #endif /* GWINSZ_IN_SYS_IOCTL && !TIOCGWINSZ */ -! -! #if defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) -! # include <termios.h> -! #endif /* STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */ -! -! /* Not in either of the standard places, look around. */ -! #if !defined (STRUCT_WINSIZE_IN_TERMIOS) && !defined (STRUCT_WINSIZE_IN_SYS_IOCTL) -! # if defined (HAVE_SYS_STREAM_H) -! # include <sys/stream.h> -! # endif /* HAVE_SYS_STREAM_H */ -! # if defined (HAVE_SYS_PTEM_H) /* SVR4.2, at least, has it here */ - # include <sys/ptem.h> -! # define _IO_PTEM_H /* work around SVR4.2 1.1.4 bug */ -! # endif /* HAVE_SYS_PTEM_H */ -! # if defined (HAVE_SYS_PTE_H) /* ??? */ -! # include <sys/pte.h> -! # endif /* HAVE_SYS_PTE_H */ -! #endif /* !STRUCT_WINSIZE_IN_TERMIOS && !STRUCT_WINSIZE_IN_SYS_IOCTL */ - - #include <stdio.h> -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 17 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 18 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-019 b/data/bash/bash40-019 deleted file mode 100644 index 30efd6806..000000000 --- a/data/bash/bash40-019 +++ /dev/null @@ -1,125 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-019 - -Bug-Reported-by: Oleksiy Melnyk <lex@upc.ua> -Bug-Reference-ID: <20090224142233.D2FEFC004@floyd.upc.ua> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-02/msg00200.html - -Bug-Description: - -Using an external command as part of the DEBUG trap when job control is -enabled causes pipelines to misbehave. The problem has to do with process -groups assigned to the pipeline and terminal. - -Patch: - -*** ../bash-4.0-patched/jobs.c 2009-01-29 17:09:49.000000000 -0500 ---- jobs.c 2009-04-17 21:08:20.000000000 -0400 -*************** -*** 443,447 **** - the_pipeline = saved_pipeline; - already_making_children = saved_already_making_children; -! if (discard) - discard_pipeline (old_pipeline); - } ---- 443,447 ---- - the_pipeline = saved_pipeline; - already_making_children = saved_already_making_children; -! if (discard && old_pipeline) - discard_pipeline (old_pipeline); - } -*************** -*** 4203,4205 **** ---- 4204,4225 ---- - } - -+ void -+ save_pgrp_pipe (p, clear) -+ int *p; -+ int clear; -+ { -+ p[0] = pgrp_pipe[0]; -+ p[1] = pgrp_pipe[1]; -+ if (clear) -+ pgrp_pipe[0] = pgrp_pipe[1] = -1; -+ } -+ -+ void -+ restore_pgrp_pipe (p) -+ int *p; -+ { -+ pgrp_pipe[0] = p[0]; -+ pgrp_pipe[1] = p[1]; -+ } -+ - #endif /* PGRP_PIPE */ -*** ../bash-4.0-patched/jobs.h 2009-01-04 14:32:29.000000000 -0500 ---- jobs.h 2009-04-17 15:07:51.000000000 -0400 -*************** -*** 236,239 **** ---- 236,241 ---- - - extern void close_pgrp_pipe __P((void)); -+ extern void save_pgrp_pipe __P((int *, int)); -+ extern void restore_pgrp_pipe __P((int *)); - - #if defined (JOB_CONTROL) -*** ../bash-4.0-patched/trap.c 2009-01-16 17:07:53.000000000 -0500 ---- trap.c 2009-04-17 22:22:36.000000000 -0400 -*************** -*** 799,802 **** ---- 799,804 ---- - { - int trap_exit_value; -+ pid_t save_pgrp; -+ int save_pipe[2]; - - /* XXX - question: should the DEBUG trap inherit the RETURN trap? */ -*************** -*** 804,808 **** ---- 806,832 ---- - if ((sigmodes[DEBUG_TRAP] & SIG_TRAPPED) && ((sigmodes[DEBUG_TRAP] & SIG_IGNORED) == 0) && ((sigmodes[DEBUG_TRAP] & SIG_INPROGRESS) == 0)) - { -+ #if defined (JOB_CONTROL) -+ save_pgrp = pipeline_pgrp; -+ pipeline_pgrp = 0; -+ save_pipeline (1); -+ # if defined (PGRP_PIPE) -+ save_pgrp_pipe (save_pipe, 1); -+ # endif -+ stop_making_children (); -+ #endif -+ - trap_exit_value = _run_trap_internal (DEBUG_TRAP, "debug trap"); -+ -+ #if defined (JOB_CONTROL) -+ pipeline_pgrp = save_pgrp; -+ restore_pipeline (1); -+ # if defined (PGRP_PIPE) -+ close_pgrp_pipe (); -+ restore_pgrp_pipe (save_pipe); -+ # endif -+ if (pipeline_pgrp > 0) -+ give_terminal_to (pipeline_pgrp, 1); -+ notify_and_cleanup (); -+ #endif - - #if defined (DEBUGGER) -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 18 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 19 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-020 b/data/bash/bash40-020 deleted file mode 100644 index 885f15efe..000000000 --- a/data/bash/bash40-020 +++ /dev/null @@ -1,83 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-020 - -Bug-Reported-by: Nicolai Lissner <nlissne@linux01.org> -Bug-Reference-ID: <20090412020510.GA29658@lilith> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00104.html - -Bug-Description: - -If a SIGWINCH arrives while bash is performing redisplay, multi-line prompts -are displayed incorrectly due to the display code being called recursively. - -Patch: - -*** ../bash-4.0-patched/lib/readline/readline.h 2009-01-04 14:32:33.000000000 -0500 ---- lib/readline/readline.h 2009-04-13 08:47:00.000000000 -0400 -*************** -*** 815,820 **** - #define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */ - #define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */ - -! #define RL_STATE_DONE 0x800000 /* done; accepted line */ - - #define RL_SETSTATE(x) (rl_readline_state |= (x)) ---- 815,821 ---- - #define RL_STATE_MULTIKEY 0x200000 /* reading multiple-key command */ - #define RL_STATE_VICMDONCE 0x400000 /* entered vi command mode at least once */ -+ #define RL_STATE_REDISPLAYING 0x800000 /* updating terminal display */ - -! #define RL_STATE_DONE 0x1000000 /* done; accepted line */ - - #define RL_SETSTATE(x) (rl_readline_state |= (x)) -*** ../bash-4.0-patched/lib/readline/display.c 2009-01-04 14:32:32.000000000 -0500 ---- lib/readline/display.c 2009-04-13 08:29:54.000000000 -0400 -*************** -*** 513,516 **** ---- 513,517 ---- - data structures. */ - _rl_block_sigint (); -+ RL_SETSTATE (RL_STATE_REDISPLAYING); - - if (!rl_display_prompt) -*************** -*** 1237,1240 **** ---- 1238,1242 ---- - } - -+ RL_UNSETSTATE (RL_STATE_REDISPLAYING); - _rl_release_sigint (); - } -*** ../bash-4.0-patched/lib/readline/terminal.c 2009-01-04 14:32:34.000000000 -0500 ---- lib/readline/terminal.c 2009-04-13 08:43:00.000000000 -0400 -*************** -*** 356,360 **** - if (CUSTOM_REDISPLAY_FUNC ()) - rl_forced_update_display (); -! else - _rl_redisplay_after_sigwinch (); - } ---- 356,360 ---- - if (CUSTOM_REDISPLAY_FUNC ()) - rl_forced_update_display (); -! else if (RL_ISSTATE(RL_STATE_REDISPLAYING) == 0) - _rl_redisplay_after_sigwinch (); - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 19 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 20 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-021 b/data/bash/bash40-021 deleted file mode 100644 index cf6ee1f5a..000000000 --- a/data/bash/bash40-021 +++ /dev/null @@ -1,48 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-021 - -Bug-Reported-by: Matt Zyzik <matt.zyzik@nyu.edu> -Bug-Reference-ID: <20090319015542.696F62B8E8@ice.filescope.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00149.html - -Bug-Description: - -When not in a locale supporting multibyte characters, readline will occasionally -not erase characters between the cursor position and the end of the line -when killing text backwards. - -Patch: - -*** ../bash-4.0-patched/lib/readline/display.c 2009-01-04 14:32:32.000000000 -0500 ---- lib/readline/display.c 2009-04-14 14:00:18.000000000 -0400 -*************** -*** 1775,1779 **** - adjust col_lendiff based on the difference between _rl_last_c_pos - and _rl_screenwidth */ -! if (col_lendiff && (_rl_last_c_pos < _rl_screenwidth)) - #endif - { ---- 1775,1779 ---- - adjust col_lendiff based on the difference between _rl_last_c_pos - and _rl_screenwidth */ -! if (col_lendiff && ((MB_CUR_MAX == 1 || rl_byte_oriented) || (_rl_last_c_pos < _rl_screenwidth))) - #endif - { -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 20 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 21 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-022 b/data/bash/bash40-022 deleted file mode 100644 index 5b6853805..000000000 --- a/data/bash/bash40-022 +++ /dev/null @@ -1,48 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-022 - -Bug-Reported-by: Bernd Eggink <monoped@sudrala.de> -Bug-Reference-ID: <49E65407.5010206@sudrala.de> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00118.html - -Bug-Description: - -When parsing case statements in command substitutions, the shell did not -note that a newline is a shell metacharacter and can legally be followed -by a reserved word (e.g., `esac'). - -Patch: - -*** ../bash-4.0-patched/parse.y 2009-03-08 21:24:47.000000000 -0400 ---- parse.y 2009-04-15 22:27:56.000000000 -0400 -*************** -*** 3355,3359 **** - - /* Meta-characters that can introduce a reserved word. Not perfect yet. */ -! if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && shellmeta(ch)) - { - /* Add this character. */ ---- 3375,3379 ---- - - /* Meta-characters that can introduce a reserved word. Not perfect yet. */ -! if MBTEST((tflags & LEX_RESWDOK) == 0 && (tflags & LEX_CKCASE) && (tflags & LEX_INCOMMENT) == 0 && (shellmeta(ch) || ch == '\n')) - { - /* Add this character. */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 21 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 22 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-023 b/data/bash/bash40-023 deleted file mode 100644 index d2376c7da..000000000 --- a/data/bash/bash40-023 +++ /dev/null @@ -1,62 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-023 - -Bug-Reported-by: Andreas Schwab <schwab@linux-m68k.org> -Bug-Reference-ID: <m21vrhhx08.fsf@igel.home> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00160.html - -Bug-Description: - -If the prompt length exactly matches the screen width, and the prompt ends -with invisible characters, readline positions the cursor incorrectly. - -Patch: - -*** ../bash-4.0-patched/lib/readline/display.c 2009-01-04 14:32:32.000000000 -0500 ---- lib/readline/display.c 2009-04-25 21:42:18.000000000 -0400 -*************** -*** 1895,1898 **** ---- 1897,1904 ---- - woff = WRAP_OFFSET (_rl_last_v_pos, wrap_offset); - cpos = _rl_last_c_pos; -+ -+ if (cpos == 0 && cpos == new) -+ return; -+ - #if defined (HANDLE_MULTIBYTE) - /* If we have multibyte characters, NEW is indexed by the buffer point in -*************** -*** 1908,1914 **** - desired display position. */ - if ((new > prompt_last_invisible) || /* XXX - don't use woff here */ -! (prompt_physical_chars > _rl_screenwidth && - _rl_last_v_pos == prompt_last_screen_line && -! wrap_offset >= woff && - new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset))) - /* XXX last comparison might need to be >= */ ---- 1914,1920 ---- - desired display position. */ - if ((new > prompt_last_invisible) || /* XXX - don't use woff here */ -! (prompt_physical_chars >= _rl_screenwidth && - _rl_last_v_pos == prompt_last_screen_line && -! wrap_offset >= woff && dpos >= woff && - new > (prompt_last_invisible-(_rl_screenwidth*_rl_last_v_pos)-wrap_offset))) - /* XXX last comparison might need to be >= */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 22 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 23 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-024 b/data/bash/bash40-024 deleted file mode 100644 index ac2058ae3..000000000 --- a/data/bash/bash40-024 +++ /dev/null @@ -1,112 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-024 - -Bug-Reported-by: Matt Zyzik <matt.zyzik@nyu.edu> -Bug-Reference-ID: <20090405205428.4FDEA1C7175@ice.filescope.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-04/msg00021.html - -Bug-Description: - -When using the ** globbing operator, bash will incorrectly add an extra -directory name when the preceding directory name ends with `*' or an empty -string when there is no preceding directory name. - -Patch: - -*** ../bash-4.0-patched/lib/glob/glob.c 2009-01-04 14:32:30.000000000 -0500 ---- lib/glob/glob.c 2009-04-28 10:22:29.000000000 -0400 -*************** -*** 357,361 **** - if (ep) - *ep = 0; -! if (r) - free (r); - return (struct globval *)0; ---- 357,361 ---- - if (ep) - *ep = 0; -! if (r && r != &glob_error_return) - free (r); - return (struct globval *)0; -*************** -*** 666,671 **** - } - -! /* compat: if GX_ALLDIRS, add the passed directory also */ -! if (add_current) - { - sdlen = strlen (dir); ---- 666,672 ---- - } - -! /* compat: if GX_ALLDIRS, add the passed directory also, but don't add an -! empty directory name. */ -! if (add_current && (flags & GX_NULLDIR) == 0) - { - sdlen = strlen (dir); -*************** -*** 679,686 **** - nextlink->next = lastlink; - lastlink = nextlink; -! if (flags & GX_NULLDIR) -! nextname[0] = '\0'; -! else -! bcopy (dir, nextname, sdlen + 1); - ++count; - } ---- 680,684 ---- - nextlink->next = lastlink; - lastlink = nextlink; -! bcopy (dir, nextname, sdlen + 1); - ++count; - } -*************** -*** 943,947 **** - register unsigned int l; - -! array = glob_dir_to_array (directories[i], temp_results, flags); - l = 0; - while (array[l] != NULL) ---- 941,950 ---- - register unsigned int l; - -! /* If we're expanding **, we don't need to glue the directory -! name to the results; we've already done it in glob_vector */ -! if ((dflags & GX_ALLDIRS) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') -! array = temp_results; -! else -! array = glob_dir_to_array (directories[i], temp_results, flags); - l = 0; - while (array[l] != NULL) -*************** -*** 960,964 **** - - /* Note that the elements of ARRAY are not freed. */ -! free ((char *) array); - } - } ---- 963,968 ---- - - /* Note that the elements of ARRAY are not freed. */ -! if (array != temp_results) -! free ((char *) array); - } - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 23 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 24 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-025 b/data/bash/bash40-025 deleted file mode 100644 index 30b38ba31..000000000 --- a/data/bash/bash40-025 +++ /dev/null @@ -1,104 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-025 - -Bug-Reported-by: Matt Zyzik <matt.zyzik@nyu.edu> -Bug-Reference-ID: <20090519011418.GA21431@ice.filescope.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-05/msg00044.html - -Bug-Description: - -bash40-024 introduced a regression for constructs like **/*.cs; that -expansion would no longer include matching files in the current directory. -This patch undoes portions of bash40-024 and fixes the original problem -in a different way. - -Patch: - -*** ../bash-4.0-patched/lib/glob/glob.c 2009-05-22 12:32:26.000000000 -0400 ---- lib/glob/glob.c 2009-05-22 12:35:55.000000000 -0400 -*************** -*** 666,672 **** - } - -! /* compat: if GX_ALLDIRS, add the passed directory also, but don't add an -! empty directory name. */ -! if (add_current && (flags & GX_NULLDIR) == 0) - { - sdlen = strlen (dir); ---- 666,673 ---- - } - -! /* compat: if GX_ADDCURDIR, add the passed directory also. Add an empty -! directory name as a placeholder if GX_NULLDIR (in which case the passed -! directory name is "."). */ -! if (add_current) - { - sdlen = strlen (dir); -*************** -*** 680,684 **** - nextlink->next = lastlink; - lastlink = nextlink; -! bcopy (dir, nextname, sdlen + 1); - ++count; - } ---- 681,688 ---- - nextlink->next = lastlink; - lastlink = nextlink; -! if (flags & GX_NULLDIR) -! nextname[0] = '\0'; -! else -! bcopy (dir, nextname, sdlen + 1); - ++count; - } -*************** -*** 1008,1016 **** - /* Just return what glob_vector () returns appended to the - directory name. */ - dflags = flags & ~GX_MARKDIRS; - if (directory_len == 0) - dflags |= GX_NULLDIR; - if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') -! dflags |= GX_ALLDIRS|GX_ADDCURDIR; - temp_results = glob_vector (filename, - (directory_len == 0 ? "." : directory_name), ---- 1012,1033 ---- - /* Just return what glob_vector () returns appended to the - directory name. */ -+ /* If flags & GX_ALLDIRS, we're called recursively */ - dflags = flags & ~GX_MARKDIRS; - if (directory_len == 0) - dflags |= GX_NULLDIR; - if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') -! { -! dflags |= GX_ALLDIRS|GX_ADDCURDIR; -! #if 0 -! /* If we want all directories (dflags & GX_ALLDIRS) and we're not -! being called recursively as something like `echo **/*.o' -! ((flags & GX_ALLDIRS) == 0), we want to prevent glob_vector from -! adding a null directory name to the front of the temp_results -! array. We turn off ADDCURDIR if not called recursively and -! dlen == 0 */ -! #endif -! if (directory_len == 0 && (flags & GX_ALLDIRS) == 0) -! dflags &= ~GX_ADDCURDIR; -! } - temp_results = glob_vector (filename, - (directory_len == 0 ? "." : directory_name), -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 24 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 25 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-026 b/data/bash/bash40-026 deleted file mode 100644 index 412b2c71b..000000000 --- a/data/bash/bash40-026 +++ /dev/null @@ -1,56 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-026 - -Bug-Reported-by: Sergei Steshenko <sergstesh@yahoo.com> -Bug-Reference-ID: <670181.38883.qm@web35204.mail.mud.yahoo.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-05/msg00059.html - -Bug-Description: - -A forgotten line in externs.h caused compilation errors to occur on some -systems (e.g., Cygwin). - -Patch: - -*** ../bash-4.0-patched/externs.h 2009-01-18 18:29:29.000000000 -0500 ---- externs.h 2009-06-02 09:05:40.000000000 -0400 -*************** -*** 193,196 **** ---- 193,198 ---- - - /* Declarations for functions defined in lib/sh/fpurge.c */ -+ -+ #if defined NEED_FPURGE_DECL - #if !HAVE_DECL_FPURGE - -*************** -*** 201,205 **** - - #endif /* HAVE_DECL_FPURGE */ -! - - /* Declarations for functions defined in lib/sh/getcwd.c */ ---- 203,207 ---- - - #endif /* HAVE_DECL_FPURGE */ -! #endif /* NEED_FPURGE_DECL */ - - /* Declarations for functions defined in lib/sh/getcwd.c */ -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 25 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 26 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-027 b/data/bash/bash40-027 deleted file mode 100644 index a96ce4b1a..000000000 --- a/data/bash/bash40-027 +++ /dev/null @@ -1,67 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-027 - -Bug-Reported-by: jim@jim.sh -Bug-Reference-ID: <200905262140.n4QLeO4X030664@psychosis.jim.sh> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-05/msg00074.html - -Bug-Description: - -There are occasional cursor positioning errors when using readline's -horizontal scroll mode. - -Patch: - -*** ../bash-4.0-patched/lib/readline/display.c 2009-05-22 12:32:25.000000000 -0400 ---- lib/readline/display.c 2009-05-29 23:32:20.000000000 -0400 -*************** -*** 1190,1196 **** - line[t - 1] = '>'; - -! if (!rl_display_fixed || forced_display || lmargin != last_lmargin) - { - forced_display = 0; - update_line (&visible_line[last_lmargin], - &invisible_line[lmargin], ---- 1192,1200 ---- - line[t - 1] = '>'; - -! if (rl_display_fixed == 0 || forced_display || lmargin != last_lmargin) - { - forced_display = 0; -+ o_cpos = _rl_last_c_pos; -+ cpos_adjusted = 0; - update_line (&visible_line[last_lmargin], - &invisible_line[lmargin], -*************** -*** 1200,1203 **** ---- 1204,1214 ---- - 0); - -+ if ((MB_CUR_MAX > 1 && rl_byte_oriented == 0) && -+ cpos_adjusted == 0 && -+ _rl_last_c_pos != o_cpos && -+ _rl_last_c_pos > wrap_offset && -+ o_cpos < prompt_last_invisible) -+ _rl_last_c_pos -= prompt_invis_chars_first_line; /* XXX - was wrap_offset */ -+ - /* If the visible new line is shorter than the old, but the number - of invisible characters is greater, and we are at the end of -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 26 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 27 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-028 b/data/bash/bash40-028 deleted file mode 100644 index a5b0b60a3..000000000 --- a/data/bash/bash40-028 +++ /dev/null @@ -1,172 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-028 - -Bug-Reported-by: martin f krafft <madduck@debian.org> -Bug-Reference-ID: <4A4E39E7.5080807@debian.org> -Bug-Reference-URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=519165 - http://lists.gnu.org/archive/html/bug-bash/2009-07/msg00011.html - -Bug-Description: - -bash-4.0 reverted to the historical shell behavior of raising an error -when $@ or $* was expanded after `set -u' had been executed and there -were no positional parameters. The Posix working group has since -clarified the standard's position on the issue, and $@ and $* are now the -only variables, parameters, or special parameters that do not raise an -error when unset if set -u is enabled. - -Patch: - -*** ../bash-4.0-patched/subst.c Mon Mar 23 11:34:55 2009 ---- subst.c Wed Jun 17 18:12:18 2009 -*************** -*** 6768,6778 **** - - case RBRACE: -! if (var_is_set == 0 && unbound_vars_is_error) - { - err_unboundvar (name); - FREE (value); - FREE (temp); - free (name); -- last_command_exit_value = EXECUTION_FAILURE; - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } ---- 6794,6804 ---- - - case RBRACE: -! if (var_is_set == 0 && unbound_vars_is_error && ((name[0] != '@' && name[0] != '*') || name[1])) - { -+ last_command_exit_value = EXECUTION_FAILURE; - err_unboundvar (name); - FREE (value); - FREE (temp); - free (name); - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } -*************** -*** 6991,6994 **** ---- 7017,7029 ---- - list = list_rest_of_args (); - -+ #if 0 -+ /* According to austin-group posix proposal by Geoff Clare in -+ <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: -+ -+ "The shell shall write a message to standard error and -+ immediately exit when it tries to expand an unset parameter -+ other than the '@' and '*' special parameters." -+ */ -+ - if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) - { -*************** -*** 6996,7003 **** - uerror[1] = '*'; - uerror[2] = '\0'; -- err_unboundvar (uerror); - last_command_exit_value = EXECUTION_FAILURE; - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } - - /* If there are no command-line arguments, this should just ---- 7031,7039 ---- - uerror[1] = '*'; - uerror[2] = '\0'; - last_command_exit_value = EXECUTION_FAILURE; -+ err_unboundvar (uerror); - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } -+ #endif - - /* If there are no command-line arguments, this should just -*************** -*** 7053,7056 **** ---- 7089,7101 ---- - list = list_rest_of_args (); - -+ #if 0 -+ /* According to austin-group posix proposal by Geoff Clare in -+ <20090505091501.GA10097@squonk.masqnet> of 5 May 2009: -+ -+ "The shell shall write a message to standard error and -+ immediately exit when it tries to expand an unset parameter -+ other than the '@' and '*' special parameters." -+ */ -+ - if (list == 0 && unbound_vars_is_error && (pflags & PF_IGNUNBOUND) == 0) - { -*************** -*** 7058,7065 **** - uerror[1] = '@'; - uerror[2] = '\0'; -- err_unboundvar (uerror); - last_command_exit_value = EXECUTION_FAILURE; - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } - - /* We want to flag the fact that we saw this. We can't turn ---- 7103,7111 ---- - uerror[1] = '@'; - uerror[2] = '\0'; - last_command_exit_value = EXECUTION_FAILURE; -+ err_unboundvar (uerror); - return (interactive_shell ? &expand_wdesc_error : &expand_wdesc_fatal); - } -+ #endif - - /* We want to flag the fact that we saw this. We can't turn -*** ../bash-4.0-patched/doc/bash.1 Wed Feb 18 15:13:56 2009 ---- doc/bash.1 Wed Jun 17 08:51:19 2009 -*************** -*** 8258,8264 **** - .TP 8 - .B \-u -! Treat unset variables as an error when performing - parameter expansion. If expansion is attempted on an -! unset variable, the shell prints an error message, and, - if not interactive, exits with a non-zero status. - .TP 8 ---- 8274,8281 ---- - .TP 8 - .B \-u -! Treat unset variables and parameters other than the special -! parameters "@" and "*" as an error when performing - parameter expansion. If expansion is attempted on an -! unset variable or parameter, the shell prints an error message, and, - if not interactive, exits with a non-zero status. - .TP 8 -*** ../bash-4.0-patched/doc/bashref.texi Wed Feb 18 15:14:43 2009 ---- doc/bashref.texi Wed Jun 17 08:50:46 2009 -*************** -*** 4139,4143 **** - - @item -u -! Treat unset variables as an error when performing parameter expansion. - An error message will be written to the standard error, and a non-interactive - shell will exit. ---- 4151,4156 ---- - - @item -u -! Treat unset variables and parameters other than the special parameters -! @samp{@@} or @samp{*} as an error when performing parameter expansion. - An error message will be written to the standard error, and a non-interactive - shell will exit. -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 27 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 28 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-029 b/data/bash/bash40-029 deleted file mode 100644 index a13176de2..000000000 --- a/data/bash/bash40-029 +++ /dev/null @@ -1,106 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-029 - -Bug-Reported-by: Christian Krause <chkr@plauener.de> -Bug-Reference-ID: Thu, 25 Jun 2009 21:47:59 +0200 -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-06/msg00078.html - -Bug-Description: - -Previous versions of bash accepted strings in the initial environment -that were not valid shell variable assignments, usually because the -names were invalid, but still created shell variables from them and -passed them to child processes in the environment. - -Bash-4.0 ignores those names and does not pass them to child processes. -Some users and automated processes depend on invalid variables being -ignored and passed to child processes. - -This patch makes bash continue to ignore the invalid names, but pass -them to child processes in the export environment. - -Patch: - -*** ../bash-4.0-patched/variables.c 2009-01-04 14:32:46.000000000 -0500 ---- variables.c 2009-06-29 09:17:20.000000000 -0400 -*************** -*** 253,256 **** ---- 255,259 ---- - static int visible_var __P((SHELL_VAR *)); - static int visible_and_exported __P((SHELL_VAR *)); -+ static int export_environment_candidate __P((SHELL_VAR *)); - static int local_and_exported __P((SHELL_VAR *)); - static int variable_in_context __P((SHELL_VAR *)); -*************** -*** 376,383 **** - # endif - #endif - else if (legal_identifier (name)) - { - temp_var = bind_variable (name, string, 0); -! VSETATTR (temp_var, (att_exported | att_imported)); - array_needs_making = 1; - } ---- 379,393 ---- - # endif - #endif -+ #if 0 - else if (legal_identifier (name)) -+ #else -+ else -+ #endif - { - temp_var = bind_variable (name, string, 0); -! if (legal_identifier (name)) -! VSETATTR (temp_var, (att_exported | att_imported)); -! else -! VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); - array_needs_making = 1; - } -*************** -*** 3083,3086 **** ---- 3098,3111 ---- - } - -+ /* Candidate variables for the export environment are either valid variables -+ with the export attribute or invalid variables inherited from the initial -+ environment and simply passed through. */ -+ static int -+ export_environment_candidate (var) -+ SHELL_VAR *var; -+ { -+ return (exported_p (var) && (invisible_p (var) == 0 || imported_p (var))); -+ } -+ - /* Return non-zero if VAR is a local variable in the current context and - is exported. */ -*************** -*** 3439,3443 **** ---- 3464,3472 ---- - SHELL_VAR **vars; - -+ #if 0 - vars = map_over (visible_and_exported, vcxt); -+ #else -+ vars = map_over (export_environment_candidate, vcxt); -+ #endif - - if (vars == 0) -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 28 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 29 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-030 b/data/bash/bash40-030 deleted file mode 100644 index e4f038933..000000000 --- a/data/bash/bash40-030 +++ /dev/null @@ -1,64 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-030 - -Bug-Reported-by: Henning Bekel <h.bekel@googlemail.com> -Bug-Reference-ID: <7c6eacF262ctuU1@mid.individual.net> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-07/msg00054.html - -Bug-Description: - -A shell function invoked with `bind -x' is supposed to be able to move the -cursor by setting READLINE_POINT. The effects of this assignment were -sometimes ignored. - -Patch: - -*** ../bash-4.0-patched/bashline.c 2009-01-08 09:29:24.000000000 -0500 ---- bashline.c 2009-07-16 14:13:41.000000000 -0400 -*************** -*** 3389,3393 **** - register int i; - intmax_t mi; -- int save_point; - sh_parser_state_t ps; - char *cmd, *value, *l; ---- 3389,3392 ---- -*************** -*** 3433,3437 **** - VSETATTR (v, att_exported); - l = value_cell (v); -- save_point = rl_point; - value = inttostr (rl_point, ibuf, sizeof (ibuf)); - v = bind_int_variable ("READLINE_POINT", value); ---- 3432,3435 ---- -*************** -*** 3451,3455 **** - { - i = mi; -! if (i != save_point) - { - rl_point = i; ---- 3449,3453 ---- - { - i = mi; -! if (i != rl_point) - { - rl_point = i; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 29 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 30 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-031 b/data/bash/bash40-031 deleted file mode 100644 index db46aa3fc..000000000 --- a/data/bash/bash40-031 +++ /dev/null @@ -1,62 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-031 - -Bug-Reported-by: Roman Rakus <rrakus@redhat.com> -Bug-Reference-ID: <4A93F6E9.4050401@redhat.com> -Bug-Reference-URL: - -Bug-Description: - -An implicit assignment to index "0" of an existing array variable caused -the shell to crash when the variable was unset. - -Patch: - -*** ../bash-4.0-patched/arrayfunc.c 2009-03-08 21:24:39.000000000 -0400 ---- arrayfunc.c 2009-08-24 09:29:43.000000000 -0400 -*************** -*** 99,103 **** - hash = assoc_create (0); - if (oldval) -! assoc_insert (hash, "0", oldval); - - FREE (value_cell (var)); ---- 99,103 ---- - hash = assoc_create (0); - if (oldval) -! assoc_insert (hash, savestring ("0"), oldval); - - FREE (value_cell (var)); -*** ../bash-4.0-patched/variables.c 2009-01-04 14:32:46.000000000 -0500 ---- variables.c 2009-08-24 09:29:58.000000000 -0400 -*************** -*** 2218,2222 **** - else if (assoc_p (entry)) - { -! assoc_insert (assoc_cell (entry), "0", newval); - free (newval); - } ---- 2218,2222 ---- - else if (assoc_p (entry)) - { -! assoc_insert (assoc_cell (entry), savestring ("0"), newval); - free (newval); - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 30 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 31 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-032 b/data/bash/bash40-032 deleted file mode 100644 index 0c9ba74da..000000000 --- a/data/bash/bash40-032 +++ /dev/null @@ -1,46 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-032 - -Bug-Reported-by: muszi@muszi.kite.hu -Bug-Reference-ID: <20090826113159.18815.qmail@muszi.kite.hu> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-08/msg00090.html - -Bug-Description: - -Bash-4.0 has a memory leak when processing ${!prefix@}. - -Patch: - -*** ../bash-4.0-patched/subst.c 2009-07-22 23:18:55.000000000 -0400 ---- subst.c 2009-08-26 23:08:51.000000000 -0400 -*************** -*** 6607,6611 **** - } - free (x); -! free (xlist); - free (temp1); - *indexp = sindex; ---- 6769,6773 ---- - } - free (x); -! dispose_words (xlist); - free (temp1); - *indexp = sindex; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 31 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 32 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-033 b/data/bash/bash40-033 deleted file mode 100644 index 80fcb6be3..000000000 --- a/data/bash/bash40-033 +++ /dev/null @@ -1,50 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-033 - -Bug-Reported-by: Dr. Werner Fink <werner@suse.de> -Bug-Reference-ID: <200907010951.n619p76I013912@boole.suse.de> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-07/msg00000.html - -Bug-Description: - -Bash-4.0 has a memory leak in the `read' builtin when the number of fields -read is not the same as the number of variables passed as arguments. - -Patch: - -*** ../bash-4.0-patched/builtins/read.def 2009-03-08 21:24:45.000000000 -0400 ---- builtins/read.def 2009-07-01 15:32:42.000000000 -0400 -*************** -*** 764,768 **** - tofree = input_string = t; - else -! input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); - } - #endif ---- 764,771 ---- - tofree = input_string = t; - else -! { -! input_string = strip_trailing_ifs_whitespace (t1, ifs_chars, saw_escape); -! tofree = t; -! } - } - #endif -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 32 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 33 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-034 b/data/bash/bash40-034 deleted file mode 100644 index bacb33ce1..000000000 --- a/data/bash/bash40-034 +++ /dev/null @@ -1,59 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-034 - -Bug-Reported-by: Anders Kaseorg <andersk@mit.edu> -Bug-Reference-ID: <1252856832.991059.8162.nullmailer@balanced-tree.mit.edu> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-09/msg00043.html - -Bug-Description: - -When using the globstar option, bash incorrectly interprets wildcarded path -components between a **/ and the last / as matching any path, even if the -constructed path does not match any files. - -Patch: - -*** ../bash-4.0-patched/lib/glob/glob.c 2009-07-22 23:18:50.000000000 -0400 ---- lib/glob/glob.c 2009-09-18 17:53:25.000000000 -0400 -*************** -*** 920,928 **** - char **temp_results; - - /* Scan directory even on a NULL filename. That way, `*h/' - returns only directories ending in `h', instead of all - files ending in `h' with a `/' appended. */ - dname = directories[i]; -! dflags = flags & ~GX_MARKDIRS; - if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') - dflags |= GX_ALLDIRS|GX_ADDCURDIR; ---- 927,938 ---- - char **temp_results; - -+ /* XXX -- we've recursively scanned any directories resulting from -+ a `**', so turn off the flag. We turn it on again below if -+ filename is `**' */ - /* Scan directory even on a NULL filename. That way, `*h/' - returns only directories ending in `h', instead of all - files ending in `h' with a `/' appended. */ - dname = directories[i]; -! dflags = flags & ~(GX_MARKDIRS|GX_ALLDIRS|GX_ADDCURDIR); - if ((flags & GX_GLOBSTAR) && filename[0] == '*' && filename[1] == '*' && filename[2] == '\0') - dflags |= GX_ALLDIRS|GX_ADDCURDIR; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 33 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 34 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-035 b/data/bash/bash40-035 deleted file mode 100644 index 3b1af7505..000000000 --- a/data/bash/bash40-035 +++ /dev/null @@ -1,62 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-035 - -Bug-Reported-by: Freddy Vulto <fvulto@gmail.com> -Bug-Reference-ID: <e9c463930909171341p7cbe6e43pa3788ebbe3adec4d@mail.gmail.com> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-09/msg00044.html - -Bug-Description: - -Bash-4.0 incorrectly treated single and double quotes as delimiters rather -than introducing quoted strings when splitting the line into words for -programmable completion functions. - -Patch: - -*** ../bash-4.0-patched/pcomplete.c 2009-03-08 21:24:31.000000000 -0400 ---- pcomplete.c 2009-09-26 16:30:16.000000000 -0400 -*************** -*** 1176,1186 **** - WORD_LIST *ret; - char *delims; - -! #if 0 -! delims = "()<>;&| \t\n"; /* shell metacharacters break words */ -! #else -! delims = rl_completer_word_break_characters; -! #endif - ret = split_at_delims (line, llen, delims, sentinel, nwp, cwp); - return (ret); - } ---- 1176,1188 ---- - WORD_LIST *ret; - char *delims; -+ int i, j; - -! delims = xmalloc (strlen (rl_completer_word_break_characters) + 1); -! for (i = j = 0; rl_completer_word_break_characters[i]; i++) -! if (rl_completer_word_break_characters[i] != '\'' && rl_completer_word_break_characters[i] != '"') -! delims[j++] = rl_completer_word_break_characters[i]; -! delims[j] = '\0'; - ret = split_at_delims (line, llen, delims, sentinel, nwp, cwp); -+ free (delims); - return (ret); - } -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 34 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 35 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-036 b/data/bash/bash40-036 deleted file mode 100644 index ed08e3936..000000000 --- a/data/bash/bash40-036 +++ /dev/null @@ -1,90 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-036 - -Bug-Reported-by: Jerome Reybert <jreybert@gmail.com> -Bug-Reference-ID: <f5da50720908070109p1faa3847x5a9dff68d24a7197@mail.gmail.com> -Bug-Reference-URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538013 - -Bug-Description: - -Under some circumstances, menu-complete is unable to complete filenames. - -Patch: - -*** ../bash-4.0-patched/lib/readline/complete.c 2009-01-22 15:15:14.000000000 -0500 ---- lib/readline/complete.c 2009-08-26 17:15:59.000000000 -0400 -*************** -*** 2209,2213 **** - /* The first time through, we generate the list of matches and set things - up to insert them. */ -! if (rl_last_func != rl_menu_complete) - { - /* Clean up from previous call, if any. */ ---- 2252,2256 ---- - /* The first time through, we generate the list of matches and set things - up to insert them. */ -! if (rl_last_func != rl_old_menu_complete) - { - /* Clean up from previous call, if any. */ -*************** -*** 2221,2224 **** ---- 2264,2269 ---- - rl_completion_invoking_key = invoking_key; - -+ RL_SETSTATE(RL_STATE_COMPLETING); -+ - /* Only the completion entry function can change these. */ - set_completion_defaults ('%'); -*************** -*** 2260,2266 **** ---- 2305,2314 ---- - orig_text = (char *)0; - completion_changed_buffer = 0; -+ RL_UNSETSTATE(RL_STATE_COMPLETING); - return (0); - } - -+ RL_UNSETSTATE(RL_STATE_COMPLETING); -+ - for (match_list_size = 0; matches[match_list_size]; match_list_size++) - ; -*************** -*** 2338,2341 **** ---- 2386,2391 ---- - full_completion = 0; - -+ RL_SETSTATE(RL_STATE_COMPLETING); -+ - /* Only the completion entry function can change these. */ - set_completion_defaults ('%'); -*************** -*** 2379,2385 **** ---- 2429,2438 ---- - orig_text = (char *)0; - completion_changed_buffer = 0; -+ RL_UNSETSTATE(RL_STATE_COMPLETING); - return (0); - } - -+ RL_UNSETSTATE(RL_STATE_COMPLETING); -+ - for (match_list_size = 0; matches[match_list_size]; match_list_size++) - ; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 35 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 36 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-037 b/data/bash/bash40-037 deleted file mode 100644 index 95baeb319..000000000 --- a/data/bash/bash40-037 +++ /dev/null @@ -1,60 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-037 - -Bug-Reported-by: Chet Ramey <chet.ramey@case.edu> -Bug-Reference-ID: <4AD7D749.5030601@case.edu> -Bug-Reference-URL: - -Bug-Description: - -The configure script does not work on Snow Leopard and will result in -attempts to link against the incorrect version of readline. - -Patch: - -*** ../bash-4.0-patched/configure.in 2009-02-06 12:03:44.000000000 -0500 ---- configure.in 2009-10-01 16:38:24.000000000 -0400 -*************** -*** 534,538 **** - # dynamic version - case "${host_os}" in -! darwin[[89]]*) READLINE_LIB='${READLINE_LIBRARY}' ;; - *) READLINE_LIB=-lreadline ;; - esac ---- 534,538 ---- - # dynamic version - case "${host_os}" in -! darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; - *) READLINE_LIB=-lreadline ;; - esac -*************** -*** 569,573 **** - # dynamic version - case "${host_os}" in -! darwin[[89]]*) HISTORY_LIB='${HISTORY_LIBRARY}' ;; - *) HISTORY_LIB=-lhistory ;; - esac ---- 569,573 ---- - # dynamic version - case "${host_os}" in -! darwin[[89]]*|darwin10*) HISTORY_LIB='${HISTORY_LIBRARY}' ;; - *) HISTORY_LIB=-lhistory ;; - esac -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 36 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 37 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-038 b/data/bash/bash40-038 deleted file mode 100644 index 80505cc34..000000000 --- a/data/bash/bash40-038 +++ /dev/null @@ -1,56 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-038 - -Bug-Reported-by: werner@suse.de -Bug-Reference-ID: <201002251238.o1PCcYcg016893@boole.suse.de> -Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2010-02/msg00132.html - -Bug-Description: - -When the `read' builtin times out after the timeout specified with -t is -exceeded, it does not reset the flags that tell signal handlers to process -signals immediately instead of deferring their handling. This can result -in unsafe functions being called from signal handlers, which can cause bash -to hang or dump core. - -Patch (apply with `patch -p0'): - -*** ../bash-4.0-patched/builtins/read.def 2009-09-03 14:40:03.000000000 -0400 ---- builtins/read.def 2010-03-17 17:35:39.000000000 -0400 -*************** -*** 602,607 **** - zsyncfd (fd); - -- interrupt_immediately--; -- terminate_immediately--; - discard_unwind_frame ("read_builtin"); - ---- 616,619 ---- -*************** -*** 610,613 **** ---- 622,628 ---- - assign_vars: - -+ interrupt_immediately--; -+ terminate_immediately--; -+ - #if defined (ARRAY_VARS) - /* If -a was given, take the string read, break it into a list of words, -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 37 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 38 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-039 b/data/bash/bash40-039 deleted file mode 100644 index 3eac28cef..000000000 --- a/data/bash/bash40-039 +++ /dev/null @@ -1,104 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-039 - -Bug-Reported-by: Stephane Chazelas <stephane.chazelas@gmail.com> -Bug-Reference-ID: -Bug-Reference-URL: - -Bug-Description: - -Under certain circumstances, bash will execute user code while processing the -environment for exported function definitions. - -Patch (apply with `patch -p0'): - -*** ../bash-4.0.38/builtins/common.h 2009-01-15 23:08:54.000000000 -0500 ---- builtins/common.h 2014-09-16 19:20:48.000000000 -0400 -*************** -*** 36,39 **** ---- 36,41 ---- - - /* Flags for describe_command, shared between type.def and command.def */ -+ #define SEVAL_FUNCDEF 0x080 /* only allow function definitions */ -+ #define SEVAL_ONECMD 0x100 /* only allow a single command */ - #define CDESC_ALL 0x001 /* type -a */ - #define CDESC_SHORTDESC 0x002 /* command -V */ -*** ../bash-4.0.38/builtins/evalstring.c 2009-01-13 14:44:12.000000000 -0500 ---- builtins/evalstring.c 2014-09-16 19:20:48.000000000 -0400 -*************** -*** 259,262 **** ---- 259,270 ---- - struct fd_bitmap *bitmap; - -+ if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def) -+ { -+ internal_warning ("%s: ignoring function definition attempt", from_file); -+ should_jump_to_top_level = 0; -+ last_result = last_command_exit_value = EX_BADUSAGE; -+ break; -+ } -+ - bitmap = new_fd_bitmap (FD_BITMAP_SIZE); - begin_unwind_frame ("pe_dispose"); -*************** -*** 319,322 **** ---- 327,333 ---- - dispose_fd_bitmap (bitmap); - discard_unwind_frame ("pe_dispose"); -+ -+ if (flags & SEVAL_ONECMD) -+ break; - } - } -*** ../bash-4.0.38/variables.c 2009-09-19 13:04:23.000000000 -0400 ---- variables.c 2014-09-16 19:20:48.000000000 -0400 -*************** -*** 344,353 **** - strcpy (temp_string + char_index + 1, string); - -! parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST); -! -! /* Ancient backwards compatibility. Old versions of bash exported -! functions like name()=() {...} */ -! if (name[char_index - 1] == ')' && name[char_index - 2] == '(') -! name[char_index - 2] = '\0'; - - if (temp_var = find_function (name)) ---- 344,351 ---- - strcpy (temp_string + char_index + 1, string); - -! /* Don't import function names that are invalid identifiers from the -! environment. */ -! if (legal_identifier (name)) -! parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD); - - if (temp_var = find_function (name)) -*************** -*** 358,365 **** - else - report_error (_("error importing function definition for `%s'"), name); -- -- /* ( */ -- if (name[char_index - 1] == ')' && name[char_index - 2] == '\0') -- name[char_index - 2] = '('; /* ) */ - } - #if defined (ARRAY_VARS) ---- 356,359 ---- -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 38 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 39 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-040 b/data/bash/bash40-040 deleted file mode 100644 index b15f7500c..000000000 --- a/data/bash/bash40-040 +++ /dev/null @@ -1,43 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-040 - -Bug-Reported-by: Tavis Ormandy <taviso@cmpxchg8b.com> -Bug-Reference-ID: -Bug-Reference-URL: http://twitter.com/taviso/statuses/514887394294652929 - -Bug-Description: - -Under certain circumstances, bash can incorrectly save a lookahead character and -return it on a subsequent call, even when reading a new line. - -Patch (apply with `patch -p0'): - -*** ../bash-4.0.39/parse.y 2009-06-02 09:08:07.000000000 -0400 ---- parse.y 2014-09-25 16:15:47.000000000 -0400 -*************** -*** 2671,2674 **** ---- 2671,2676 ---- - word_desc_to_read = (WORD_DESC *)NULL; - -+ eol_ungetc_lookahead = 0; -+ - current_token = '\n'; /* XXX */ - last_read_token = '\n'; -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 39 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 40 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-041 b/data/bash/bash40-041 deleted file mode 100644 index 5e15c9461..000000000 --- a/data/bash/bash40-041 +++ /dev/null @@ -1,217 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-041 - -Bug-Reported-by: Florian Weimer <fweimer@redhat.com> -Bug-Reference-ID: -Bug-Reference-URL: - -Bug-Description: - -This patch changes the encoding bash uses for exported functions to avoid -clashes with shell variables and to avoid depending only on an environment -variable's contents to determine whether or not to interpret it as a shell -function. - -Patch: - -*** ../bash-4.0.40/variables.c 2014-09-16 19:20:48.000000000 -0400 ---- variables.c 2014-09-27 21:01:42.000000000 -0400 -*************** -*** 78,81 **** ---- 78,86 ---- - #define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0') - -+ #define BASHFUNC_PREFIX "BASH_FUNC_" -+ #define BASHFUNC_PREFLEN 10 /* == strlen(BASHFUNC_PREFIX */ -+ #define BASHFUNC_SUFFIX "%%" -+ #define BASHFUNC_SUFFLEN 2 /* == strlen(BASHFUNC_SUFFIX) */ -+ - extern char **environ; - -*************** -*** 265,269 **** - static void dispose_temporary_env __P((sh_free_func_t *)); - -! static inline char *mk_env_string __P((const char *, const char *)); - static char **make_env_array_from_var_list __P((SHELL_VAR **)); - static char **make_var_export_array __P((VAR_CONTEXT *)); ---- 270,274 ---- - static void dispose_temporary_env __P((sh_free_func_t *)); - -! static inline char *mk_env_string __P((const char *, const char *, int)); - static char **make_env_array_from_var_list __P((SHELL_VAR **)); - static char **make_var_export_array __P((VAR_CONTEXT *)); -*************** -*** 335,353 **** - /* If exported function, define it now. Don't import functions from - the environment in privileged mode. */ -! if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4)) - { - string_length = strlen (string); -! temp_string = (char *)xmalloc (3 + string_length + char_index); - -! strcpy (temp_string, name); -! temp_string[char_index] = ' '; -! strcpy (temp_string + char_index + 1, string); - - /* Don't import function names that are invalid identifiers from the - environment. */ -! if (legal_identifier (name)) -! parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD); - -! if (temp_var = find_function (name)) - { - VSETATTR (temp_var, (att_exported|att_imported)); ---- 340,369 ---- - /* If exported function, define it now. Don't import functions from - the environment in privileged mode. */ -! if (privmode == 0 && read_but_dont_execute == 0 && -! STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) && -! STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) && -! STREQN ("() {", string, 4)) - { -+ size_t namelen; -+ char *tname; /* desired imported function name */ -+ -+ namelen = char_index - BASHFUNC_PREFLEN - BASHFUNC_SUFFLEN; -+ -+ tname = name + BASHFUNC_PREFLEN; /* start of func name */ -+ tname[namelen] = '\0'; /* now tname == func name */ -+ - string_length = strlen (string); -! temp_string = (char *)xmalloc (namelen + string_length + 2); - -! memcpy (temp_string, tname, namelen); -! temp_string[namelen] = ' '; -! memcpy (temp_string + namelen + 1, string, string_length + 1); - - /* Don't import function names that are invalid identifiers from the - environment. */ -! if (absolute_program (tname) == 0 && (posixly_correct == 0 || legal_identifier (tname))) -! parse_and_execute (temp_string, tname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD); - -! if (temp_var = find_function (tname)) - { - VSETATTR (temp_var, (att_exported|att_imported)); -*************** -*** 355,359 **** - } - else -! report_error (_("error importing function definition for `%s'"), name); - } - #if defined (ARRAY_VARS) ---- 371,378 ---- - } - else -! report_error (_("error importing function definition for `%s'"), tname); -! -! /* Restore original suffix */ -! tname[namelen] = BASHFUNC_SUFFIX[0]; - } - #if defined (ARRAY_VARS) -*************** -*** 2506,2510 **** - - INVALIDATE_EXPORTSTR (var); -! var->exportstr = mk_env_string (name, value); - - array_needs_making = 1; ---- 2525,2529 ---- - - INVALIDATE_EXPORTSTR (var); -! var->exportstr = mk_env_string (name, value, 0); - - array_needs_making = 1; -*************** -*** 3325,3343 **** - - static inline char * -! mk_env_string (name, value) - const char *name, *value; - { -! int name_len, value_len; -! char *p; - - name_len = strlen (name); - value_len = STRLEN (value); -! p = (char *)xmalloc (2 + name_len + value_len); -! strcpy (p, name); -! p[name_len] = '='; - if (value && *value) -! strcpy (p + name_len + 1, value); - else -! p[name_len + 1] = '\0'; - return (p); - } ---- 3344,3383 ---- - - static inline char * -! mk_env_string (name, value, isfunc) - const char *name, *value; -+ int isfunc; - { -! size_t name_len, value_len; -! char *p, *q; - - name_len = strlen (name); - value_len = STRLEN (value); -! -! /* If we are exporting a shell function, construct the encoded function -! name. */ -! if (isfunc && value) -! { -! p = (char *)xmalloc (BASHFUNC_PREFLEN + name_len + BASHFUNC_SUFFLEN + value_len + 2); -! q = p; -! memcpy (q, BASHFUNC_PREFIX, BASHFUNC_PREFLEN); -! q += BASHFUNC_PREFLEN; -! memcpy (q, name, name_len); -! q += name_len; -! memcpy (q, BASHFUNC_SUFFIX, BASHFUNC_SUFFLEN); -! q += BASHFUNC_SUFFLEN; -! } -! else -! { -! p = (char *)xmalloc (2 + name_len + value_len); -! memcpy (p, name, name_len); -! q = p + name_len; -! } -! -! q[0] = '='; - if (value && *value) -! memcpy (q + 1, value, value_len + 1); - else -! q[1] = '\0'; -! - return (p); - } -*************** -*** 3420,3424 **** - using the cached exportstr... */ - list[list_index] = USE_EXPORTSTR ? savestring (value) -! : mk_env_string (var->name, value); - - if (USE_EXPORTSTR == 0) ---- 3460,3464 ---- - using the cached exportstr... */ - list[list_index] = USE_EXPORTSTR ? savestring (value) -! : mk_env_string (var->name, value, function_p (var)); - - if (USE_EXPORTSTR == 0) -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 40 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 41 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-042 b/data/bash/bash40-042 deleted file mode 100644 index c86e9a5d7..000000000 --- a/data/bash/bash40-042 +++ /dev/null @@ -1,147 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-042 - -Bug-Reported-by: Florian Weimer <fweimer@redhat.com> -Bug-Reference-ID: -Bug-Reference-URL: - -Bug-Description: - -There are two local buffer overflows in parse.y that can cause the shell -to dump core when given many here-documents attached to a single command -or many nested loops. - -Patch: - -*** ../bash-4.0.41/parse.y 2014-09-27 12:17:56.000000000 -0400 ---- parse.y 2014-09-30 19:41:09.000000000 -0400 -*************** -*** 167,170 **** ---- 167,173 ---- - static int reserved_word_acceptable __P((int)); - static int yylex __P((void)); -+ -+ static void push_heredoc __P((REDIRECT *)); -+ static char *mk_alexpansion __P((char *)); - static int alias_expand_token __P((char *)); - static int time_command_acceptable __P((void)); -*************** -*** 262,266 **** - /* Variables to manage the task of reading here documents, because we need to - defer the reading until after a complete command has been collected. */ -! static REDIRECT *redir_stack[10]; - int need_here_doc; - ---- 265,271 ---- - /* Variables to manage the task of reading here documents, because we need to - defer the reading until after a complete command has been collected. */ -! #define HEREDOC_MAX 16 -! -! static REDIRECT *redir_stack[HEREDOC_MAX]; - int need_here_doc; - -*************** -*** 301,305 **** - index is decremented after a case, select, or for command is parsed. */ - #define MAX_CASE_NEST 128 -! static int word_lineno[MAX_CASE_NEST]; - static int word_top = -1; - ---- 306,310 ---- - index is decremented after a case, select, or for command is parsed. */ - #define MAX_CASE_NEST 128 -! static int word_lineno[MAX_CASE_NEST+1]; - static int word_top = -1; - -*************** -*** 452,456 **** - redir.filename = $2; - $$ = make_redirection (0, r_reading_until, redir); -! redir_stack[need_here_doc++] = $$; - } - | NUMBER LESS_LESS WORD ---- 457,461 ---- - redir.filename = $2; - $$ = make_redirection (0, r_reading_until, redir); -! push_heredoc ($$); - } - | NUMBER LESS_LESS WORD -*************** -*** 458,462 **** - redir.filename = $3; - $$ = make_redirection ($1, r_reading_until, redir); -! redir_stack[need_here_doc++] = $$; - } - | LESS_LESS_LESS WORD ---- 463,467 ---- - redir.filename = $3; - $$ = make_redirection ($1, r_reading_until, redir); -! push_heredoc ($$); - } - | LESS_LESS_LESS WORD -*************** -*** 515,519 **** - $$ = make_redirection - (0, r_deblank_reading_until, redir); -! redir_stack[need_here_doc++] = $$; - } - | NUMBER LESS_LESS_MINUS WORD ---- 520,524 ---- - $$ = make_redirection - (0, r_deblank_reading_until, redir); -! push_heredoc ($$); - } - | NUMBER LESS_LESS_MINUS WORD -*************** -*** 522,526 **** - $$ = make_redirection - ($1, r_deblank_reading_until, redir); -! redir_stack[need_here_doc++] = $$; - } - | GREATER_AND '-' ---- 527,531 ---- - $$ = make_redirection - ($1, r_deblank_reading_until, redir); -! push_heredoc ($$); - } - | GREATER_AND '-' -*************** -*** 2377,2380 **** ---- 2382,2400 ---- - static int esacs_needed_count; - -+ static void -+ push_heredoc (r) -+ REDIRECT *r; -+ { -+ if (need_here_doc >= HEREDOC_MAX) -+ { -+ last_command_exit_value = EX_BADUSAGE; -+ need_here_doc = 0; -+ report_syntax_error (_("maximum here-document count exceeded")); -+ reset_parser (); -+ exit_shell (last_command_exit_value); -+ } -+ redir_stack[need_here_doc++] = r; -+ } -+ - void - gather_here_documents () -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 41 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 42 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-043 b/data/bash/bash40-043 deleted file mode 100644 index 0ebacfb68..000000000 --- a/data/bash/bash40-043 +++ /dev/null @@ -1,59 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-043 - -Bug-Reported-by: Michal Zalewski <lcamtuf@coredump.cx> -Bug-Reference-ID: -Bug-Reference-URL: - -Bug-Description: - -When bash is parsing a function definition that contains a here-document -delimited by end-of-file (or end-of-string), it leaves the closing delimiter -uninitialized. This can result in an invalid memory access when the parsed -function is later copied. - -Patch (apply with `patch -p0'): - -*** ../bash-4.0.42/make_cmd.c 2009-01-04 14:32:38.000000000 -0500 ---- make_cmd.c 2014-10-02 11:36:55.000000000 -0400 -*************** -*** 681,684 **** ---- 681,685 ---- - temp->redirector = source; - temp->redirectee = dest_and_filename; -+ temp->here_doc_eof = 0; - temp->instruction = instruction; - temp->flags = 0; -*** ../bash-4.0.42/copy_cmd.c 2009-01-04 14:32:23.000000000 -0500 ---- copy_cmd.c 2014-10-02 11:36:55.000000000 -0400 -*************** -*** 119,123 **** - case r_reading_until: - case r_deblank_reading_until: -! new_redirect->here_doc_eof = savestring (redirect->here_doc_eof); - /*FALLTHROUGH*/ - case r_reading_string: ---- 119,123 ---- - case r_reading_until: - case r_deblank_reading_until: -! new_redirect->here_doc_eof = redirect->here_doc_eof ? savestring (redirect->here_doc_eof) : 0; - /*FALLTHROUGH*/ - case r_reading_string: -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 42 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 43 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash40-044 b/data/bash/bash40-044 deleted file mode 100644 index 06c9abeab..000000000 --- a/data/bash/bash40-044 +++ /dev/null @@ -1,140 +0,0 @@ - BASH PATCH REPORT - ================= - -Bash-Release: 4.0 -Patch-ID: bash40-044 - -Bug-Reported-by: Michal Zalewski <lcamtuf@coredump.cx> -Bug-Reference-ID: -Bug-Reference-URL: - -Bug-Description: - -A combination of nested command substitutions and function importing from -the environment can cause bash to execute code appearing in the environment -variable value following the function definition. - -Patch: - -*** ../bash-4.0.43/builtins/evalstring.c 2014-09-16 19:20:48.000000000 -0400 ---- builtins/evalstring.c 2014-10-04 15:33:32.000000000 -0400 -*************** -*** 44,47 **** ---- 44,48 ---- - #include "../redir.h" - #include "../trap.h" -+ #include "../bashintl.h" - - #include <y.tab.h> -*************** -*** 259,268 **** - struct fd_bitmap *bitmap; - -! if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def) - { -! internal_warning ("%s: ignoring function definition attempt", from_file); -! should_jump_to_top_level = 0; -! last_result = last_command_exit_value = EX_BADUSAGE; -! break; - } - ---- 260,282 ---- - struct fd_bitmap *bitmap; - -! if (flags & SEVAL_FUNCDEF) - { -! char *x; -! -! /* If the command parses to something other than a straight -! function definition, or if we have not consumed the entire -! string, or if the parser has transformed the function -! name (as parsing will if it begins or ends with shell -! whitespace, for example), reject the attempt */ -! if (command->type != cm_function_def || -! ((x = parser_remaining_input ()) && *x) || -! (STREQ (from_file, command->value.Function_def->name->word) == 0)) -! { -! internal_warning (_("%s: ignoring function definition attempt"), from_file); -! should_jump_to_top_level = 0; -! last_result = last_command_exit_value = EX_BADUSAGE; -! reset_parser (); -! break; -! } - } - -*************** -*** 329,333 **** - - if (flags & SEVAL_ONECMD) -! break; - } - } ---- 343,350 ---- - - if (flags & SEVAL_ONECMD) -! { -! reset_parser (); -! break; -! } - } - } -*** ../bash-4.0.43/parse.y 2014-09-30 19:41:09.000000000 -0400 ---- parse.y 2014-10-04 15:27:12.000000000 -0400 -*************** -*** 2279,2282 **** ---- 2279,2292 ---- - } - -+ char * -+ parser_remaining_input () -+ { -+ if (shell_input_line == 0) -+ return 0; -+ if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len) -+ return '\0'; /* XXX */ -+ return (shell_input_line + shell_input_line_index); -+ } -+ - #ifdef INCLUDE_UNUSED - /* Back the input pointer up by one, effectively `ungetting' a character. */ -*************** -*** 3628,3633 **** - restore_parser_state (&ps); - reset_parser (); -! if (interactive) -! token_to_read = 0; - - /* Need to find how many characters parse_and_execute consumed, update ---- 3638,3643 ---- - restore_parser_state (&ps); - reset_parser (); -! -! token_to_read = 0; - - /* Need to find how many characters parse_and_execute consumed, update -*** ../bash-4.0.43/shell.h 2009-01-04 14:32:41.000000000 -0500 ---- shell.h 2014-10-04 15:27:12.000000000 -0400 -*************** -*** 161,164 **** ---- 161,166 ---- - - /* Let's try declaring these here. */ -+ extern char *parser_remaining_input __P((void)); -+ - extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *)); - extern void restore_parser_state __P((sh_parser_state_t *)); -*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500 ---- patchlevel.h 2009-02-22 16:11:31.000000000 -0500 -*************** -*** 26,30 **** - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 43 - - #endif /* _PATCHLEVEL_H_ */ ---- 26,30 ---- - looks for to find the patch level (for the sccs version string). */ - -! #define PATCHLEVEL 44 - - #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-001 b/data/bash/bash44-001 new file mode 100644 index 000000000..7b848feec --- /dev/null +++ b/data/bash/bash44-001 @@ -0,0 +1,60 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-001 + +Bug-Reported-by: Sean Zha <freeman_cha@hotmail.com> +Bug-Reference-ID: <BN3PR01MB13657D9303EB94BF6E54216E8CCA0@BN3PR01MB1365.prod.exchangelabs.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00107.html + +Bug-Description: + +Bash-4.4 changed the way the history list is initially allocated to reduce +the number of reallocations and copies. Users who set HISTSIZE to a very +large number to essentially unlimit the size of the history list will get +memory allocation errors + +Patch (apply with `patch -p0'): + +*** ../bash-4.4/lib/readline/history.c 2015-12-28 13:50:31.000000000 -0500 +--- lib/readline/history.c 2016-09-30 14:28:40.000000000 -0400 +*************** +*** 58,61 **** +--- 58,63 ---- + #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 +*************** +*** 308,312 **** + { + if (history_stifled && history_max_entries > 0) +! history_size = history_max_entries + 2; + else + history_size = DEFAULT_HISTORY_INITIAL_SIZE; +--- 310,316 ---- + { + if (history_stifled && history_max_entries > 0) +! history_size = (history_max_entries > MAX_HISTORY_INITIAL_SIZE) +! ? MAX_HISTORY_INITIAL_SIZE +! : history_max_entries + 2; + else + history_size = DEFAULT_HISTORY_INITIAL_SIZE; +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 0 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-002 b/data/bash/bash44-002 new file mode 100644 index 000000000..6d8baef14 --- /dev/null +++ b/data/bash/bash44-002 @@ -0,0 +1,69 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-002 + +Bug-Reported-by: Eric Pruitt <eric.pruitt@gmail.com> +Bug-Reference-ID: <20160916055120.GA28272@sinister.codevat.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00015.html + +Bug-Description: + +Bash-4.4 warns when discarding NUL bytes in command substitution output +instead of silently dropping them. This patch changes the warnings from +one per NUL byte encountered to one warning per command substitution. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4/subst.c 2016-08-30 16:46:38.000000000 -0400 +--- subst.c 2016-09-26 10:20:19.000000000 -0400 +*************** +*** 5932,5935 **** +--- 5933,5937 ---- + int istring_index, istring_size, c, tflag, skip_ctlesc, skip_ctlnul; + ssize_t bufn; ++ int nullbyte; + + istring = (char *)NULL; +*************** +*** 5939,5942 **** +--- 5941,5946 ---- + 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. */ +*************** +*** 5957,5961 **** + { + #if 1 +! internal_warning ("%s", _("command substitution: ignored null byte in input")); + #endif + continue; +--- 5961,5969 ---- + { + #if 1 +! if (nullbyte == 0) +! { +! internal_warning ("%s", _("command substitution: ignored null byte in input")); +! nullbyte = 1; +! } + #endif + continue; +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 2 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-003 b/data/bash/bash44-003 new file mode 100644 index 000000000..01b6b6c9d --- /dev/null +++ b/data/bash/bash44-003 @@ -0,0 +1,58 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-003 + +Bug-Reported-by: op7ic \x00 <op7ica@gmail.com> +Bug-Reference-ID: <CAFHyJTopWC5Jx+U7WcvxSZKu+KrqSf+_3sHPiRWo=VzXSiPq=w@mail.gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00005.html + +Bug-Description: + +Specially-crafted input, in this case an incomplete pathname expansion +bracket expression containing an invalid collating symbol, can cause the +shell to crash. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4/lib/glob/sm_loop.c 2016-04-10 11:23:21.000000000 -0400 +--- lib/glob/sm_loop.c 2016-11-02 14:03:34.000000000 -0400 +*************** +*** 331,334 **** +--- 331,340 ---- + 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) +*************** +*** 484,487 **** +--- 490,496 ---- + 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. */ +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 2 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 3 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-004 b/data/bash/bash44-004 new file mode 100644 index 000000000..1d8af26a9 --- /dev/null +++ b/data/bash/bash44-004 @@ -0,0 +1,84 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-004 + +Bug-Reported-by: Christian Weisgerber <naddy@mips.inka.de> +Bug-Reference-ID: <20161101160302.GB54856@lorvorc.mips.inka.de> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00004.html + +Bug-Description: + +There is a race condition that can result in bash referencing freed memory +when freeing data associated with the last process substitution. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4/jobs.c 2016-08-23 16:38:44.000000000 -0400 +--- jobs.c 2016-11-02 18:24:45.000000000 -0400 +*************** +*** 454,457 **** +--- 454,472 ---- + } + ++ 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 () +*** ../bash-4.4/jobs.h 2016-04-27 10:35:51.000000000 -0400 +--- jobs.h 2016-11-02 18:25:08.000000000 -0400 +*************** +*** 191,194 **** +--- 191,195 ---- + 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)); +*** ../bash-4.4/subst.c 2016-08-30 16:46:38.000000000 -0400 +--- subst.c 2016-11-02 18:23:24.000000000 -0400 +*************** +*** 5809,5816 **** + #if defined (JOB_CONTROL) + if (last_procsub_child) +! { +! discard_pipeline (last_procsub_child); +! last_procsub_child = (PROCESS *)NULL; +! } + last_procsub_child = restore_pipeline (0); + #endif +--- 5834,5838 ---- + #if defined (JOB_CONTROL) + if (last_procsub_child) +! discard_last_procsub_child (); + last_procsub_child = restore_pipeline (0); + #endif +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 3 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 4 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-005 b/data/bash/bash44-005 new file mode 100644 index 000000000..bacd67aea --- /dev/null +++ b/data/bash/bash44-005 @@ -0,0 +1,47 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-005 + +Bug-Reported-by: Dr. Werner Fink <werner@suse.de> +Bug-Reference-ID: <20161107100936.ajnojd7dspirdflf@noether.suse.de> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00054.html + +Bug-Description: + +Under certain circumstances, a simple command is optimized to eliminate a +fork, resulting in an EXIT trap not being executed. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4/builtins/evalstring.c 2016-08-11 14:18:51.000000000 -0400 +--- builtins/evalstring.c 2016-11-08 15:05:07.000000000 -0500 +*************** +*** 105,114 **** + *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) && +--- 105,111 ---- +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 4 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 5 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-006 b/data/bash/bash44-006 new file mode 100644 index 000000000..f68c7ab47 --- /dev/null +++ b/data/bash/bash44-006 @@ -0,0 +1,59 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-006 + +Bug-Reported-by: <fernando@null-life.com> +Bug-Reference-ID: <CAEr-gPFPvqheiAeENmMkEwWRd4U=1iqCsYmR3sLdULOqL++_tQ@mail.gmail.com> +Bug-Reference-URL: + +Bug-Description: + +Out-of-range negative offsets to popd can cause the shell to crash attempting +to free an invalid memory block. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/builtins/pushd.def 2016-01-25 13:31:49.000000000 -0500 +--- builtins/pushd.def 2016-10-28 10:46:49.000000000 -0400 +*************** +*** 366,370 **** + } + +! if (which > directory_list_offset || (directory_list_offset == 0 && which == 0)) + { + pushd_error (directory_list_offset, which_word ? which_word : ""); +--- 366,370 ---- + } + +! if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0)) + { + pushd_error (directory_list_offset, which_word ? which_word : ""); +*************** +*** 388,391 **** +--- 388,396 ---- + 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--; +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 5 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 6 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-007 b/data/bash/bash44-007 new file mode 100644 index 000000000..5fb55ca40 --- /dev/null +++ b/data/bash/bash44-007 @@ -0,0 +1,151 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-007 + +Bug-Reported-by: Jens Heyens <jens.heyens@cispa.saarland> +Bug-Reference-ID: +Bug-Reference-URL: https://savannah.gnu.org/support/?109224 + +Bug-Description: + +When performing filename completion, bash dequotes the directory name being +completed, which can result in match failures and potential unwanted +expansion. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/bashline.c 2016-08-05 21:44:05.000000000 -0400 +--- bashline.c 2017-01-19 13:15:51.000000000 -0500 +*************** +*** 143,147 **** + static void restore_directory_hook __P((rl_icppfunc_t)); + +! static int directory_exists __P((const char *)); + + static void cleanup_expansion_error __P((void)); +--- 144,148 ---- + static void restore_directory_hook __P((rl_icppfunc_t)); + +! static int directory_exists __P((const char *, int)); + + static void cleanup_expansion_error __P((void)); +*************** +*** 3103,3111 **** + } + +! /* Check whether not the (dequoted) version of DIRNAME, with any trailing slash +! removed, exists. */ + static int +! directory_exists (dirname) + const char *dirname; + { + char *new_dirname; +--- 3107,3116 ---- + } + +! /* 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, should_dequote) + const char *dirname; ++ int should_dequote; + { + char *new_dirname; +*************** +*** 3113,3118 **** + struct stat sb; + +! /* First, dequote the directory name */ +! new_dirname = bash_dequote_filename ((char *)dirname, rl_completion_quote_character); + dirlen = STRLEN (new_dirname); + if (new_dirname[dirlen - 1] == '/') +--- 3118,3124 ---- + struct stat sb; + +! /* 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] == '/') +*************** +*** 3146,3150 **** + should_expand_dirname = '`'; + +! if (should_expand_dirname && directory_exists (local_dirname)) + should_expand_dirname = 0; + +--- 3152,3156 ---- + should_expand_dirname = '`'; + +! if (should_expand_dirname && directory_exists (local_dirname, 0)) + should_expand_dirname = 0; + +*************** +*** 3156,3160 **** + 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 */ + unbound_vars_is_error = global_nounset; + if (wl) +--- 3162,3166 ---- + global_nounset = unbound_vars_is_error; + unbound_vars_is_error = 0; +! 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) +*************** +*** 3245,3249 **** + } + +! if (should_expand_dirname && directory_exists (local_dirname)) + should_expand_dirname = 0; + +--- 3262,3266 ---- + } + +! if (should_expand_dirname && directory_exists (local_dirname, 1)) + should_expand_dirname = 0; + +*************** +*** 3251,3255 **** + { + new_dirname = savestring (local_dirname); +! wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_COMPLETE); /* does the right thing */ + if (wl) + { +--- 3268,3272 ---- + { + new_dirname = savestring (local_dirname); +! wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB|W_NOPROCSUB|W_COMPLETE); /* does the right thing */ + if (wl) + { +*** ../bash-4.4/subst.c 2016-08-30 16:46:38.000000000 -0400 +--- subst.c 2017-01-19 07:09:57.000000000 -0500 +*************** +*** 9459,9462 **** +--- 9459,9466 ---- + 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; +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 6 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 7 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-008 b/data/bash/bash44-008 new file mode 100644 index 000000000..94c5d4aeb --- /dev/null +++ b/data/bash/bash44-008 @@ -0,0 +1,84 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-008 + +Bug-Reported-by: Koichi MURASE <myoga.murase@gmail.com> +Bug-Reference-ID: <CAFLRLk-V+1AeQ2k=pY7ih6V+MfQ_w8EF3YWL2E+wmLfgKBtzXA@mail.gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00050.html + +Bug-Description: + +Under certain circumstances, bash will evaluate arithmetic expressions as +part of reading an expression token even when evaluation is suppressed. This +happens while evaluating a conditional expression and skipping over the +failed branch of the expression. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/expr.c 2015-10-11 14:46:36.000000000 -0400 +--- expr.c 2016-11-08 11:55:46.000000000 -0500 +*************** +*** 579,585 **** + if (curtok == QUES) /* found conditional expr */ + { +- readtok (); +- if (curtok == 0 || curtok == COL) +- evalerror (_("expression expected")); + if (cval == 0) + { +--- 579,582 ---- +*************** +*** 588,591 **** +--- 585,592 ---- + } + ++ readtok (); ++ if (curtok == 0 || curtok == COL) ++ evalerror (_("expression expected")); ++ + val1 = EXP_HIGHEST (); + +*************** +*** 594,600 **** + if (curtok != COL) + evalerror (_("`:' expected for conditional expression")); +! readtok (); +! if (curtok == 0) +! evalerror (_("expression expected")); + set_noeval = 0; + if (cval) +--- 595,599 ---- + if (curtok != COL) + evalerror (_("`:' expected for conditional expression")); +! + set_noeval = 0; + if (cval) +*************** +*** 604,608 **** +--- 603,611 ---- + } + ++ readtok (); ++ if (curtok == 0) ++ evalerror (_("expression expected")); + val2 = expcond (); ++ + if (set_noeval) + noeval--; +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 7 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 8 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-009 b/data/bash/bash44-009 new file mode 100644 index 000000000..26a054af4 --- /dev/null +++ b/data/bash/bash44-009 @@ -0,0 +1,107 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-009 + +Bug-Reported-by: Hong Cho <hong.cho@citrix.com> +Bug-Reference-ID: <c30b5fe62b2543af8297e47ca487c29c@SJCPEX02CL02.citrite.net> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-12/msg00043.html + +Bug-Description: + +There is a race condition in add_history() that can be triggered by a fatal +signal arriving between the time the history length is updated and the time +the history list update is completed. A later attempt to reference an +invalid history entry can cause a crash. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/lib/readline/history.c 2016-11-11 13:42:49.000000000 -0500 +--- lib/readline/history.c 2016-12-05 10:37:51.000000000 -0500 +*************** +*** 280,283 **** +--- 280,284 ---- + { + HIST_ENTRY *temp; ++ int new_length; + + if (history_stifled && (history_length == history_max_entries)) +*************** +*** 296,306 **** + /* 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 + + history_base++; + } +--- 297,303 ---- + /* Copy the rest of the entries, moving down one slot. Copy includes + trailing NULL. */ + memmove (the_history, the_history + 1, history_length * sizeof (HIST_ENTRY *)); + ++ new_length = history_length; + history_base++; + } +*************** +*** 316,320 **** + history_size = DEFAULT_HISTORY_INITIAL_SIZE; + the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *)); +! history_length = 1; + } + else +--- 313,317 ---- + history_size = DEFAULT_HISTORY_INITIAL_SIZE; + the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *)); +! new_length = 1; + } + else +*************** +*** 326,330 **** + xrealloc (the_history, history_size * sizeof (HIST_ENTRY *)); + } +! history_length++; + } + } +--- 323,327 ---- + xrealloc (the_history, history_size * sizeof (HIST_ENTRY *)); + } +! new_length = history_length + 1; + } + } +*************** +*** 332,337 **** + temp = alloc_history_entry ((char *)string, hist_inittime ()); + +! the_history[history_length] = (HIST_ENTRY *)NULL; +! the_history[history_length - 1] = temp; + } + +--- 329,335 ---- + temp = alloc_history_entry ((char *)string, hist_inittime ()); + +! the_history[new_length] = (HIST_ENTRY *)NULL; +! the_history[new_length - 1] = temp; +! history_length = new_length; + } + +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 8 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 9 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-010 b/data/bash/bash44-010 new file mode 100644 index 000000000..2346005c3 --- /dev/null +++ b/data/bash/bash44-010 @@ -0,0 +1,49 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-010 + +Bug-Reported-by: Clark Wang <dearvoid@gmail.com> +Bug-Reference-ID: <CADv8-og092RvvUUHy46=BPKChCXw5g=GOOqgN0V3f4a3TpLebQ@mail.gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00104.html + +Bug-Description: + +Depending on compiler optimizations and behavior, the `read' builtin may not +save partial input when a timeout occurs. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/builtins/read.def 2016-05-16 14:24:56.000000000 -0400 +--- builtins/read.def 2016-11-25 12:37:56.000000000 -0500 +*************** +*** 182,186 **** + { + register char *varname; +! int size, i, nr, pass_next, saw_escape, eof, opt, retval, code, print_ps2; + 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; +--- 182,187 ---- + { + register char *varname; +! 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; + +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 9 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-011 b/data/bash/bash44-011 new file mode 100644 index 000000000..2eb9957ff --- /dev/null +++ b/data/bash/bash44-011 @@ -0,0 +1,50 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-011 + +Bug-Reported-by: Russell King <rmk@armlinux.org.uk> +Bug-Reference-ID: <E1cNnFx-0007G2-S2@flint.armlinux.org.uk> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2017-01/msg00000.html + +Bug-Description: + +Subshells begun to run command and process substitutions may attempt to +set the terminal's process group to an incorrect value if they receive +a fatal signal. This depends on the behavior of the process that starts +the shell. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/sig.c 2016-02-11 15:02:45.000000000 -0500 +--- sig.c 2017-01-04 09:09:47.000000000 -0500 +*************** +*** 586,590 **** + if (sig == SIGHUP && (interactive || (subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB)))) + hangup_all_jobs (); +! end_job_control (); + #endif /* JOB_CONTROL */ + +--- 571,576 ---- + if (sig == SIGHUP && (interactive || (subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB)))) + hangup_all_jobs (); +! if ((subshell_environment & (SUBSHELL_COMSUB|SUBSHELL_PROCSUB)) == 0) +! end_job_control (); + #endif /* JOB_CONTROL */ + +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-012 b/data/bash/bash44-012 new file mode 100644 index 000000000..182fd7cb1 --- /dev/null +++ b/data/bash/bash44-012 @@ -0,0 +1,161 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-012 + +Bug-Reported-by: Clark Wang <dearvoid@gmail.com> +Bug-Reference-ID: <CADv8-ojttPUFOZXqbjsvy83LfaJtQKZ5qejGdF6j0VJ3vtrYOA@mail.gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00106.html + +Bug-Description: + +When -N is used, the input is not supposed to be split using $IFS, but +leading and trailing IFS whitespace was still removed. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/subst.c 2017-01-20 14:22:01.000000000 -0500 +--- subst.c 2017-01-25 13:43:22.000000000 -0500 +*************** +*** 2826,2834 **** + /* 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. + + XXX - this function is very similar to list_string; they should be + combined - XXX */ + char * + get_word_from_string (stringp, separators, endptr) +--- 2826,2838 ---- + /* 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, 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) +*************** +*** 2838,2841 **** +--- 2842,2846 ---- + 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; + +*************** +*** 2847,2854 **** + separators[2] == '\n' && + separators[3] == '\0'; +! for (xflags = 0, s = ifs_value; s && *s; s++) + { + if (*s == CTLESC) xflags |= SX_NOCTLESC; + if (*s == CTLNUL) xflags |= SX_NOESCCTLNUL; + } + +--- 2852,2861 ---- + separators[2] == '\n' && + separators[3] == '\0'; +! 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 */ + } + +*************** +*** 2857,2864 **** + + /* Remove sequences of whitespace at the beginning of STRING, as +! long as those characters appear in IFS. */ +! if (sh_style_split || !separators || !*separators) + { +! for (; *s && spctabnl (*s) && isifs (*s); s++); + + /* If the string is nothing but whitespace, update it and return. */ +--- 2864,2872 ---- + + /* Remove sequences of whitespace at the beginning of STRING, as +! 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) && islocalsep (*s); s++); + + /* If the string is nothing but whitespace, update it and return. */ +*************** +*** 2879,2885 **** + 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; + current_word = string_extract_verbatim (s, slen, &sindex, separators, xflags); + +--- 2887,2893 ---- + This obeys the field splitting rules in Posix.2. */ + sindex = 0; +! /* 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); + +*************** +*** 2900,2904 **** + /* 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])) + sindex++; + +--- 2908,2912 ---- + /* Now skip sequences of space, tab, or newline characters if they are + in the list of separators. */ +! while (s[sindex] && spctabnl (s[sindex]) && islocalsep (s[sindex])) + sindex++; + +*************** +*** 2907,2916 **** + 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])) + { + 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])) + sindex++; + } +--- 2915,2924 ---- + 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 && 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]) && islocalsep(s[sindex])) + sindex++; + } +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-013 b/data/bash/bash44-013 new file mode 100644 index 000000000..5b919e181 --- /dev/null +++ b/data/bash/bash44-013 @@ -0,0 +1,43 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-013 + +Bug-Reported-by: Siteshwar Vashisht <svashisht@redhat.com> +Bug-Reference-ID: <1508861265.9523642.1484659442561.JavaMail.zimbra@redhat.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2017-01/msg00026.html + +Bug-Description: + +If a here-document contains a command substitution, the command substitution +can get access to the file descriptor used to write the here-document. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/redir.c 2016-06-02 20:22:24.000000000 -0400 +--- redir.c 2017-01-17 13:23:40.000000000 -0500 +*************** +*** 470,473 **** +--- 467,472 ---- + } + ++ SET_CLOSE_ON_EXEC (fd); ++ + errno = r = 0; /* XXX */ + /* write_here_document returns 0 on success, errno on failure. */ +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-014 b/data/bash/bash44-014 new file mode 100644 index 000000000..ad3c78ac8 --- /dev/null +++ b/data/bash/bash44-014 @@ -0,0 +1,104 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-014 + +Bug-Reported-by: Oyvind Hvidsten <oyvind.hvidsten@dhampir.no> +Bug-Reference-ID: <c01b7049-925c-9409-d978-e59bf42591f4@dhampir.no> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2017-12/msg00023.html + +Bug-Description: + +Under some circumstances, functions that return via the `return' builtin do +not clean up memory they allocated to keep track of FIFOs. + +Patch (apply with `patch -p0'): + +*** ../bash-20171205/execute_cmd.c 2017-12-08 07:38:28.000000000 -0500 +--- execute_cmd.c 2018-01-26 15:23:38.000000000 -0500 +*************** +*** 727,730 **** +--- 727,732 ---- + ofifo = num_fifos (); + ofifo_list = copy_fifo_list ((int *)&osize); ++ begin_unwind_frame ("internal_fifos"); ++ add_unwind_protect (xfree, ofifo_list); + saved_fifo = 1; + } +*************** +*** 742,746 **** + #if defined (PROCESS_SUBSTITUTION) + if (saved_fifo) +! free ((void *)ofifo_list); + #endif + return (last_command_exit_value = EXECUTION_FAILURE); +--- 744,751 ---- + #if defined (PROCESS_SUBSTITUTION) + if (saved_fifo) +! { +! free ((void *)ofifo_list); +! discard_unwind_frame ("internal_fifos"); +! } + #endif + return (last_command_exit_value = EXECUTION_FAILURE); +*************** +*** 1061,1064 **** +--- 1066,1070 ---- + close_new_fifos ((char *)ofifo_list, osize); + free ((void *)ofifo_list); ++ discard_unwind_frame ("internal_fifos"); + } + #endif +*************** +*** 4978,4984 **** + #endif + +! #if defined (PROCESS_SUBSTITUTION) + ofifo = num_fifos (); + ofifo_list = copy_fifo_list (&osize); + #endif + +--- 4984,4995 ---- + #endif + +! #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 + +*************** +*** 5064,5068 **** + if (nfifo > ofifo) + close_new_fifos (ofifo_list, osize); +! free (ofifo_list); + #endif + +--- 5075,5081 ---- + if (nfifo > ofifo) + close_new_fifos (ofifo_list, osize); +! if (ofifo_list) +! free (ofifo_list); +! discard_unwind_frame ("saved_fifos"); + #endif + +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-015 b/data/bash/bash44-015 new file mode 100644 index 000000000..dc2fb22c4 --- /dev/null +++ b/data/bash/bash44-015 @@ -0,0 +1,43 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-015 + +Bug-Reported-by: David Simmons <bug-bash@tmp.davidsimmons.com> +Bug-Reference-ID: <bc6f0839-fa50-fe8f-65f5-5aa6feb11ec5@davidsimmons.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00033.html + +Bug-Description: + +Process substitution can leak internal quoting to the parser in the invoked +subshell. + +Patch (apply with `patch -p0'): + +*** ../bash-20170210/subst.c 2017-01-19 11:08:50.000000000 -0500 +--- subst.c 2017-02-20 10:12:49.000000000 -0500 +*************** +*** 5907,5910 **** +--- 5907,5912 ---- + expanding_redir = 0; + ++ remove_quoted_escapes (string); ++ + subshell_level++; + result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST)); +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 15 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-016 b/data/bash/bash44-016 new file mode 100644 index 000000000..94ae90baa --- /dev/null +++ b/data/bash/bash44-016 @@ -0,0 +1,78 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-016 + +Bug-Reported-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> +Bug-Reference-ID: <CAJq09z7G1-QnLyiUQA0DS=V3da_rtHF8VdYbbdzPe_W3kydpRg@mail.gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-09/msg00092.html + +Bug-Description: + +Bash can perform trap processing while reading command substitution output +instead of waiting until the command completes. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4/lib/sh/zread.c 2014-12-22 10:48:04.000000000 -0500 +--- lib/sh/zread.c 2016-09-29 15:21:36.000000000 -0400 +*************** +*** 38,42 **** +--- 38,45 ---- + #endif + ++ extern int executing_builtin; ++ + extern void check_signals_and_traps (void); ++ extern void check_signals (void); + extern int signal_is_trapped (int); + +*************** +*** 51,69 **** + 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 + + return r; +--- 54,64 ---- + ssize_t r; + + while ((r = read (fd, buf, len)) < 0 && errno == EINTR) +! /* 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; +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 15 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-017 b/data/bash/bash44-017 new file mode 100644 index 000000000..f427732d3 --- /dev/null +++ b/data/bash/bash44-017 @@ -0,0 +1,45 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-017 + +Bug-Reported-by: ZhangXiao <xiao.zhang@windriver.com> +Bug-Reference-ID: <58AD3EAC.4020608@windriver.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00061.html + +Bug-Description: + +There is a memory leak when `read -e' is used to read a line using readline. + +Patch (apply with `patch -p0'): + +*** ../bash-20170217/builtins/read.def 2017-01-02 16:53:02.000000000 -0500 +--- builtins/read.def 2017-02-22 09:43:14.000000000 -0500 +*************** +*** 691,694 **** +--- 691,699 ---- + CHECK_ALRM; + ++ #if defined (READLINE) ++ if (edit) ++ free (rlbuf); ++ #endif ++ + if (retval < 0) + { +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-018 b/data/bash/bash44-018 new file mode 100644 index 000000000..b1c935c61 --- /dev/null +++ b/data/bash/bash44-018 @@ -0,0 +1,48 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-018 + +Bug-Reported-by: Siteshwar Vashisht <svashisht@redhat.com> +Bug-Reference-ID: <1341922391.30876471.1501250355579.JavaMail.zimbra@redhat.com> +Bug-Reference-URL: https://bugzilla.redhat.com/show_bug.cgi?id=1466737 + +Bug-Description: + +Under certain circumstances (e.g., reading from /dev/zero), read(2) will not +return -1 even when interrupted by a signal. The read builtin needs to check +for signals in this case. + +Patch (apply with `patch -p0'): + +*** ../bash-20170622/builtins/read.def 2017-06-17 18:45:20.000000000 -0400 +--- builtins/read.def 2017-06-30 11:09:26.000000000 -0400 +*************** +*** 611,615 **** + + CHECK_ALRM; +! + #if defined (READLINE) + } +--- 611,615 ---- + + CHECK_ALRM; +! QUIT; /* in case we didn't call check_signals() */ + #if defined (READLINE) + } +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 18 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-019 b/data/bash/bash44-019 new file mode 100644 index 000000000..081e97932 --- /dev/null +++ b/data/bash/bash44-019 @@ -0,0 +1,50 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-019 + +Bug-Reported-by: Kieran Grant <kieran.thehacker.grant@gmail.com> +Bug-Reference-ID: <ec9071ae-efb1-9e09-5d03-e905daf2835c@gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2018-02/msg00002.html + +Bug-Description: + +With certain values for PS1, especially those that wrap onto three or more +lines, readline will miscalculate the number of invisible characters, +leading to crashes and core dumps. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4.18/lib/readline/display.c 2016-07-28 14:49:33.000000000 -0400 +--- lib/readline/display.c 2018-02-03 19:19:35.000000000 -0500 +*************** +*** 772,776 **** + wadjust = (newlines == 0) + ? prompt_invis_chars_first_line +! : ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line); + + /* fix from Darin Johnson <darin@acuson.com> for prompt string with +--- 788,794 ---- + wadjust = (newlines == 0) + ? 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 +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 18 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 19 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-020 b/data/bash/bash44-020 new file mode 100644 index 000000000..1c42643b6 --- /dev/null +++ b/data/bash/bash44-020 @@ -0,0 +1,177 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-020 + +Bug-Reported-by: Graham Northup <northug@clarkson.edu> +Bug-Reference-ID: <537530c3-61f0-349b-9de6-fa4e2487f428@clarkson.edu> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00025.html + +Bug-Description: + +In circumstances involving long-running scripts that create and reap many +processes, it is possible for the hash table bash uses to store exit +statuses from asynchronous processes to develop loops. This patch fixes +the loop causes and adds code to detect any future loops. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/jobs.c 2016-11-11 13:42:55.000000000 -0500 +--- jobs.c 2017-02-22 15:16:28.000000000 -0500 +*************** +*** 813,818 **** + struct pidstat *ps; + +! bucket = pshash_getbucket (pid); +! psi = bgp_getindex (); + ps = &bgpids.storage[psi]; + +--- 796,815 ---- + struct pidstat *ps; + +! /* 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]; + +*************** +*** 842,845 **** +--- 839,843 ---- + { + struct pidstat *ps; ++ ps_index_t *bucket; + + ps = &bgpids.storage[psi]; +*************** +*** 847,856 **** + return; + +! if (ps->bucket_next != NO_PID) + bgpids.storage[ps->bucket_next].bucket_prev = ps->bucket_prev; +! if (ps->bucket_prev != NO_PID) + bgpids.storage[ps->bucket_prev].bucket_next = ps->bucket_next; + else +! *(pshash_getbucket (ps->pid)) = ps->bucket_next; + } + +--- 845,861 ---- + return; + +! if (ps->bucket_next != NO_PIDSTAT) + bgpids.storage[ps->bucket_next].bucket_prev = ps->bucket_prev; +! if (ps->bucket_prev != NO_PIDSTAT) + bgpids.storage[ps->bucket_prev].bucket_next = ps->bucket_next; + else +! { +! 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; + } + +*************** +*** 859,863 **** + pid_t pid; + { +! ps_index_t psi; + + if (bgpids.storage == 0 || bgpids.nalloc == 0 || bgpids.npid == 0) +--- 864,868 ---- + pid_t pid; + { +! ps_index_t psi, orig_psi; + + if (bgpids.storage == 0 || bgpids.nalloc == 0 || bgpids.npid == 0) +*************** +*** 865,871 **** + + /* 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; + + if (psi == NO_PIDSTAT) +--- 870,883 ---- + + /* Search chain using hash to find bucket in pidstat_table */ +! 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) +*************** +*** 905,909 **** + pid_t pid; + { +! ps_index_t psi; + + if (bgpids.storage == 0 || bgpids.nalloc == 0 || bgpids.npid == 0) +--- 917,921 ---- + pid_t pid; + { +! ps_index_t psi, orig_psi; + + if (bgpids.storage == 0 || bgpids.nalloc == 0 || bgpids.npid == 0) +*************** +*** 911,917 **** + + /* 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); + + return -1; +--- 923,936 ---- + + /* Search chain using hash to find bucket in pidstat_table */ +! 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; +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 19 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 20 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-021 b/data/bash/bash44-021 new file mode 100644 index 000000000..37da331d5 --- /dev/null +++ b/data/bash/bash44-021 @@ -0,0 +1,57 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-021 + +Bug-Reported-by: werner@suse.de +Bug-Reference-ID: <201803281402.w2SE2VOa000476@noether.suse.de> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2018-03/msg00196.html + +Bug-Description: + +A SIGINT received inside a SIGINT trap handler can possibly cause the +shell to loop. + +Patch (apply with `patch -p0'): + +*** ../bash-20180329/jobs.c 2018-02-11 18:07:22.000000000 -0500 +--- jobs.c 2018-04-02 14:24:21.000000000 -0400 +*************** +*** 2690,2694 **** + if (job_control == 0 || (subshell_environment&SUBSHELL_COMSUB)) + { +! old_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); + waiting_for_child = 0; + if (old_sigint_handler == SIG_IGN) +--- 2690,2704 ---- + if (job_control == 0 || (subshell_environment&SUBSHELL_COMSUB)) + { +! SigHandler *temp_sigint_handler; +! +! temp_sigint_handler = set_signal_handler (SIGINT, wait_sigint_handler); +! if (temp_sigint_handler == wait_sigint_handler) +! { +! #if defined (DEBUG) +! internal_warning ("wait_for: recursively setting old_sigint_handler to wait_sigint_handler: running_trap = %d", running_trap); +! #endif +! } +! else +! old_sigint_handler = temp_sigint_handler; + waiting_for_child = 0; + if (old_sigint_handler == SIG_IGN) +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 20 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 21 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-022 b/data/bash/bash44-022 new file mode 100644 index 000000000..f692a2c46 --- /dev/null +++ b/data/bash/bash44-022 @@ -0,0 +1,61 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-022 + +Bug-Reported-by: Nuzhna Pomoshch <nuzhna_pomoshch@yahoo.com> +Bug-Reference-ID: <1317167476.1492079.1495999776464@mail.yahoo.com> +Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-readline/2017-05/msg00005.html + +Bug-Description: + +There are cases where a failing readline command (e.g., delete-char at the end +of a line) can cause a multi-character key sequence to `back up' and attempt +to re-read some of the characters in the sequence. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/lib/readline/readline.c 2016-04-20 15:53:52.000000000 -0400 +--- lib/readline/readline.c 2018-05-26 17:19:00.000000000 -0400 +*************** +*** 1058,1062 **** + r = _rl_dispatch (ANYOTHERKEY, m); + } +! else if (r && map[ANYOTHERKEY].function) + { + /* We didn't match (r is probably -1), so return something to +--- 1056,1060 ---- + r = _rl_dispatch (ANYOTHERKEY, m); + } +! else if (r < 0 && map[ANYOTHERKEY].function) + { + /* We didn't match (r is probably -1), so return something to +*************** +*** 1070,1074 **** + return -2; + } +! else if (r && got_subseq) + { + /* OK, back up the chain. */ +--- 1068,1072 ---- + return -2; + } +! else if (r < 0 && got_subseq) /* XXX */ + { + /* OK, back up the chain. */ +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 21 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 22 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/bash44-023 b/data/bash/bash44-023 new file mode 100644 index 000000000..dd8d75d9b --- /dev/null +++ b/data/bash/bash44-023 @@ -0,0 +1,52 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.4 +Patch-ID: bash44-023 + +Bug-Reported-by: Martijn Dekker <martijn@inlv.org> +Bug-Reference-ID: <5326d6b9-2625-1d32-3e6e-ad1d15462c09@inlv.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00041.html + +Bug-Description: + +When sourcing a file from an interactive shell, setting the SIGINT handler +to the default and typing ^C will cause the shell to exit. + +Patch (apply with `patch -p0'): + +*** ../bash-4.4-patched/builtins/trap.def 2016-01-25 13:32:38.000000000 -0500 +--- builtins/trap.def 2016-11-06 12:04:35.000000000 -0500 +*************** +*** 99,102 **** +--- 99,103 ---- + + extern int posixly_correct, subshell_environment; ++ extern int sourcelevel, running_trap; + + int +*************** +*** 213,216 **** +--- 214,220 ---- + if (interactive) + set_signal_handler (SIGINT, sigint_sighandler); ++ /* special cases for interactive == 0 */ ++ else if (interactive_shell && (sourcelevel||running_trap)) ++ set_signal_handler (SIGINT, sigint_sighandler); + else + set_signal_handler (SIGINT, termsig_sighandler); +*** ../bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400 +--- patchlevel.h 2016-10-01 11:01:28.000000000 -0400 +*************** +*** 26,30 **** + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 22 + + #endif /* _PATCHLEVEL_H_ */ +--- 26,30 ---- + looks for to find the patch level (for the sccs version string). */ + +! #define PATCHLEVEL 23 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/data/bash/make.sh b/data/bash/make.sh index 46f5d89a5..4f0534eb4 100644 --- a/data/bash/make.sh +++ b/data/bash/make.sh @@ -1,13 +1,13 @@ pkg:extract cd * -for ((x = 1; x != 41; ++x)); do - patch -p0 <"${PKG_DATA}/bash40-$(printf '%.3u\n' "$x")" +for ((x = 1; x != 24; ++x)); do + patch -p0 <"${PKG_DATA}/bash44-$(printf '%.3u\n' "$x")" done pkg:patch -pkg:configure --disable-nls --with-installed-readline --disable-largefile bash_cv_dev_fd=absent bash_cv_sys_named_pipes=present bash_cv_job_control_missing=present bash_cv_func_sigsetjmp=present bash_cv_func_ctype_nonascii=no bash_cv_must_reinstall_sighandlers=no bash_cv_func_strcoll_broken=yes ac_cv_c_stack_direction=-1 ac_cv_func_mmap_fixed_mapped=yes gt_cv_int_divbyzero_sigfpe=no ac_cv_func_setvbuf_reversed=no ac_cv_func_strcoll_works=yes ac_cv_func_working_mktime=yes ac_cv_type_getgroups=gid_t bash_cv_dup2_broken=no ac_cv_prog_cc_g=no ac_cv_rl_version=6.0 +pkg:configure --disable-nls --with-installed-readline --disable-largefile bash_cv_dev_fd=absent bash_cv_sys_named_pipes=present bash_cv_job_control_missing=present bash_cv_func_sigsetjmp=present bash_cv_func_ctype_nonascii=no bash_cv_must_reinstall_sighandlers=no bash_cv_func_strcoll_broken=yes ac_cv_c_stack_direction=-1 ac_cv_func_mmap_fixed_mapped=yes gt_cv_int_divbyzero_sigfpe=no ac_cv_func_setvbuf_reversed=no ac_cv_func_strcoll_works=yes ac_cv_func_working_mktime=yes ac_cv_type_getgroups=gid_t bash_cv_dup2_broken=no ac_cv_prog_cc_g=no ac_cv_rl_version=6.0 ac_cv_sys_interpreter=no #pgrp_pipe... pkg:make diff --git a/data/bash/shebang.diff b/data/bash/shebang.diff new file mode 100644 index 000000000..c850d5c6d --- /dev/null +++ b/data/bash/shebang.diff @@ -0,0 +1,12 @@ +diff -ur bash/execute_cmd.c bash/execute_cmd.c +--- bash/execute_cmd.c 2018-01-29 10:13:20.000000000 -1000 ++++ bash/execute_cmd.c 2018-03-19 17:04:07.000000000 -1000 +@@ -5474,7 +5474,7 @@ + + /* If we get to this point, then start checking out the file. + Maybe it is something we can hack ourselves. */ +- if (i != ENOEXEC) ++ if (i != ENOEXEC && i != EPERM) // EPERM is the error on iOS11 when it can't execute a shebang + { + /* make sure this is set correctly for file_error/report_error */ + last_command_exit_value = (i == ENOENT) ? EX_NOTFOUND : EX_NOEXEC; /* XXX Posix.2 says that exit status is 126 */ |