Remove unneeded patches
This commit is contained in:
@@ -1,47 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-038
|
||||
|
||||
Bug-Reported-by: armandsl@gmail.com
|
||||
Bug-Reference-ID: <20120822112810.8D14920040@windmill.latviatours.lv>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-08/msg00049.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
If a backslash-newline (which is removed) with no other input is given as
|
||||
input to `read', the shell tries to dereference a null pointer and seg faults.
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/builtins/read.def 2012-03-11 17:52:44.000000000 -0400
|
||||
--- ./builtins/read.def 2012-08-22 11:53:09.000000000 -0400
|
||||
***************
|
||||
*** 792,796 ****
|
||||
#endif
|
||||
|
||||
! if (saw_escape)
|
||||
{
|
||||
t = dequote_string (input_string);
|
||||
--- 847,851 ----
|
||||
#endif
|
||||
|
||||
! if (saw_escape && input_string && *input_string)
|
||||
{
|
||||
t = dequote_string (input_string);
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 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_ */
|
||||
@@ -1,58 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-039
|
||||
|
||||
Bug-Reported-by: Dan Douglas <ormaaj@gmail.com>
|
||||
Bug-Reference-ID: <1498458.MpVlmOXDB7@smorgbox>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-09/msg00008.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
Under certain circumstances, bash attempts to expand variables in arithmetic
|
||||
expressions even when evaluation is being suppressed.
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/expr.c 2011-11-21 18:03:35.000000000 -0500
|
||||
--- ./expr.c 2012-09-09 16:31:18.000000000 -0400
|
||||
***************
|
||||
*** 1010,1013 ****
|
||||
--- 1073,1082 ----
|
||||
#endif
|
||||
|
||||
+ /*itrace("expr_streval: %s: noeval = %d", tok, noeval);*/
|
||||
+ /* If we are suppressing evaluation, just short-circuit here instead of
|
||||
+ going through the rest of the evaluator. */
|
||||
+ if (noeval)
|
||||
+ return (0);
|
||||
+
|
||||
/* [[[[[ */
|
||||
#if defined (ARRAY_VARS)
|
||||
***************
|
||||
*** 1183,1186 ****
|
||||
--- 1256,1263 ----
|
||||
|
||||
*cp = '\0';
|
||||
+ /* XXX - watch out for pointer aliasing issues here */
|
||||
+ if (curlval.tokstr && curlval.tokstr == tokstr)
|
||||
+ init_lvalue (&curlval);
|
||||
+
|
||||
FREE (tokstr);
|
||||
tokstr = savestring (tp);
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 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_ */
|
||||
@@ -1,56 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-040
|
||||
|
||||
Bug-Reported-by: Andrey Zaitsev <jstcdr@gmail.com>
|
||||
Bug-Reference-ID: <CAEZVQT5PJ1Mb_Zh8LT5qz8sv+-9Q6hGfQ5DU9ZxdJ+gV7xBUaQ@mail.gmail.com>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-04/msg00144.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
Output redirection applied to builtin commands missed I/O errors if
|
||||
they happened when the file descriptor was closed, rather than on write
|
||||
(e.g., like with an out-of-space error on a remote NFS file system).
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/redir.c 2011-01-02 16:00:31.000000000 -0500
|
||||
--- ./redir.c 2012-04-24 20:42:12.000000000 -0400
|
||||
***************
|
||||
*** 1092,1099 ****
|
||||
#if defined (BUFFERED_INPUT)
|
||||
check_bash_input (redirector);
|
||||
! close_buffered_fd (redirector);
|
||||
#else /* !BUFFERED_INPUT */
|
||||
! close (redirector);
|
||||
#endif /* !BUFFERED_INPUT */
|
||||
}
|
||||
break;
|
||||
--- 1092,1101 ----
|
||||
#if defined (BUFFERED_INPUT)
|
||||
check_bash_input (redirector);
|
||||
! r = close_buffered_fd (redirector);
|
||||
#else /* !BUFFERED_INPUT */
|
||||
! r = close (redirector);
|
||||
#endif /* !BUFFERED_INPUT */
|
||||
+ if (r < 0 && (flags & RX_INTERNAL) && (errno == EIO || errno == ENOSPC))
|
||||
+ REDIRECTION_ERROR (r, errno, -1);
|
||||
}
|
||||
break;
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 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_ */
|
||||
@@ -1,47 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-041
|
||||
|
||||
Bug-Reported-by: Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Bug-Reference-ID: <20121202205200.2134478e@opensuse.site>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-12/msg00008.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
Process substitution incorrectly inherited a flag that inhibited using the
|
||||
(local) temporary environment for variable lookups if it was providing
|
||||
the filename to a redirection. The intent the flag is to enforce the
|
||||
Posix command expansion ordering rules.
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/subst.c 2012-07-14 15:53:20.000000000 -0400
|
||||
--- ./subst.c 2012-12-02 22:26:54.000000000 -0500
|
||||
***************
|
||||
*** 5125,5128 ****
|
||||
--- 5129,5136 ----
|
||||
#endif /* HAVE_DEV_FD */
|
||||
|
||||
+ /* subshells shouldn't have this flag, which controls using the temporary
|
||||
+ environment for variable lookups. */
|
||||
+ expanding_redir = 0;
|
||||
+
|
||||
result = parse_and_execute (string, "process substitution", (SEVAL_NONINT|SEVAL_NOHIST));
|
||||
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 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_ */
|
||||
@@ -1,57 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-042
|
||||
|
||||
Bug-Reported-by: Adam Pippin <adam@gp-inc.ca>
|
||||
Bug-Reference-ID: <CAPYbNHr6ucZFOoWsRdUJj6KP3Ju0j1bkESa_cmb7iU+kZwdVpg@mail.gmail.com>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2012-11/msg00087.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
Compilation failed after specifying the `--enable-minimal-config' option to
|
||||
configure (more specifically, specifying `--disable-alias').
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/parse.y 2012-07-08 21:53:33.000000000 -0400
|
||||
--- ./parse.y 2012-10-14 20:20:34.000000000 -0400
|
||||
***************
|
||||
*** 2394,2397 ****
|
||||
--- 2392,2396 ----
|
||||
to consume the quoted newline and move to the next character in
|
||||
the expansion. */
|
||||
+ #if defined (ALIAS)
|
||||
if (expanding_alias () && shell_input_line[shell_input_line_index+1] == '\0')
|
||||
{
|
||||
***************
|
||||
*** 2404,2408 ****
|
||||
goto next_alias_char; /* and get next character */
|
||||
}
|
||||
! else
|
||||
goto restart_read;
|
||||
}
|
||||
--- 2403,2408 ----
|
||||
goto next_alias_char; /* and get next character */
|
||||
}
|
||||
! else
|
||||
! #endif
|
||||
goto restart_read;
|
||||
}
|
||||
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 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_ */
|
||||
@@ -1,65 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-043
|
||||
|
||||
Bug-Reported-by: konsolebox <konsolebox@gmail.com>
|
||||
Bug-Reference-ID: <CAJnmqwZuGKLgMsMwxRK4LL+2NN+HgvmKzrnode99QBGrcgX1Lw@mail.gmail.com>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-01/msg00138.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
When SIGCHLD is trapped, and a SIGCHLD trap handler runs when a pending
|
||||
`read -t' invocation times out and generates SIGALRM, bash can crash with
|
||||
a segmentation fault.
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/builtins/read.def 2012-10-31 21:22:51.000517000 -0400
|
||||
--- ./builtins/read.def 2013-01-25 10:28:16.000038000 -0500
|
||||
***************
|
||||
*** 386,393 ****
|
||||
/* 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;
|
||||
--- 386,403 ----
|
||||
/* 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 save input_string temporarily, run the unwind-
|
||||
! protects, then restore input_string so we can use it later. */
|
||||
!
|
||||
input_string[i] = '\0'; /* make sure it's terminated */
|
||||
+ if (i == 0)
|
||||
+ {
|
||||
+ t = (char *)xmalloc (1);
|
||||
+ t[0] = 0;
|
||||
+ }
|
||||
+ else
|
||||
+ t = savestring (input_string);
|
||||
+
|
||||
+ run_unwind_frame ("read_builtin");
|
||||
+ input_string = t;
|
||||
retval = 128+SIGALRM;
|
||||
goto assign_vars;
|
||||
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 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_ */
|
||||
@@ -1,70 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-044
|
||||
|
||||
Bug-Reported-by: "Dashing" <dashing@hushmail.com>
|
||||
Bug-Reference-ID: <20130211175049.D90786F446@smtp.hushmail.com>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-02/msg00030.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
When converting a multibyte string to a wide character string as part of
|
||||
pattern matching, bash does not handle the end of the string correctly,
|
||||
causing the search for the NUL to go beyond the end of the string and
|
||||
reference random memory. Depending on the contents of that memory, bash
|
||||
can produce errors or crash.
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/lib/glob/xmbsrtowcs.c 2012-07-08 21:53:19.000000000 -0400
|
||||
--- ./lib/glob/xmbsrtowcs.c 2013-02-12 12:00:39.000000000 -0500
|
||||
***************
|
||||
*** 217,220 ****
|
||||
--- 217,226 ----
|
||||
n = mbsnrtowcs(wsbuf+wcnum, &p, nms, wsbuf_size-wcnum, &state);
|
||||
|
||||
+ if (n == 0 && p == 0)
|
||||
+ {
|
||||
+ wsbuf[wcnum] = L'\0';
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
/* Compensate for taking single byte on wcs conversion failure above. */
|
||||
if (wcslength == 1 && (n == 0 || n == (size_t)-1))
|
||||
***************
|
||||
*** 222,226 ****
|
||||
state = tmp_state;
|
||||
p = tmp_p;
|
||||
! wsbuf[wcnum++] = *p++;
|
||||
}
|
||||
else
|
||||
--- 228,238 ----
|
||||
state = tmp_state;
|
||||
p = tmp_p;
|
||||
! wsbuf[wcnum] = *p;
|
||||
! if (*p == 0)
|
||||
! break;
|
||||
! else
|
||||
! {
|
||||
! wcnum++; p++;
|
||||
! }
|
||||
}
|
||||
else
|
||||
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 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_ */
|
||||
@@ -1,53 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-045
|
||||
|
||||
Bug-Reported-by: Stephane Chazelas <stephane.chazelas@gmail.com>
|
||||
Bug-Reference-ID: <20130218195539.GA9620@chaz.gmail.com>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-02/msg00080.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
The <&n- and >&n- redirections, which move one file descriptor to another,
|
||||
leave the file descriptor closed when applied to builtins or compound
|
||||
commands.
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/redir.c 2013-01-30 11:56:09.000000000 -0500
|
||||
--- ./redir.c 2013-02-19 09:38:36.000000000 -0500
|
||||
***************
|
||||
*** 1008,1011 ****
|
||||
--- 1008,1021 ----
|
||||
REDIRECTION_ERROR (r, errno, -1);
|
||||
}
|
||||
+ if ((flags & RX_UNDOABLE) && (ri == r_move_input || ri == r_move_output))
|
||||
+ {
|
||||
+ /* r_move_input and r_move_output add an additional close()
|
||||
+ that needs to be undone */
|
||||
+ if (fcntl (redirector, F_GETFD, 0) != -1)
|
||||
+ {
|
||||
+ r = add_undo_redirect (redir_fd, r_close_this, -1);
|
||||
+ REDIRECTION_ERROR (r, errno, -1);
|
||||
+ }
|
||||
+ }
|
||||
#if defined (BUFFERED_INPUT)
|
||||
check_bash_input (redirector);
|
||||
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 26,30 ****
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 44
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
--- 26,30 ----
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 45
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
@@ -1,55 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-046
|
||||
|
||||
Bug-Reported-by: "Theodoros V. Kalamatianos" <thkala@gmail.com>
|
||||
Bug-Reference-ID: <20140112011131.GE17667@infinity.metashade.com>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-01/msg00044.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
Bash-4.2 patch 32 introduced a problem with "$@" and arrays expanding empty
|
||||
positional parameters or array elements when using substring expansion,
|
||||
pattern substitution, or case modfication. The empty parameters or array
|
||||
elements are removed instead of expanding to empty strings ("").
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/subst.c 2012-12-31 11:52:56.000000000 -0500
|
||||
--- ./subst.c 2014-03-31 14:19:56.000000000 -0400
|
||||
***************
|
||||
*** 7243,7247 ****
|
||||
ret = alloc_word_desc ();
|
||||
ret->word = temp1;
|
||||
! if (temp1 && QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)))
|
||||
ret->flags |= W_QUOTED|W_HASQUOTEDNULL;
|
||||
return ret;
|
||||
--- 7243,7253 ----
|
||||
ret = alloc_word_desc ();
|
||||
ret->word = temp1;
|
||||
! /* We test quoted_dollar_atp because we want variants with double-quoted
|
||||
! "$@" to take a different code path. In fact, we make sure at the end
|
||||
! of expand_word_internal that we're only looking at these flags if
|
||||
! quoted_dollar_at == 0. */
|
||||
! if (temp1 &&
|
||||
! (quoted_dollar_atp == 0 || *quoted_dollar_atp == 0) &&
|
||||
! QUOTED_NULL (temp1) && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)))
|
||||
ret->flags |= W_QUOTED|W_HASQUOTEDNULL;
|
||||
return ret;
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 26,30 ****
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 45
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
--- 26,30 ----
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 46
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
@@ -1,49 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-047
|
||||
|
||||
Bug-Reported-by: Matthew Riley <mattdr@google.com>
|
||||
Bug-Reference-ID: <CA+NEdkwP3gw+gbcF5+xnR1pvcuzb1mDVzvmuJOpHRGHA9T7VFg@mail.gmail.com>
|
||||
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-03/msg00047.html
|
||||
|
||||
Bug-Description:
|
||||
|
||||
The function that shortens pathnames for $PS1 according to the value of
|
||||
$PROMPT_DIRTRIM uses memcpy on potentially-overlapping regions of memory,
|
||||
when it should use memmove. The result is garbled pathnames in prompt
|
||||
strings.
|
||||
|
||||
Patch (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2-patched/general.c 2010-12-12 15:06:27.000000000 -0500
|
||||
--- ./general.c 2014-01-30 16:46:15.000000000 -0500
|
||||
***************
|
||||
*** 767,771 ****
|
||||
|
||||
nlen = nend - ntail;
|
||||
! memcpy (nbeg, ntail, nlen);
|
||||
nbeg[nlen] = '\0';
|
||||
|
||||
--- 767,771 ----
|
||||
|
||||
nlen = nend - ntail;
|
||||
! memmove (nbeg, ntail, nlen);
|
||||
nbeg[nlen] = '\0';
|
||||
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 26,30 ****
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 46
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
--- 26,30 ----
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 47
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
@@ -1,104 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-048
|
||||
|
||||
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.2.47/builtins/common.h 2010-05-30 18:31:51.000000000 -0400
|
||||
--- ./builtins/common.h 2014-09-16 19:35:45.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.2.47/builtins/evalstring.c 2010-11-23 08:22:15.000000000 -0500
|
||||
--- ./builtins/evalstring.c 2014-09-16 19:35:45.000000000 -0400
|
||||
***************
|
||||
*** 262,265 ****
|
||||
--- 262,273 ----
|
||||
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");
|
||||
***************
|
||||
*** 322,325 ****
|
||||
--- 330,336 ----
|
||||
dispose_fd_bitmap (bitmap);
|
||||
discard_unwind_frame ("pe_dispose");
|
||||
+
|
||||
+ if (flags & SEVAL_ONECMD)
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
*** ../bash-4.2.47/variables.c 2011-03-01 16:15:20.000000000 -0500
|
||||
--- ./variables.c 2014-09-16 19:35:45.000000000 -0400
|
||||
***************
|
||||
*** 348,357 ****
|
||||
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))
|
||||
--- 348,355 ----
|
||||
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))
|
||||
***************
|
||||
*** 362,369 ****
|
||||
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)
|
||||
--- 360,363 ----
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 26,30 ****
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 47
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
--- 26,30 ----
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 48
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
@@ -1,43 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-049
|
||||
|
||||
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.2.48/parse.y 2012-12-31 11:52:57.000000000 -0500
|
||||
--- ./parse.y 2014-09-25 16:12:19.000000000 -0400
|
||||
***************
|
||||
*** 2851,2854 ****
|
||||
--- 2851,2856 ----
|
||||
word_desc_to_read = (WORD_DESC *)NULL;
|
||||
|
||||
+ eol_ungetc_lookahead = 0;
|
||||
+
|
||||
current_token = '\n'; /* XXX */
|
||||
last_read_token = '\n';
|
||||
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 26,30 ****
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 48
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
--- 26,30 ----
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 49
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
@@ -1,217 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-050
|
||||
|
||||
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 (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2.49/variables.c 2014-09-16 19:35:45.000000000 -0400
|
||||
--- ./variables.c 2014-09-27 20:54:00.000000000 -0400
|
||||
***************
|
||||
*** 80,83 ****
|
||||
--- 80,88 ----
|
||||
#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;
|
||||
|
||||
***************
|
||||
*** 269,273 ****
|
||||
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 *));
|
||||
--- 274,278 ----
|
||||
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 *));
|
||||
***************
|
||||
*** 339,357 ****
|
||||
/* 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));
|
||||
--- 344,373 ----
|
||||
/* 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));
|
||||
***************
|
||||
*** 359,363 ****
|
||||
}
|
||||
else
|
||||
! report_error (_("error importing function definition for `%s'"), name);
|
||||
}
|
||||
#if defined (ARRAY_VARS)
|
||||
--- 375,382 ----
|
||||
}
|
||||
else
|
||||
! report_error (_("error importing function definition for `%s'"), tname);
|
||||
!
|
||||
! /* Restore original suffix */
|
||||
! tname[namelen] = BASHFUNC_SUFFIX[0];
|
||||
}
|
||||
#if defined (ARRAY_VARS)
|
||||
***************
|
||||
*** 2538,2542 ****
|
||||
|
||||
INVALIDATE_EXPORTSTR (var);
|
||||
! var->exportstr = mk_env_string (name, value);
|
||||
|
||||
array_needs_making = 1;
|
||||
--- 2557,2561 ----
|
||||
|
||||
INVALIDATE_EXPORTSTR (var);
|
||||
! var->exportstr = mk_env_string (name, value, 0);
|
||||
|
||||
array_needs_making = 1;
|
||||
***************
|
||||
*** 3390,3408 ****
|
||||
|
||||
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);
|
||||
}
|
||||
--- 3409,3448 ----
|
||||
|
||||
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);
|
||||
}
|
||||
***************
|
||||
*** 3490,3494 ****
|
||||
using the cached exportstr... */
|
||||
list[list_index] = USE_EXPORTSTR ? savestring (value)
|
||||
! : mk_env_string (var->name, value);
|
||||
|
||||
if (USE_EXPORTSTR == 0)
|
||||
--- 3530,3534 ----
|
||||
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.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 26,30 ****
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 49
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
--- 26,30 ----
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 50
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
@@ -1,173 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-051
|
||||
|
||||
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 (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2.50/parse.y 2014-09-27 12:18:53.000000000 -0400
|
||||
--- ./parse.y 2014-09-30 19:24:19.000000000 -0400
|
||||
***************
|
||||
*** 168,171 ****
|
||||
--- 168,174 ----
|
||||
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));
|
||||
***************
|
||||
*** 265,269 ****
|
||||
/* 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;
|
||||
|
||||
--- 268,274 ----
|
||||
/* 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;
|
||||
|
||||
***************
|
||||
*** 307,311 ****
|
||||
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;
|
||||
|
||||
--- 312,316 ----
|
||||
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;
|
||||
|
||||
***************
|
||||
*** 520,524 ****
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_reading_until, redir, 0);
|
||||
! redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| NUMBER LESS_LESS WORD
|
||||
--- 525,529 ----
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_reading_until, redir, 0);
|
||||
! push_heredoc ($$);
|
||||
}
|
||||
| NUMBER LESS_LESS WORD
|
||||
***************
|
||||
*** 527,531 ****
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_reading_until, redir, 0);
|
||||
! redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| REDIR_WORD LESS_LESS WORD
|
||||
--- 532,536 ----
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_reading_until, redir, 0);
|
||||
! push_heredoc ($$);
|
||||
}
|
||||
| REDIR_WORD LESS_LESS WORD
|
||||
***************
|
||||
*** 534,538 ****
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
|
||||
! redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| LESS_LESS_MINUS WORD
|
||||
--- 539,543 ----
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
|
||||
! push_heredoc ($$);
|
||||
}
|
||||
| LESS_LESS_MINUS WORD
|
||||
***************
|
||||
*** 541,545 ****
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_deblank_reading_until, redir, 0);
|
||||
! redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| NUMBER LESS_LESS_MINUS WORD
|
||||
--- 546,550 ----
|
||||
redir.filename = $2;
|
||||
$$ = make_redirection (source, r_deblank_reading_until, redir, 0);
|
||||
! push_heredoc ($$);
|
||||
}
|
||||
| NUMBER LESS_LESS_MINUS WORD
|
||||
***************
|
||||
*** 548,552 ****
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_deblank_reading_until, redir, 0);
|
||||
! redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| REDIR_WORD LESS_LESS_MINUS WORD
|
||||
--- 553,557 ----
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_deblank_reading_until, redir, 0);
|
||||
! push_heredoc ($$);
|
||||
}
|
||||
| REDIR_WORD LESS_LESS_MINUS WORD
|
||||
***************
|
||||
*** 555,559 ****
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
|
||||
! redir_stack[need_here_doc++] = $$;
|
||||
}
|
||||
| LESS_LESS_LESS WORD
|
||||
--- 560,564 ----
|
||||
redir.filename = $3;
|
||||
$$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
|
||||
! push_heredoc ($$);
|
||||
}
|
||||
| LESS_LESS_LESS WORD
|
||||
***************
|
||||
*** 2534,2537 ****
|
||||
--- 2539,2557 ----
|
||||
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.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 26,30 ****
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 50
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
--- 26,30 ----
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 51
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
@@ -1,59 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-052
|
||||
|
||||
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.2.51/make_cmd.c 2009-09-11 17:26:12.000000000 -0400
|
||||
--- ./make_cmd.c 2014-10-02 11:26:58.000000000 -0400
|
||||
***************
|
||||
*** 690,693 ****
|
||||
--- 690,694 ----
|
||||
temp->redirector = source;
|
||||
temp->redirectee = dest_and_filename;
|
||||
+ temp->here_doc_eof = 0;
|
||||
temp->instruction = instruction;
|
||||
temp->flags = 0;
|
||||
*** ../bash-4.2.51/copy_cmd.c 2009-09-11 16:28:02.000000000 -0400
|
||||
--- ./copy_cmd.c 2014-10-02 11:26:58.000000000 -0400
|
||||
***************
|
||||
*** 127,131 ****
|
||||
case r_reading_until:
|
||||
case r_deblank_reading_until:
|
||||
! new_redirect->here_doc_eof = savestring (redirect->here_doc_eof);
|
||||
/*FALLTHROUGH*/
|
||||
case r_reading_string:
|
||||
--- 127,131 ----
|
||||
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.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 26,30 ****
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 51
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
--- 26,30 ----
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 52
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
@@ -1,132 +0,0 @@
|
||||
BASH PATCH REPORT
|
||||
=================
|
||||
|
||||
Bash-Release: 4.2
|
||||
Patch-ID: bash42-053
|
||||
|
||||
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 (apply with `patch -p0'):
|
||||
|
||||
*** ../bash-4.2.52/builtins/evalstring.c 2014-09-16 19:35:45.000000000 -0400
|
||||
--- ./builtins/evalstring.c 2014-10-04 15:00:26.000000000 -0400
|
||||
***************
|
||||
*** 262,271 ****
|
||||
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;
|
||||
}
|
||||
|
||||
--- 262,284 ----
|
||||
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;
|
||||
! }
|
||||
}
|
||||
|
||||
***************
|
||||
*** 332,336 ****
|
||||
|
||||
if (flags & SEVAL_ONECMD)
|
||||
! break;
|
||||
}
|
||||
}
|
||||
--- 345,352 ----
|
||||
|
||||
if (flags & SEVAL_ONECMD)
|
||||
! {
|
||||
! reset_parser ();
|
||||
! break;
|
||||
! }
|
||||
}
|
||||
}
|
||||
*** ../bash-4.2.52/parse.y 2014-09-30 19:24:19.000000000 -0400
|
||||
--- ./parse.y 2014-10-04 15:00:26.000000000 -0400
|
||||
***************
|
||||
*** 2436,2439 ****
|
||||
--- 2436,2449 ----
|
||||
}
|
||||
|
||||
+ 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. */
|
||||
***************
|
||||
*** 3891,3896 ****
|
||||
/* reset_parser clears shell_input_line and associated variables */
|
||||
restore_input_line_state (&ls);
|
||||
! if (interactive)
|
||||
! token_to_read = 0;
|
||||
|
||||
/* Need to find how many characters parse_and_execute consumed, update
|
||||
--- 3901,3906 ----
|
||||
/* reset_parser clears shell_input_line and associated variables */
|
||||
restore_input_line_state (&ls);
|
||||
!
|
||||
! token_to_read = 0;
|
||||
|
||||
/* Need to find how many characters parse_and_execute consumed, update
|
||||
*** ../bash-4.2.52/shell.h 2011-11-21 18:03:32.000000000 -0500
|
||||
--- ./shell.h 2014-10-04 15:00:26.000000000 -0400
|
||||
***************
|
||||
*** 178,181 ****
|
||||
--- 178,183 ----
|
||||
|
||||
/* 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.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
||||
--- ./patchlevel.h Thu Feb 24 21:41:34 2011
|
||||
***************
|
||||
*** 26,30 ****
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 52
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
--- 26,30 ----
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
! #define PATCHLEVEL 53
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
@@ -1,153 +0,0 @@
|
||||
Fix build breakage without openssl.
|
||||
From upstream: http://bk1.ntp.org/ntp-stable/?PAGE=patch&REV=5497b345z5MNTuNvJWuqPSje25NQTg
|
||||
|
||||
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
||||
|
||||
diff -Nura ntp-4.2.8.orig/configure.ac ntp-4.2.8/configure.ac
|
||||
--- ntp-4.2.8.orig/configure.ac 2014-12-22 10:16:10.449311393 -0300
|
||||
+++ ntp-4.2.8/configure.ac 2014-12-22 10:17:30.757215905 -0300
|
||||
@@ -102,7 +102,7 @@
|
||||
enable_nls=no
|
||||
LIBOPTS_CHECK_NOBUILD([sntp/libopts])
|
||||
|
||||
-NTP_ENABLE_LOCAL_LIBEVENT
|
||||
+NTP_LIBEVENT_CHECK_NOBUILD([2], [sntp/libevent])
|
||||
|
||||
NTP_LIBNTP
|
||||
|
||||
@@ -771,6 +771,10 @@
|
||||
|
||||
####
|
||||
|
||||
+AC_CHECK_FUNCS([arc4random_buf])
|
||||
+
|
||||
+####
|
||||
+
|
||||
saved_LIBS="$LIBS"
|
||||
LIBS="$LIBS $LDADD_LIBNTP"
|
||||
AC_CHECK_FUNCS([daemon])
|
||||
diff -Nura ntp-4.2.8.orig/libntp/ntp_crypto_rnd.c ntp-4.2.8/libntp/ntp_crypto_rnd.c
|
||||
--- ntp-4.2.8.orig/libntp/ntp_crypto_rnd.c 2014-12-22 10:16:10.430301237 -0300
|
||||
+++ ntp-4.2.8/libntp/ntp_crypto_rnd.c 2014-12-22 10:18:04.921468163 -0300
|
||||
@@ -24,6 +24,21 @@
|
||||
int crypto_rand_init = 0;
|
||||
#endif
|
||||
|
||||
+#ifndef HAVE_ARC4RANDOM_BUF
|
||||
+static void
|
||||
+arc4random_buf(void *buf, size_t nbytes);
|
||||
+
|
||||
+void
|
||||
+evutil_secure_rng_get_bytes(void *buf, size_t nbytes);
|
||||
+
|
||||
+static void
|
||||
+arc4random_buf(void *buf, size_t nbytes)
|
||||
+{
|
||||
+ evutil_secure_rng_get_bytes(buf, nbytes);
|
||||
+ return;
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* As of late 2014, here's how we plan to provide cryptographic-quality
|
||||
* random numbers:
|
||||
diff -Nura ntp-4.2.8.orig/Makefile.am ntp-4.2.8/Makefile.am
|
||||
--- ntp-4.2.8.orig/Makefile.am 2014-12-22 10:16:10.441307117 -0300
|
||||
+++ ntp-4.2.8/Makefile.am 2014-12-22 10:16:49.403122474 -0300
|
||||
@@ -3,6 +3,7 @@
|
||||
NULL =
|
||||
|
||||
SUBDIRS = \
|
||||
+ sntp \
|
||||
scripts \
|
||||
include \
|
||||
libntp \
|
||||
@@ -17,7 +18,6 @@
|
||||
clockstuff \
|
||||
kernel \
|
||||
util \
|
||||
- sntp \
|
||||
tests \
|
||||
$(NULL)
|
||||
|
||||
@@ -64,7 +64,6 @@
|
||||
.gcc-warning \
|
||||
libtool \
|
||||
html/.datecheck \
|
||||
- sntp/built-sources-only \
|
||||
$(srcdir)/COPYRIGHT \
|
||||
$(srcdir)/.checkChangeLog \
|
||||
$(NULL)
|
||||
diff -Nura ntp-4.2.8.orig/sntp/configure.ac ntp-4.2.8/sntp/configure.ac
|
||||
--- ntp-4.2.8.orig/sntp/configure.ac 2014-12-22 10:16:10.428300168 -0300
|
||||
+++ ntp-4.2.8/sntp/configure.ac 2014-12-22 10:24:11.238172928 -0300
|
||||
@@ -97,11 +97,14 @@
|
||||
enable_nls=no
|
||||
LIBOPTS_CHECK
|
||||
|
||||
-AM_COND_IF(
|
||||
- [BUILD_SNTP],
|
||||
- [NTP_LIBEVENT_CHECK],
|
||||
- [NTP_LIBEVENT_CHECK_NOBUILD]
|
||||
-)
|
||||
+# From when we only used libevent for sntp:
|
||||
+#AM_COND_IF(
|
||||
+# [BUILD_SNTP],
|
||||
+# [NTP_LIBEVENT_CHECK],
|
||||
+# [NTP_LIBEVENT_CHECK_NOBUILD]
|
||||
+#)
|
||||
+
|
||||
+NTP_LIBEVENT_CHECK([2])
|
||||
|
||||
# Checks for libraries.
|
||||
|
||||
diff -Nura ntp-4.2.8.orig/sntp/m4/ntp_libevent.m4 ntp-4.2.8/sntp/m4/ntp_libevent.m4
|
||||
--- ntp-4.2.8.orig/sntp/m4/ntp_libevent.m4 2014-12-22 10:16:10.417294288 -0300
|
||||
+++ ntp-4.2.8/sntp/m4/ntp_libevent.m4 2014-12-22 10:20:31.757915561 -0300
|
||||
@@ -1,4 +1,25 @@
|
||||
-dnl NTP_ENABLE_LOCAL_LIBEVENT -*- Autoconf -*-
|
||||
+# SYNOPSIS -*- Autoconf -*-
|
||||
+#
|
||||
+# NTP_ENABLE_LOCAL_LIBEVENT
|
||||
+# NTP_LIBEVENT_CHECK([MINVERSION [, DIR]])
|
||||
+# NTP_LIBEVENT_CHECK_NOBUILD([MINVERSION [, DIR]])
|
||||
+#
|
||||
+# DESCRIPTION
|
||||
+#
|
||||
+# AUTHOR
|
||||
+#
|
||||
+# Harlan Stenn
|
||||
+#
|
||||
+# LICENSE
|
||||
+#
|
||||
+# This file is Copyright (c) 2014 Network Time Foundation
|
||||
+#
|
||||
+# Copying and distribution of this file, with or without modification, are
|
||||
+# permitted in any medium without royalty provided the copyright notice,
|
||||
+# author attribution and this notice are preserved. This file is offered
|
||||
+# as-is, without any warranty.
|
||||
+
|
||||
+dnl NTP_ENABLE_LOCAL_LIBEVENT
|
||||
dnl
|
||||
dnl Provide only the --enable-local-libevent command-line option.
|
||||
dnl
|
||||
@@ -29,7 +50,7 @@
|
||||
dnl but DO NOT invoke DIR/configure if we are going to use our bundled
|
||||
dnl version. This may be the case for nested packages.
|
||||
dnl
|
||||
-dnl provide --enable-local-libevent .
|
||||
+dnl provides --enable-local-libevent .
|
||||
dnl
|
||||
dnl Examples:
|
||||
dnl
|
||||
diff -Nura ntp-4.2.8.orig/util/Makefile.am ntp-4.2.8/util/Makefile.am
|
||||
--- ntp-4.2.8.orig/util/Makefile.am 2014-12-22 10:16:10.435303910 -0300
|
||||
+++ ntp-4.2.8/util/Makefile.am 2014-12-22 10:21:02.500339706 -0300
|
||||
@@ -19,6 +19,7 @@
|
||||
LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM) $(PTHREAD_LIBS)
|
||||
tg2_LDADD= ../libntp/libntp.a $(LDADD_LIBNTP) $(LIBM)
|
||||
ntp_keygen_LDADD = version.o $(LIBOPTS_LDADD) ../libntp/libntp.a
|
||||
+ntp_keygen_LDADD += $(LDADD_LIBEVENT)
|
||||
ntp_keygen_LDADD += $(LDADD_LIBNTP) $(PTHREAD_LIBS) $(LDADD_NTP) $(LIBM)
|
||||
ntp_keygen_SOURCES = ntp-keygen.c ntp-keygen-opts.c ntp-keygen-opts.h
|
||||
|
||||
Reference in New Issue
Block a user