25123965 Update bash to version 4.4 s11u3-sru
authorVladimir Marek <Vladimir.Marek@oracle.com>
Thu, 26 Jan 2017 12:24:45 +0100
branchs11u3-sru
changeset 7627 4758b76d5ad5
parent 7623 d89b1c5817f5
child 7628 409696918882
25123965 Update bash to version 4.4 24689447 problem in UTILITY/BASH 21341453 process hangs when terminated with unfinished command 21196056 bash test is failing to finish 19394218 bash : Parameter Substitution Causing Memory Leak
components/bash/Makefile
components/bash/TESTING
components/bash/bash.license
components/bash/bash.p5m
components/bash/patches/bash41-001.patch
components/bash/patches/bash41-002.patch
components/bash/patches/bash41-003.patch
components/bash/patches/bash41-004.patch
components/bash/patches/bash41-005.patch
components/bash/patches/bash41-006.patch
components/bash/patches/bash41-007.patch
components/bash/patches/bash41-008.patch
components/bash/patches/bash41-009.patch
components/bash/patches/bash41-010.patch
components/bash/patches/bash41-011.patch
components/bash/patches/bash41-012.patch
components/bash/patches/bash41-013.patch
components/bash/patches/bash41-014.patch
components/bash/patches/bash41-015.patch
components/bash/patches/bash41-016.patch
components/bash/patches/bash41-017.patch
components/bash/patches/bash44-001.patch
components/bash/patches/bash44-002.patch
components/bash/patches/bash44-003.patch
components/bash/patches/bash44-004.patch
components/bash/patches/bash44-005.patch
components/bash/patches/solaris-000.config.h.in.patch
components/bash/patches/solaris-001.config-top.h.patch
components/bash/patches/solaris-002.Makefile.in.3.patch
components/bash/patches/solaris-003.glob.c.patch
components/bash/patches/solaris-004.snprintf.c.patch
components/bash/patches/solaris-005.variables.c.patch
components/bash/patches/solaris-006.signames.c.patch
components/bash/patches/solaris-007.rlprivate.h.patch
components/bash/patches/solaris-008.xmbsrtowcs.c.patch
components/bash/patches/solaris-009.configure.patch
components/bash/patches/solaris-010.input.c.patch
components/bash/patches/solaris-011.input_avail.c.patch
components/bash/patches/solaris-012.inputrc.location.patch
components/bash/patches/solaris-012.rlconf.h.patch
components/bash/patches/solaris-013.bashref.info.patch
components/bash/patches/solaris-014.bash.man.patch
components/bash/patches/solaris-015.rbash.man.patch
components/bash/patches/solaris-016.eaccess.c.patch
components/bash/patches/solaris-016.run-all.patch
components/bash/patches/solaris-017.bashhist.c.patch
components/bash/patches/solaris-018.posixexp2.tests.patch
components/bash/patches/solaris-022.bash.sighup.patch
components/bash/patches/solaris-023.eaccess.c.patch
components/bash/patches/solaris-025.false_exit_code.patch
components/bash/patches/solaris-026.cd_in_rcfile.patch
components/bash/patches/solaris-027.bad_file_number_text.patch
components/bash/patches/solaris-028.missing_HOME.patch
components/bash/patches/solaris-029.undef_SHELL.patch
components/bash/patches/solaris-030.SHOBJ_STATUS_install.patch
components/bash/patches/solaris-031.use_dynamic_temp_file.patch
--- a/components/bash/Makefile	Fri Jan 27 15:04:39 2017 -0800
+++ b/components/bash/Makefile	Thu Jan 26 12:24:45 2017 +0100
@@ -18,33 +18,40 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+
 #
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+#
+
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		bash
-COMPONENT_VERSION=	4.1
+COMPONENT_VERSION=	4.4
 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_PROJECT_URL=	http://www.gnu.org/software/bash/
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
-COMPONENT_ARCHIVE_HASH=	\
-    sha256:3f627124a83c6d34db503a923e20710d370573a29dd5d11d6f116d1aee7be1da
+COMPONENT_ARCHIVE_HASH = \
+    sha256:d86b3392c1202e8ff5a423b302e6284db7f8f435ea9f39b5b1b20fd3ac36dfcb
 COMPONENT_ARCHIVE_URL=	http://ftp.gnu.org/gnu/bash/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	utility/bash
 
-TPNO=			7265
+TPNO=			32706
 
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/configure.mk
 include $(WS_MAKE_RULES)/ips.mk
 
+# Avoid running configure again during the build due to patches to
+# configure-related files by running autoconf before we run configure.
+COMPONENT_PREP_ACTION += (cd $(@D); autoconf)
+
 BASH_PATCHLEVEL=$(shell grep -h "define PATCHLEVEL" $(COMPONENT_DIR)/patches/bash* | nawk '{print $$NF}' | sort -n | tail -1)
 IPS_COMPONENT_VERSION = $(COMPONENT_VERSION).$(BASH_PATCHLEVEL)
 PATCH_LEVEL = 0
 
 PKG_PROTO_DIRS += $(COMPONENT_DIR)/Solaris
 
-# Enable C99 mode + -Xc for it's additional warnings.
+# Enable C99 mode + -Xc for its additional warnings.
 studio_C99MODE = -Xc $(studio_C99_ENABLE)
 
 # Use the maximum number of registers on sparc since we have no libraries
@@ -52,6 +59,7 @@
 
 # 8 byte memory alignment + interpretation of non-alignment instead of SIGBUS
 studio_ALIGN.sparc.32 = -xmemalign=8i
+studio_ALIGN.sparc.64 = -xmemalign=16i
 
 # -xinline=%auto -- we like inlining where appropriate
 CFLAGS += -xinline=%auto
@@ -60,71 +68,84 @@
 CFLAGS += -xbuiltin=%none
 
 CFLAGS += $(XPG6MODE)
-CFLAGS += $(CPP_POSIX)
 CFLAGS += $(CPP_C99_EXTENDED_MATH)
+CFLAGS += -I$(USRINCDIR)/ncurses
 
 # configure checks for some functions, but doesn't seem to want to link in
 # the required libraries for them. We avoid linking with libthread.so.1
 # just because we pass -mt, by explicitly passing -lc.
-LIBS =	-lc -lsocket -lgen
+LIBS =	-lc -lgen
+ifeq ($(OS_VERSION),5.11)
+LIBS +=	-lsocket
+endif
 
 # -z redlocsym -- let's shrink the SHT_SYMTAB as much as we can
 LDFLAGS =	$(LD_Z_REDLOCSYM)
 
-# The bash test harness needs the GNU userland utilities
-TEST_PATH = "PATH=$(BUILD_DIR_64):$(GNUBIN):$(USRBINDIR)"
-TEST_OUTPUT = $(COMPONENT_DIR)/bash_test_results_$(MACH).out
-
-CONFIGURE_ENV +=	CFLAGS="$(CFLAGS)"
+# This avoids the need to patch configure or other files for these dependencies.
+ifeq ($(OS_VERSION), 5.11)
+CONFIGURE_ENV += LD_OPTIONS="-lc -lm -lgen -lsocket -lnsl -lresolv $(LD_Z_IGNORE)"
+else
+CONFIGURE_ENV += LD_OPTIONS="-lc -lm -lgen -lresolv $(LD_Z_IGNORE)"
+endif
 CONFIGURE_ENV +=	LDFLAGS="$(LDFLAGS)"
 CONFIGURE_ENV +=	LIBS="$(LIBS)"
 
-CONFIGURE_OPTIONS  +=		--localstatedir=/var
-CONFIGURE_OPTIONS  += 		--enable-alias
-CONFIGURE_OPTIONS  += 		--enable-arith-for-command
-CONFIGURE_OPTIONS  += 		--enable-array-variables
-CONFIGURE_OPTIONS  += 		--enable-bang-history	
-CONFIGURE_OPTIONS  += 		--enable-brace-expansion	
-CONFIGURE_OPTIONS  += 		--enable-casemod-attributes	
-CONFIGURE_OPTIONS  += 		--enable-casemod-expansions	
-CONFIGURE_OPTIONS  += 		--enable-command-timing	
-CONFIGURE_OPTIONS  += 		--enable-cond-command	
-CONFIGURE_OPTIONS  += 		--enable-cond-regexp	
-CONFIGURE_OPTIONS  += 		--enable-coprocesses	
-CONFIGURE_OPTIONS  += 		--enable-debugger	
-CONFIGURE_OPTIONS  += 		--enable-directory-stack	
-CONFIGURE_OPTIONS  += 		--enable-disabled-builtins	
-CONFIGURE_OPTIONS  += 		--enable-dparen-arithmetic	
-CONFIGURE_OPTIONS  += 		--enable-extended-glob	
-CONFIGURE_OPTIONS  += 		--enable-help-builtin	
-CONFIGURE_OPTIONS  += 		--enable-history	
-CONFIGURE_OPTIONS  += 		--enable-job-control	
-CONFIGURE_OPTIONS  += 		--enable-multibyte	
-CONFIGURE_OPTIONS  += 		--enable-net-redirections	
-CONFIGURE_OPTIONS  += 		--enable-process-substitution	
-CONFIGURE_OPTIONS  += 		--enable-progcomp	
-CONFIGURE_OPTIONS  += 		--enable-prompt-string-decoding	
-CONFIGURE_OPTIONS  += 		--enable-readline	
-CONFIGURE_OPTIONS  += 		--enable-restricted	
-CONFIGURE_OPTIONS  += 		--enable-select	
-CONFIGURE_OPTIONS  += 		--enable-separate-helpfiles	
-CONFIGURE_OPTIONS  += 		--enable-single-help-strings	
-CONFIGURE_OPTIONS  += 		--disable-strict-posix-default	
-CONFIGURE_OPTIONS  += 		--enable-usg-echo-default	
-CONFIGURE_OPTIONS  += 		--enable-xpg-echo-default	
-CONFIGURE_OPTIONS  += 		--enable-mem-scramble	
-CONFIGURE_OPTIONS  += 		--disable-profiling	
-CONFIGURE_OPTIONS  += 		--enable-static-link	
-CONFIGURE_OPTIONS  += 		--enable-largefile
-CONFIGURE_OPTIONS  += 		--enable-nls	
-CONFIGURE_OPTIONS  += 		--with-bash-malloc	
-CONFIGURE_OPTIONS  += 		--with-curses	
-CONFIGURE_OPTIONS  += 		--with-installed-readline=no	
-CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
+# Ignore tgetent() checks in configure and use libncurses on Solaris.
+CONFIGURE_ENV += ac_cv_func_tgetent=yes
+CONFIGURE_ENV += ac_cv_lib_termcap_tgetent=no
+CONFIGURE_ENV += ac_cv_lib_curses_tgetent=no
+CONFIGURE_ENV += ac_cv_lib_ncurses_tgetent=yes
+CONFIGURE_ENV += bash_cv_termcap_lib=libncurses
 
-TEST_ENV +=     -i
-TEST_ENV +=     $(TEST_PATH)
-TEST_ENV +=     $(TARGET_ENV)
+CONFIGURE_OPTIONS += --disable-profiling
+CONFIGURE_OPTIONS += --disable-strict-posix-default
+CONFIGURE_OPTIONS += --enable-alias
+CONFIGURE_OPTIONS += --enable-arith-for-command
+CONFIGURE_OPTIONS += --enable-array-variables
+CONFIGURE_OPTIONS += --enable-bang-history
+CONFIGURE_OPTIONS += --enable-brace-expansion
+CONFIGURE_OPTIONS += --enable-casemod-attributes
+CONFIGURE_OPTIONS += --enable-casemod-expansions
+CONFIGURE_OPTIONS += --enable-command-timing
+CONFIGURE_OPTIONS += --enable-cond-command
+CONFIGURE_OPTIONS += --enable-cond-regexp
+CONFIGURE_OPTIONS += --enable-coprocesses
+CONFIGURE_OPTIONS += --enable-debugger
+CONFIGURE_OPTIONS += --enable-directory-stack
+CONFIGURE_OPTIONS += --enable-disabled-builtins
+CONFIGURE_OPTIONS += --enable-dparen-arithmetic
+CONFIGURE_OPTIONS += --enable-extended-glob
+CONFIGURE_OPTIONS += --enable-help-builtin
+CONFIGURE_OPTIONS += --enable-history
+CONFIGURE_OPTIONS += --enable-job-control
+CONFIGURE_OPTIONS += --enable-largefile
+CONFIGURE_OPTIONS += --enable-mem-scramble
+CONFIGURE_OPTIONS += --enable-multibyte
+CONFIGURE_OPTIONS += --enable-net-redirections
+CONFIGURE_OPTIONS += --enable-nls
+CONFIGURE_OPTIONS += --enable-process-substitution
+CONFIGURE_OPTIONS += --enable-progcomp
+CONFIGURE_OPTIONS += --enable-prompt-string-decoding
+CONFIGURE_OPTIONS += --enable-readline
+CONFIGURE_OPTIONS += --enable-restricted
+CONFIGURE_OPTIONS += --enable-select
+CONFIGURE_OPTIONS += --enable-separate-helpfiles
+CONFIGURE_OPTIONS += --enable-single-help-strings
+CONFIGURE_OPTIONS += --enable-static-link
+CONFIGURE_OPTIONS += --enable-usg-echo-default=yes
+CONFIGURE_OPTIONS += --enable-xpg-echo-default=yes
+CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
+CONFIGURE_OPTIONS += --localstatedir=/var
+CONFIGURE_OPTIONS += --with-bash-malloc=yes
+CONFIGURE_OPTIONS += --with-curses
+CONFIGURE_OPTIONS += --with-installed-readline=no
+
+COMPONENT_TEST_DIR		= $(BUILD_DIR_64)
+COMPONENT_TEST_ENV		= - $(TEST_PATH)
+# The bash test harness needs the GNU userland utilities
+TEST_PATH	= "PATH=$(GNUBIN):$(USRBINDIR)"
+
 
 ASLR_MODE=$(ASLR_ENABLE)
 
@@ -139,6 +160,6 @@
 test: $(TEST_64)
 
 
-
+REQUIRED_PACKAGES += library/ncurses
 REQUIRED_PACKAGES += shell/ksh93
 REQUIRED_PACKAGES += system/library
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/TESTING	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,10 @@
+Bash test results are stored in test/*/test-64-results. They are then filtered
+by COMPONENT_TEST_TRANSFORMS to make the test produce stable/reproducible
+results. Unfortunatelly COMPONENT_TEST_TRANSFORMS remove any problems
+encountered too. This is not ideal and should be fixed. The problem is that
+bash tests are sensitive to environment they are executed in (your ~/.bash*
+files for example). It's not easy to tell that bash tests finished
+successfully, you have to read it through.
+
+To compare the results before and after a fix one has to store test-64-results
+file and compare it to the one generated after your change.
--- a/components/bash/bash.license	Fri Jan 27 15:04:39 2017 -0800
+++ b/components/bash/bash.license	Thu Jan 26 12:24:45 2017 +0100
@@ -1125,3 +1125,4 @@
 recommend releasing these examples in parallel under your choice of
 free software license, such as the GNU General Public License,
 to permit their use in free software.
+
--- a/components/bash/bash.p5m	Fri Jan 27 15:04:39 2017 -0800
+++ b/components/bash/bash.p5m	Thu Jan 26 12:24:45 2017 +0100
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
 #
 
 <transform file path=usr.*/man/.+ -> default mangler.man.stability volatile>
@@ -30,7 +30,7 @@
 set name=info.classification value=org.opensolaris.category.2008:System/Shells
 set name=info.source-url value=$(COMPONENT_ARCHIVE_URL)
 set name=info.upstream-url value=$(COMPONENT_PROJECT_URL)
-set name=org.opensolaris.arc-caseid value=PSARC/1999/555
+set name=org.opensolaris.arc-caseid value=PSARC/2000/488
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
 #
 dir  path=etc
@@ -51,6 +51,7 @@
 dir  path=usr/gnu
 dir  path=usr/gnu/bin
 link path=usr/gnu/bin/sh target=../../bin/bash
+#
 dir  path=usr/share
 dir  path=usr/share/bash
 file path=usr/share/bash/alias
@@ -129,6 +130,7 @@
 file path=usr/share/bash/variable_help
 file path=usr/share/bash/wait
 file path=usr/share/bash/while
+#
 dir  path=usr/share/info
 file path=usr/share/info/bash.info
 dir  path=usr/share/locale
@@ -144,13 +146,23 @@
 dir  path=usr/share/locale/cs
 dir  path=usr/share/locale/cs/LC_MESSAGES
 file path=usr/share/locale/cs/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/da
+dir  path=usr/share/locale/da/LC_MESSAGES
+file path=usr/share/locale/da/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/de
 dir  path=usr/share/locale/de/LC_MESSAGES
 file path=usr/share/locale/de/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/el
+dir  path=usr/share/locale/el/LC_MESSAGES
+file path=usr/share/locale/el/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/en
 dir  path=usr/share/locale/en/LC_MESSAGES
 file path=usr/share/locale/en/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/[email protected]
+dir  path=usr/share/locale/[email protected]/LC_MESSAGES
 file path=usr/share/locale/[email protected]/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/[email protected]
+dir  path=usr/share/locale/[email protected]/LC_MESSAGES
 file path=usr/share/locale/[email protected]/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/en_CA
 dir  path=usr/share/locale/en_CA/LC_MESSAGES
@@ -167,21 +179,39 @@
 dir  path=usr/share/locale/et
 dir  path=usr/share/locale/et/LC_MESSAGES
 file path=usr/share/locale/et/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/fi
+dir  path=usr/share/locale/fi/LC_MESSAGES
+file path=usr/share/locale/fi/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/fr
 dir  path=usr/share/locale/fr/LC_MESSAGES
 file path=usr/share/locale/fr/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/ga
+dir  path=usr/share/locale/ga/LC_MESSAGES
+file path=usr/share/locale/ga/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/gl
+dir  path=usr/share/locale/gl/LC_MESSAGES
+file path=usr/share/locale/gl/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/hr
+dir  path=usr/share/locale/hr/LC_MESSAGES
+file path=usr/share/locale/hr/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/hu
 dir  path=usr/share/locale/hu/LC_MESSAGES
 file path=usr/share/locale/hu/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/id
 dir  path=usr/share/locale/id/LC_MESSAGES
 file path=usr/share/locale/id/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/it
+dir  path=usr/share/locale/it/LC_MESSAGES
+file path=usr/share/locale/it/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/ja
 dir  path=usr/share/locale/ja/LC_MESSAGES
 file path=usr/share/locale/ja/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/lt
 dir  path=usr/share/locale/lt/LC_MESSAGES
 file path=usr/share/locale/lt/LC_MESSAGES/bash.mo
+dir path=usr/share/locale/nb
+dir path=usr/share/locale/nb/LC_MESSAGES
+file path=usr/share/locale/nb/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/nl
 dir  path=usr/share/locale/nl/LC_MESSAGES
 file path=usr/share/locale/nl/LC_MESSAGES/bash.mo
@@ -200,26 +230,42 @@
 dir  path=usr/share/locale/sk
 dir  path=usr/share/locale/sk/LC_MESSAGES
 file path=usr/share/locale/sk/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/sl
+dir  path=usr/share/locale/sl/LC_MESSAGES
+file path=usr/share/locale/sl/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/sr
+dir  path=usr/share/locale/sr/LC_MESSAGES
+file path=usr/share/locale/sr/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/sv
 dir  path=usr/share/locale/sv/LC_MESSAGES
 file path=usr/share/locale/sv/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/tr
 dir  path=usr/share/locale/tr/LC_MESSAGES
 file path=usr/share/locale/tr/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/uk
+dir  path=usr/share/locale/uk/LC_MESSAGES
+file path=usr/share/locale/uk/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/vi
 dir  path=usr/share/locale/vi/LC_MESSAGES
 file path=usr/share/locale/vi/LC_MESSAGES/bash.mo
+dir  path=usr/share/locale/zh_CN
+dir  path=usr/share/locale/zh_CN/LC_MESSAGES
+file path=usr/share/locale/zh_CN/LC_MESSAGES/bash.mo
 dir  path=usr/share/locale/zh_TW
 dir  path=usr/share/locale/zh_TW/LC_MESSAGES
 file path=usr/share/locale/zh_TW/LC_MESSAGES/bash.mo
+#
 dir  path=usr/share/man
 dir  path=usr/share/man/man1
 file path=usr/share/man/man1/bash.1
 file path=usr/share/man/man1/bashbug.1
 file rbash.1 path=usr/share/man/man1/rbash.1
 #
-legacy pkg=SUNWbash desc="GNU Bourne-Again shell (bash)" \
+legacy pkg=SUNWbash desc="GNU Bourne-Again shell (bash) version 4.2" \
     name="GNU Bourne-Again shell (bash)"
+legacy pkg=SUNWbashr \
+    desc="GNU Bourne-Again shell (bash) version 4.2  (root package)" \
+    name="GNU Bourne-Again shell (bash) (root)"
 #
 license bash.license license="GPLv3, FDLv1.3"
 
--- a/components/bash/patches/bash41-001.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-001
-
-Bug-Reported-by:	Yann Rouillard <[email protected]>
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-01/msg00018.html
-
-Bug-Description:
-
-A prototype for vsnprintf was incorrect, and caused compilation failures
-on systems that did not have a suitable vsnprintf, but had a declaration in
-one of the system header files.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/builtins/printf.def	2009-11-20 15:31:23.000000000 -0500
---- builtins/printf.def	2010-01-07 08:50:06.000000000 -0500
-***************
-*** 173,177 ****
-  
-  #if !HAVE_VSNPRINTF
-! extern int vsnprintf __P((char *, size_t, const char *, ...)) __attribute__((__format__ (printf, 3, 4)));
-  #endif
-  
---- 173,177 ----
-  
-  #if !HAVE_VSNPRINTF
-! extern int vsnprintf __P((char *, size_t, const char *, va_list)) __attribute__((__format__ (printf, 3, 0)));
-  #endif
-  
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-002.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-002
-
-Bug-Reported-by:	[email protected]
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-01/msg00017.html
-
-Bug-Description:
-
-Bash-4.1/Readline-6.1 introduced a hook function that allows applications
-to rewrite or modify filenames read from the file system before comparing
-them with a word to be completed.  The converted filename, if it matches,
-needs to be inserted into the line buffer, replacing the original contents.
-
-This fixes a completion bug on Mac OS X involving filenames containing
-UTF-8 characters.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/lib/readline/complete.c	2009-11-29 18:39:30.000000000 -0500
---- lib/readline/complete.c	2010-01-06 08:30:23.000000000 -0500
-***************
-*** 2139,2143 ****
-        if (filename_len == 0)
-  	{
-! 	  if (_rl_match_hidden_files == 0 && HIDDEN_FILE (entry->d_name))
-  	    continue;
-  
---- 2139,2143 ----
-        if (filename_len == 0)
-  	{
-! 	  if (_rl_match_hidden_files == 0 && HIDDEN_FILE (convfn))
-  	    continue;
-  
-***************
-*** 2220,2224 ****
-  	    }
-  
-! 	  strcpy (temp + dirlen, entry->d_name);
-  	}
-        else
---- 2220,2224 ----
-  	    }
-  
-! 	  strcpy (temp + dirlen, convfn);
-  	}
-        else
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-003.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-003
-
-Bug-Reported-by:	[email protected]
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-01/msg00135.html
-
-Bug-Description:
-
-If command completion is attempted on a word with a quoted globbing
-character (e.g., `*' or `?'), bash can reference a NULL pointer and
-dump core.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/bashline.c	2009-10-24 14:10:19.000000000 -0400
---- bashline.c	2010-01-30 21:53:49.000000000 -0500
-***************
-*** 1681,1685 ****
-       characters in the common prefix are bad) will ever be returned on
-       regular completion. */
-!   if (glob_pattern_p (hint))
-      {
-        if (state == 0)
---- 1681,1685 ----
-       characters in the common prefix are bad) will ever be returned on
-       regular completion. */
-!   if (globpat)
-      {
-        if (state == 0)
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-004.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-004
-
-Bug-Reported-by:	Crestez Dan Leonard <[email protected]>
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-02/msg00034.html
-
-Bug-Description:
-
-When running in Posix mode and executing a shell function without local
-variables, bash will not propagate a variable in a special builtin's temporary
-environment to have global scope.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/variables.c	2009-11-03 14:13:58.000000000 -0500
---- variables.c	2010-02-08 17:36:18.000000000 -0500
-***************
-*** 3809,3812 ****
---- 3809,3817 ----
-    if (tempvar_p (var) && (posixly_correct || (var->attributes & att_propagate)))
-      {
-+       /* Make sure we have a hash table to store the variable in while it is
-+ 	 being propagated down to the global variables table.  Create one if
-+ 	 we have to */
-+       if ((vc_isfuncenv (shell_variables) || vc_istempenv (shell_variables)) && shell_variables->table == 0)
-+ 	shell_variables->table = hash_create (0);
-        /* XXX - should we set v->context here? */
-        v = bind_variable_internal (var->name, value_cell (var), shell_variables->table, 0, 0);
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-005.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-005
-
-Bug-Reported-by:	[email protected]
-Bug-Reference-ID:	<[email protected]>
-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.1-patched/builtins/read.def	2009-10-08 11:35:46.000000000 -0400
---- builtins/read.def	2010-03-17 17:35:39.000000000 -0400
-***************
-*** 616,621 ****
-      zsyncfd (fd);
-  
--   interrupt_immediately--;
--   terminate_immediately--;
-    discard_unwind_frame ("read_builtin");
-  
---- 616,619 ----
-***************
-*** 624,627 ****
---- 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.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-006.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-006
-
-Bug-Reported-by:	Mike Frysinger <[email protected]>
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00063.html
-
-Bug-Description:
-
-Bash did not correctly print/reproduce here documents attached to commands
-inside compound commands such as for and while.  This affected the
-execution of such commands inside a shell function when the function
-definition is saved and later restored using `.' or `eval'.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/print_cmd.c	2009-09-16 15:32:26.000000000 -0400
---- print_cmd.c	2010-03-22 21:15:30.000000000 -0400
-***************
-*** 114,117 ****
---- 114,123 ----
-  #define CHECK_XTRACE_FP	xtrace_fp = (xtrace_fp ? xtrace_fp : stderr)
-  
-+ #define PRINT_DEFERRED_HEREDOCS(x) \
-+   do { \
-+     if (deferred_heredocs) \
-+       print_deferred_heredocs (x); \
-+   } while (0)
-+ 
-  /* Non-zero means the stuff being printed is inside of a function def. */
-  static int inside_function_def;
-***************
-*** 561,571 ****
-  {
-    print_for_command_head (for_command);
-- 
-    cprintf (";");
-    newline ("do\n");
-    indentation += indentation_amount;
-    make_command_string_internal (for_command->action);
-    semicolon ();
-    indentation -= indentation_amount;
-    newline ("done");
-  }
---- 566,578 ----
-  {
-    print_for_command_head (for_command);
-    cprintf (";");
-    newline ("do\n");
-+ 
-    indentation += indentation_amount;
-    make_command_string_internal (for_command->action);
-+   PRINT_DEFERRED_HEREDOCS ("");
-    semicolon ();
-    indentation -= indentation_amount;
-+ 
-    newline ("done");
-  }
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-007.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-007
-
-Bug-Reported-by:	Rob Robason <[email protected]>
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00089.html
-
-Bug-Description:
-
-A typo caused bash to not honor a precision specification in a printf
-format.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/builtins/printf.def	2010-01-18 10:50:22.000000000 -0500
---- builtins/printf.def	2010-03-25 09:40:56.000000000 -0400
-***************
-*** 118,122 ****
-        nw = vflag ? vbprintf (f, fieldwidth, func) : printf (f, fieldwidth, func); \
-      else if (have_precision) \
-!       nw = vflag ? vbprintf (f, precision, func) : printf (f, fieldwidth, func); \
-      else \
-        nw = vflag ? vbprintf (f, func) : printf (f, func); \
---- 118,122 ----
-        nw = vflag ? vbprintf (f, fieldwidth, func) : printf (f, fieldwidth, func); \
-      else if (have_precision) \
-!       nw = vflag ? vbprintf (f, precision, func) : printf (f, precision, func); \
-      else \
-        nw = vflag ? vbprintf (f, func) : printf (f, func); \
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-008.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-008
-
-Bug-Reported-by:	Dennis van Dok <[email protected]>
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-04/msg00038.html
-
-Bug-Description:
-
-When declaring an associative array and implicitly assigning a value
-to element "0", bash does not correctly allocate memory, leading to
-a segmentation violation when that element or the array itself is
-unset.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/builtins/declare.def	2009-11-25 19:42:00.000000000 -0500
---- builtins/declare.def	2010-05-30 18:25:21.000000000 -0400
-***************
-*** 513,517 ****
-  	      /* let bind_{array,assoc}_variable take care of this. */
-  	      if (assoc_p (var))
-! 		bind_assoc_variable (var, name, "0", value, aflags);
-  	      else
-  		bind_array_variable (name, 0, value, aflags);
---- 519,523 ----
-  	      /* let bind_{array,assoc}_variable take care of this. */
-  	      if (assoc_p (var))
-! 		bind_assoc_variable (var, name, savestring ("0"), value, aflags);
-  	      else
-  		bind_array_variable (name, 0, value, aflags);
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-009.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-009
-
-Bug-Reported-by:	Tomas Trnka <[email protected]>
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-03/msg00090.html
-
-Bug-Description:
-
-An arriving SIGCHLD will interrupt `slow' system calls such as write(2) to
-or read(2) from a terminal.  This results in an error message and truncated
-input or output.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/sig.c	Fri Aug 14 16:31:52 2009
---- sig.c	Fri Mar 26 22:34:11 2010
-***************
-*** 655,660 ****
---- 655,663 ----
-      act.sa_flags |= SA_INTERRUPT;	/* XXX */
-    else
-      act.sa_flags |= SA_RESTART;		/* XXX */
-+ #else
-+   if (sig == SIGCHLD)
-+     act.sa_flags |= SA_RESTART;
-  #endif
-    sigemptyset (&act.sa_mask);
-    sigemptyset (&oact.sa_mask);
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
-
--- a/components/bash/patches/bash41-010.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-010
-
-Bug-Reported-by:	Stephane Jourdois <[email protected]>
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2010-05/msg00165.html
-
-Bug-Description:
-
-The expansion of the \W prompt string escape sequence incorrectly used
-strcpy to copy overlapping strings.  Only memmove works in this case.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/parse.y	2009-12-30 12:51:42.000000000 -0500
---- parse.y	2011-02-24 16:40:48.000000000 -0500
-***************
-*** 5153,5157 ****
-  			t = strrchr (t_string, '/');
-  			if (t)
-! 			  strcpy (t_string, t + 1);
-  		      }
-  		  }
---- 5153,5157 ----
-  			t = strrchr (t_string, '/');
-  			if (t)
-! 			  memmove (t_string, t + 1, strlen (t));
-  		      }
-  		  }
-*** ../bash-4.1-patched/y.tab.c	2009-12-30 12:52:02.000000000 -0500
---- y.tab.c	2011-02-24 16:50:27.000000000 -0500
-***************
-*** 7482,7486 ****
-  			t = strrchr (t_string, '/');
-  			if (t)
-! 			  strcpy (t_string, t + 1);
-  		      }
-  		  }
---- 7482,7486 ----
-  			t = strrchr (t_string, '/');
-  			if (t)
-! 			  memmove (t_string, t + 1, strlen (t));
-  		      }
-  		  }
-***************
-*** 8244,8246 ****
-  }
-  #endif /* HANDLE_MULTIBYTE */
-- 
---- 8244,8245 ----
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-011.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-011
-
-Bug-Reported-by:	<[email protected]>
-Bug-Reference-ID:	<[email protected]>
-Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2011-04/msg00075.html
-
-Bug-Description:
-
-Under certain circumstances, running `fc -l' two times in succession with a
-relative history offset at the end of the history will result in an incorrect
-calculation of the last history entry and a seg fault.
-
-Patch (apply with `patch -p0'):
-
-*** ../bash-4.1-patched/builtins/fc.def	2009-03-21 14:03:43.000000000 -0400
---- builtins/fc.def	2011-04-19 15:46:17.000000000 -0400
-***************
-*** 304,307 ****
---- 304,317 ----
-    last_hist = i - rh - hist_last_line_added;
-  
-+   /* XXX */
-+   if (i == last_hist && hlist[last_hist] == 0)
-+     while (last_hist >= 0 && hlist[last_hist] == 0)
-+       last_hist--;
-+   if (last_hist < 0)
-+     {
-+       sh_erange ((char *)NULL, _("history specification"));
-+       return (EXECUTION_FAILURE);
-+     }
-+ 
-    if (list)
-      {
-***************
-*** 466,470 ****
-  {
-    int sign, n, clen, rh;
-!   register int i, j;
-    register char *s;
-  
---- 476,480 ----
-  {
-    int sign, n, clen, rh;
-!   register int i, j, last_hist;
-    register char *s;
-  
-***************
-*** 486,490 ****
-       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. */
---- 496,508 ----
-       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 (i == last_hist && hlist[last_hist] == 0)
-!     while (last_hist >= 0 && hlist[last_hist] == 0)
-!       last_hist--;
-!   if (last_hist < 0)
-!     return (-1);
-! 
-!   i = last_hist;
-  
-    /* No specification defaults to most recent command. */
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-012.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-012
-
-Bug-Reported-by:	Stephane Chazelas <[email protected]>
-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.1.11/builtins/common.h	2009-12-22 16:30:42.000000000 -0500
---- builtins/common.h	2014-09-16 19:27:38.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.1.11/builtins/evalstring.c	2009-10-17 21:18:50.000000000 -0400
---- builtins/evalstring.c	2014-09-16 19:27:38.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.1.11/variables.c	2010-03-26 12:15:39.000000000 -0400
---- variables.c	2014-09-16 19:27:38.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.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-013.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-013
-
-Bug-Reported-by:	Tavis Ormandy <[email protected]>
-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.1.12/parse.y	2011-02-24 19:41:01.000000000 -0500
---- parse.y	2014-09-25 16:13:57.000000000 -0400
-***************
-*** 2812,2815 ****
---- 2812,2817 ----
-    word_desc_to_read = (WORD_DESC *)NULL;
-  
-+   eol_ungetc_lookahead = 0;
-+ 
-    current_token = '\n';		/* XXX */
-    last_read_token = '\n';
-*** ../bash-4.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-014.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-014
-
-Bug-Reported-by:	Florian Weimer <[email protected]>
-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.1.13/variables.c	2014-09-16 19:27:38.000000000 -0400
---- variables.c	2014-09-27 20:57:46.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)
-***************
-*** 2520,2524 ****
-  
-    INVALIDATE_EXPORTSTR (var);
-!   var->exportstr = mk_env_string (name, value);
-  
-    array_needs_making = 1;
---- 2539,2543 ----
-  
-    INVALIDATE_EXPORTSTR (var);
-!   var->exportstr = mk_env_string (name, value, 0);
-  
-    array_needs_making = 1;
-***************
-*** 3339,3357 ****
-  
-  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);
-  }
---- 3358,3397 ----
-  
-  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);
-  }
-***************
-*** 3439,3443 ****
-  	     using the cached exportstr... */
-  	  list[list_index] = USE_EXPORTSTR ? savestring (value)
-! 					   : mk_env_string (var->name, value);
-  
-  	  if (USE_EXPORTSTR == 0)
---- 3479,3483 ----
-  	     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.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-015.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-015
-
-Bug-Reported-by:	Florian Weimer <[email protected]>
-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.1.14/parse.y	2014-09-27 12:18:25.000000000 -0400
---- parse.y	2014-09-30 19:36:03.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));
-***************
-*** 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;
-  
-***************
-*** 304,308 ****
-     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;
-  
---- 309,313 ----
-     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;
-  
-***************
-*** 517,521 ****
-  			  redir.filename = $2;
-  			  $$ = make_redirection (source, r_reading_until, redir, 0);
-! 			  redir_stack[need_here_doc++] = $$;
-  			}
-  	|	NUMBER LESS_LESS WORD
---- 522,526 ----
-  			  redir.filename = $2;
-  			  $$ = make_redirection (source, r_reading_until, redir, 0);
-! 			  push_heredoc ($$);
-  			}
-  	|	NUMBER LESS_LESS WORD
-***************
-*** 524,528 ****
-  			  redir.filename = $3;
-  			  $$ = make_redirection (source, r_reading_until, redir, 0);
-! 			  redir_stack[need_here_doc++] = $$;
-  			}
-  	|	REDIR_WORD LESS_LESS WORD
---- 529,533 ----
-  			  redir.filename = $3;
-  			  $$ = make_redirection (source, r_reading_until, redir, 0);
-! 			  push_heredoc ($$);
-  			}
-  	|	REDIR_WORD LESS_LESS WORD
-***************
-*** 531,535 ****
-  			  redir.filename = $3;
-  			  $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
-! 			  redir_stack[need_here_doc++] = $$;
-  			}
-  	|	LESS_LESS_MINUS WORD
---- 536,540 ----
-  			  redir.filename = $3;
-  			  $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN);
-! 			  push_heredoc ($$);
-  			}
-  	|	LESS_LESS_MINUS WORD
-***************
-*** 538,542 ****
-  			  redir.filename = $2;
-  			  $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
-! 			  redir_stack[need_here_doc++] = $$;
-  			}
-  	|	NUMBER LESS_LESS_MINUS WORD
---- 543,547 ----
-  			  redir.filename = $2;
-  			  $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
-! 			  push_heredoc ($$);
-  			}
-  	|	NUMBER LESS_LESS_MINUS WORD
-***************
-*** 545,549 ****
-  			  redir.filename = $3;
-  			  $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
-! 			  redir_stack[need_here_doc++] = $$;
-  			}
-  	|	REDIR_WORD  LESS_LESS_MINUS WORD
---- 550,554 ----
-  			  redir.filename = $3;
-  			  $$ = make_redirection (source, r_deblank_reading_until, redir, 0);
-! 			  push_heredoc ($$);
-  			}
-  	|	REDIR_WORD  LESS_LESS_MINUS WORD
-***************
-*** 552,556 ****
-  			  redir.filename = $3;
-  			  $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
-! 			  redir_stack[need_here_doc++] = $$;
-  			}
-  	|	LESS_LESS_LESS WORD
---- 557,561 ----
-  			  redir.filename = $3;
-  			  $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN);
-! 			  push_heredoc ($$);
-  			}
-  	|	LESS_LESS_LESS WORD
-***************
-*** 2508,2511 ****
---- 2513,2531 ----
-  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.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-016.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-016
-
-Bug-Reported-by:	Michal Zalewski <[email protected]>
-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.1.15/make_cmd.c	2009-09-11 17:26:12.000000000 -0400
---- make_cmd.c	2014-10-02 11:29:35.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.1.15/copy_cmd.c	2009-09-11 16:28:02.000000000 -0400
---- copy_cmd.c	2014-10-02 11:29:35.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.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- a/components/bash/patches/bash41-017.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-			     BASH PATCH REPORT
-			     =================
-
-Bash-Release:	4.1
-Patch-ID:	bash41-017
-
-Bug-Reported-by:	Michal Zalewski <[email protected]>
-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.1.16/builtins/evalstring.c	2014-09-16 19:27:38.000000000 -0400
---- builtins/evalstring.c	2014-10-04 15:08: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.1.16/parse.y	2014-09-30 19:36:03.000000000 -0400
---- parse.y	2014-10-04 15:08:26.000000000 -0400
-***************
-*** 2410,2413 ****
---- 2410,2423 ----
-  }
-  
-+ 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. */
-***************
-*** 3809,3814 ****
-    restore_parser_state (&ps);
-    reset_parser ();
-!   if (interactive)
-!     token_to_read = 0;
-  
-    /* Need to find how many characters parse_and_execute consumed, update
---- 3819,3824 ----
-    restore_parser_state (&ps);
-    reset_parser ();
-! 
-!   token_to_read = 0;
-  
-    /* Need to find how many characters parse_and_execute consumed, update
-*** ../bash-4.1.16/shell.h	2009-08-14 16:32:52.000000000 -0400
---- shell.h	2014-10-04 15:08:26.000000000 -0400
-***************
-*** 164,167 ****
---- 164,169 ----
-  
-  /* 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.1-patched/patchlevel.h	2009-10-01 16:39:22.000000000 -0400
---- patchlevel.h	2010-01-14 09:38:08.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_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash44-001.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,60 @@
+			     BASH PATCH REPORT
+			     =================
+
+Bash-Release:	4.4
+Patch-ID:	bash44-001
+
+Bug-Reported-by:	Sean Zha <[email protected]>
+Bug-Reference-ID:	<[email protected]gelabs.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_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash44-002.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,69 @@
+			     BASH PATCH REPORT
+			     =================
+
+Bash-Release:	4.4
+Patch-ID:	bash44-002
+
+Bug-Reported-by:	Eric Pruitt <[email protected]>
+Bug-Reference-ID:	<[email protected]>
+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_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash44-003.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,58 @@
+			     BASH PATCH REPORT
+			     =================
+
+Bash-Release:	4.4
+Patch-ID:	bash44-003
+
+Bug-Reported-by:	op7ic \x00 <[email protected]>
+Bug-Reference-ID:	<[email protected]om>
+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_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash44-004.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,84 @@
+			     BASH PATCH REPORT
+			     =================
+
+Bash-Release:	4.4
+Patch-ID:	bash44-004
+
+Bug-Reported-by:	Christian Weisgerber <[email protected]>
+Bug-Reference-ID:	<[email protected]>
+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_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/bash44-005.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,47 @@
+			     BASH PATCH REPORT
+			     =================
+
+Bash-Release:	4.4
+Patch-ID:	bash44-005
+
+Bug-Reported-by:	Dr. Werner Fink <[email protected]>
+Bug-Reference-ID:	<[email protected]>
+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_ */
--- a/components/bash/patches/solaris-000.config.h.in.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- config.h.in	2009-08-18 20:34:36.000000000 -0700
-+++ config.h.in	2010-09-01 10:21:00.756734104 -0700
[email protected]@ -21,6 +21,8 @@
- #ifndef _CONFIG_H_
- #define _CONFIG_H_
- 
-+#include "config-top.h"
-+
- /* Configuration feature settings controllable by autoconf. */
- 
- /* Define JOB_CONTROL if your operating system supports
--- a/components/bash/patches/solaris-001.config-top.h.patch	Fri Jan 27 15:04:39 2017 -0800
+++ b/components/bash/patches/solaris-001.config-top.h.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -1,10 +1,15 @@
---- config-top.h	2009-12-22 12:29:39.000000000 -0800
-+++ config-top.h	2010-09-01 10:24:03.070928602 -0700
[email protected]@ -54,14 +54,14 @@
+# Define defaults for Solaris.
+# Solaris-specific patch.
+#
+# Not for upstream.
+
+--- config-top.h	2012-08-18 17:51:30.000000000 -0700
++++ config-top.h	2015-04-02 10:08:29.143843829 -0700
[email protected]@ -63,14 +63,14 @@
  /* The default value of the PATH variable. */
  #ifndef DEFAULT_PATH_VALUE
  #define DEFAULT_PATH_VALUE \
--  "/usr/gnu/bin:/usr/local/bin:/bin:/usr/bin:."
+-  "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:."
 +  "/usr/gnu/bin:/bin:/usr/bin:/sbin:/usr/sbin:."
  #endif
  
@@ -17,8 +22,8 @@
  #endif
  
  /* Default primary and secondary prompt strings. */
[email protected]@ -75,14 +75,14 @@
- #define KSH_COMPATIBLE_SELECT
[email protected]@ -87,14 +87,14 @@
+ #define DEFAULT_BASHRC "~/.bashrc"
  
  /* System-wide .bashrc file for interactive shells. */
 -/* #define SYS_BASHRC "/etc/bash.bashrc" */
--- a/components/bash/patches/solaris-002.Makefile.in.3.patch	Fri Jan 27 15:04:39 2017 -0800
+++ b/components/bash/patches/solaris-002.Makefile.in.3.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -1,24 +1,11 @@
---- Makefile.in	2009-12-30 10:05:40.000000000 -0800
-+++ Makefile.in	2011-02-04 16:31:01.659698136 -0800
[email protected]@ -137,7 +137,7 @@
- STATIC_LD = @[email protected]
- LOCAL_LDFLAGS = @[email protected]
- 
--SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' $(LOCALE_DEFS)
-+SYSTEM_FLAGS = -DPROGRAM='"$(Program)"' -DCONF_HOSTTYPE='"$(Machine)"' -DCONF_OSTYPE='"$(OS)"' -DCONF_MACHTYPE='"$(MACHTYPE)"' -DCONF_VENDOR='"$(VENDOR)"' $(LOCALE_DEFS) $(CFLAGS)
- 
- BASE_CCFLAGS = $(PROFILE_FLAGS) $(SYSTEM_FLAGS) $(LOCAL_DEFS) \
- 	  $(DEFS) $(LOCAL_CFLAGS) $(INCLUDES)
[email protected]@ -535,7 +535,7 @@
- 
- $(Program):  .build $(OBJECTS) $(BUILTINS_DEP) $(LIBDEP)
- 	$(RM) [email protected]
--	$(PURIFY) $(CC) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS)
-+	$(PURIFY) $(CC) $(CFLAGS) $(BUILTINS_LDFLAGS) $(LIBRARY_LDFLAGS) $(LDFLAGS) -o $(Program) $(OBJECTS) $(LIBS) $(LD_OPTIONS) -s
- 	ls -l $(Program)
- 	-$(SIZE) $(Program)
- 
[email protected]@ -549,10 +549,10 @@
+# Our compiler flags contain percent sign which get mixed up with percent sign
+# seprators used by sed.
+#
+# Submitted to [email protected]
+
+--- Makefile.in	2016-12-06 14:52:25.890038489 +0100
++++ Makefile.in	2016-12-06 14:52:15.493002959 +0100
[email protected]@ -584,10 +584,11 @@ $(Program):  .build $(OBJECTS) $(BUILTIN
  	@echo
  
  bashbug: $(SUPPORT_SRC)bashbug.sh config.h Makefile $(VERSPROG)
@@ -26,10 +13,11 @@
 -	     -e "s%!CFLAGS!%$(CCFLAGS)%" -e "s%!CC!%$(CC)%" \
 -	     -e "s%!RELEASE!%$(Version)%" -e "s%!PATCHLEVEL!%$(PatchLevel)%" \
 -	     -e "s%!MACHTYPE!%$(MACHTYPE)%" -e "s%!RELSTATUS!%$(RELSTATUS)%" \
-+	@sed -e "s^!MACHINE!^$(Machine)^" -e "s^!OS!^$(OS)^" \
-+	    -e "s^!CFLAGS!^$(CCFLAGS)^" -e "s^!CC!^$(CC)^" \
-+	    -e "s^!RELEASE!^$(Version)^" -e "s^!PATCHLEVEL!^$(PatchLevel)^" \
-+	    -e "s^!MACHTYPE!^$(MACHTYPE)^" -e "s^!RELSTATUS!^$(RELSTATUS)^" \
++	@s=$$(printf '\001'); \
++	sed -e "s$${s}!MACHINE!$${s}$(Machine)$${s}" -e "s$${s}!OS!$${s}$(OS)$${s}" \
++	    -e "s$${s}!CFLAGS!$${s}$(CCFLAGS)$${s}" -e "s$${s}!CC!$${s}$(CC)$${s}" \
++	    -e "s$${s}!RELEASE!$${s}$(Version)$${s}" -e "s$${s}!PATCHLEVEL!$${s}$(PatchLevel)$${s}" \
++	    -e "s$${s}!MACHTYPE!$${s}$(MACHTYPE)$${s}" -e "s$${s}!RELSTATUS!$${s}$(RELSTATUS)$${s}" \
  	     $(SUPPORT_SRC)bashbug.sh > [email protected]
  	@chmod a+rx bashbug
  
--- a/components/bash/patches/solaris-003.glob.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
---- lib/glob/glob.c	2009-11-14 15:39:30.000000000 -0800
-+++ lib/glob/glob.c	2010-09-01 10:28:10.161379481 -0700
[email protected]@ -34,6 +34,10 @@
- #  include <unistd.h>
- #endif
- 
-+#if defined (HAVE_ALLOCA) && defined (HAVE_ALLOCA_H)
-+#  include <alloca.h>
-+#endif
-+
- #include "bashansi.h"
- #include "posixdir.h"
- #include "posixstat.h"
--- a/components/bash/patches/solaris-004.snprintf.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- lib/sh/snprintf.c	2008-08-12 12:02:14.000000000 -0400
-+++ lib/sh/snprintf.c	2009-08-10 15:16:30.000000000 -0400
[email protected]@ -116,6 +116,8 @@
- #  include <locale.h>
- #endif
- 
-+#include <math.h>
-+
- #include "stdc.h"
- #include <shmbutil.h>
- 
--- a/components/bash/patches/solaris-005.variables.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ b/components/bash/patches/solaris-005.variables.c.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -1,15 +1,25 @@
---- variables.c	2009-01-04 14:32:46.000000000 -0500
-+++ variables.c	2009-08-15 14:53:56.426776000 -0400
[email protected]@ -402,14 +402,10 @@
+# Export the default variables if they aren't set.
+# Otherwise we end up with inconsistently defined/exported
+# defaults.
+# Solaris-specific patch.
+#
+# I don't fully understand what this does. It would be worth discussing with
+# upstream. They clerly were using the commands at some point in time.
+
+--- variables.c	2011-01-24 17:07:48.000000000 -0800
++++ variables.c	2011-11-29 09:29:51.902791524 -0800
[email protected]@ -471,14 +471,12 @@
    /* Now make our own defaults in case the vars that we think are
       important are missing. */
    temp_var = set_if_not ("PATH", DEFAULT_PATH_VALUE);
 -#if 0
++
    set_auto_export (temp_var);	/* XXX */
 -#endif
  
    temp_var = set_if_not ("TERM", "dumb");
 -#if 0
++
    set_auto_export (temp_var);	/* XXX */
 -#endif
  
--- a/components/bash/patches/solaris-006.signames.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
---- support/signames.c	2008-08-13 08:31:48.000000000 -0400
-+++ support/signames.c	2009-08-15 16:40:01.729682000 -0400
[email protected]@ -212,6 +212,14 @@
-   signal_names[SIGXRES] = "SIGXRES";
- #endif
- 
-+#if defined (SIGJVM1) /* Solaris Java Virtual Machine 1 */
-+  signal_names[SIGJVM1] = "SIGJVM1";
-+#endif
-+
-+#if defined (SIGJVM2) /* Solaris Java Virtual Machine 2 */
-+  signal_names[SIGJVM2] = "SIGJVM2";
-+#endif
-+
- /* HP-UX */
- #if defined (SIGDIL)	/* DIL signal (?) */
-   signal_names[SIGDIL] = "SIGDIL";
--- a/components/bash/patches/solaris-007.rlprivate.h.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
---- lib/readline/rlprivate.h	2009-01-22 21:56:49.000000000 -0500
-+++ lib/readline/rlprivate.h	2009-08-16 10:55:56.178609000 -0400
[email protected]@ -23,6 +23,18 @@
- #if !defined (_RL_PRIVATE_H_)
- #define _RL_PRIVATE_H_
- 
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#if defined(HANDLE_MULTIBYTE)
-+
-+#include <limits.h>
-+#include <wchar.h>
-+#include <wctype.h>
-+
-+#endif /* HANDLE_MULTIBYTE */
-+
- #include "rlconf.h"	/* for VISIBLE_STATS */
- #include "rlstdc.h"
- #include "posixjmp.h"	/* defines procenv_t */
--- a/components/bash/patches/solaris-008.xmbsrtowcs.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- lib/glob/xmbsrtowcs.c	2008-08-12 10:17:54.000000000 -0400
-+++ lib/glob/xmbsrtowcs.c	2009-08-10 15:46:18.000000000 -0400
[email protected]@ -30,7 +30,7 @@
- #if HANDLE_MULTIBYTE
- 
- #ifndef FREE
--#  define FREE(x)	do { if (x) free (x); } while (0)
-+#  define FREE(x)	do { if (x) free (x);  x = 0; } while (0)
- #endif
- /* On some locales (ex. ja_JP.sjis), mbsrtowc doesn't convert 0x5c to U<0x5c>.
-    So, this function is made for converting 0x5c to U<0x5c>. */
--- a/components/bash/patches/solaris-009.configure.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
---- configure	2009-12-29 05:34:51.000000000 -0800
-+++ configure	2010-09-01 10:45:06.225859891 -0700
[email protected]@ -1,4 +1,4 @@
--#! /bin/sh
-+#! /bin/bash
- # From configure.in for Bash 4.1, version 4.019.
- # Guess values for system-dependent variables and create Makefiles.
- # Generated by GNU Autoconf 2.63 for bash 4.1-release.
[email protected]@ -13,6 +13,8 @@
- ## M4sh Initialization.  ##
- ## --------------------- ##
- 
-+export LD_OPTIONS="-lc -lm -lgen -lsocket -lnsl -lresolv -z ignore"
-+
- # Be more Bourne compatible
- DUALCASE=1; export DUALCASE # for MKS sh
- if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
[email protected]@ -592,7 +594,7 @@
- subdirs=
- MFLAGS=
- MAKEFLAGS=
--SHELL=${CONFIG_SHELL-/bin/sh}
-+SHELL=${CONFIG_SHELL-/bin/bash}
- 
- # Identity of this package.
- PACKAGE_NAME='bash'
[email protected]@ -3500,7 +3502,7 @@
-   ac_save_c_werror_flag=$ac_c_werror_flag
-    ac_c_werror_flag=yes
-    ac_cv_prog_cc_g=no
--   CFLAGS="-g"
-+   CFLAGS=""
-    cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
[email protected]@ -3579,7 +3581,7 @@
- sed 's/^/| /' conftest.$ac_ext >&5
- 
- 	ac_c_werror_flag=$ac_save_c_werror_flag
--	 CFLAGS="-g"
-+	 CFLAGS=""
- 	 cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
[email protected]@ -3638,7 +3640,7 @@
-   if test "$GCC" = yes; then
-     CFLAGS="-g -O2"
-   else
--    CFLAGS="-g"
-+    CFLAGS=""
-   fi
- else
-   if test "$GCC" = yes; then
[email protected]@ -5092,7 +5094,7 @@
- 
- if test -z "$CC_FOR_BUILD"; then
-     if test "x$cross_compiling" = "xno"; then
--	CC_FOR_BUILD='$(CC)'
-+	CC_FOR_BUILD='$(CC) $(CPPFLAGS) $(CFLAGS)'
-     else
- 	CC_FOR_BUILD=gcc
-     fi
[email protected]@ -5100,7 +5102,7 @@
- 
- 
- 
--test -z "$CFLAGS" && CFLAGS=-g auto_cflags=1
-+test -z "$CFLAGS" && CFLAGS="${CFLAGS}" auto_cflags=1
- 
- test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O2"
- 
[email protected]@ -5132,7 +5134,7 @@
- 	LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-""}
- fi
- 
--test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD="-g"
-+test -z "$CFLAGS_FOR_BUILD" && CFLAGS_FOR_BUILD=""
- 
- 
- 
[email protected]@ -5257,9 +5259,14 @@
- int
- main ()
- {
-+#if defined(sun) || defined(__sun) || defined(__sun__)
-+#error "we want to use libcurses."
-+return 255;
-+#else
- return tgetent ();
-   ;
-   return 0;
-+#endif
- }
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
[email protected]@ -6164,7 +6171,7 @@
-   $as_echo_n "(cached) " >&6
- else
-   cat >conftest.make <<\_ACEOF
--SHELL = /bin/sh
-+SHELL = /bin/bash
- all:
- 	@echo '@@@%%%=$(MAKE)[email protected]@@%%%'
- _ACEOF
[email protected]@ -6190,7 +6197,7 @@
- 
- case "$host_os" in
- opennt*|interix*)	MAKE_SHELL="$INTERIX_ROOT/bin/sh" ;;
--*)			MAKE_SHELL=/bin/sh ;;
-+*)			MAKE_SHELL=/bin/bash ;;
- esac
- 
- 
[email protected]@ -7177,7 +7184,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
-+  echo "#! /bin/bash" >conf$$.sh
-   echo  "exit 0"   >>conf$$.sh
-   chmod +x conf$$.sh
-   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
[email protected]@ -7191,7 +7198,7 @@
- # Find out how to test for executable files. Don't use a zero-byte file,
- # as systems may use methods other than mode bits to determine executability.
- cat >conf$$.file <<_ASEOF
--#! /bin/sh
-+#! /bin/bash
- exit 0
- _ASEOF
- chmod +x conf$$.file
[email protected]@ -7288,7 +7295,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
-+  echo "#! /bin/bash" >conf$$.sh
-   echo  "exit 0"   >>conf$$.sh
-   chmod +x conf$$.sh
-   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
[email protected]@ -7302,7 +7309,7 @@
- # Find out how to test for executable files. Don't use a zero-byte file,
- # as systems may use methods other than mode bits to determine executability.
- cat >conf$$.file <<_ASEOF
--#! /bin/sh
-+#! /bin/bash
- exit 0
- _ASEOF
- chmod +x conf$$.file
[email protected]@ -7359,7 +7366,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
-+  echo "#! /bin/bash" >conf$$.sh
-   echo  "exit 0"   >>conf$$.sh
-   chmod +x conf$$.sh
-   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
[email protected]@ -7373,7 +7380,7 @@
- # Find out how to test for executable files. Don't use a zero-byte file,
- # as systems may use methods other than mode bits to determine executability.
- cat >conf$$.file <<_ASEOF
--#! /bin/sh
-+#! /bin/bash
- exit 0
- _ASEOF
- chmod +x conf$$.file
[email protected]@ -8992,7 +8999,7 @@
- # Prepare PATH_SEPARATOR.
- # The user is always right.
- if test "${PATH_SEPARATOR+set}" != set; then
--  echo "#! /bin/sh" >conf$$.sh
-+  echo "#! /bin/bash" >conf$$.sh
-   echo  "exit 0"   >>conf$$.sh
-   chmod +x conf$$.sh
-   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
[email protected]@ -9102,7 +9109,7 @@
- else
- 
-     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
--    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-+    ${CONFIG_SHELL-/bin/bash} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-     . ./conftest.sh
-     rm -f ./conftest.sh
-     acl_cv_rpath=done
[email protected]@ -13042,39 +13049,18 @@
- /* end confdefs.h.  */
- /* Define isinf to an innocuous variant, in case <limits.h> declares isinf.
-    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
--#define isinf innocuous_isinf
--
--/* System header to define __stub macros and hopefully few prototypes,
--    which can conflict with char isinf (); below.
--    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
--    <limits.h> exists even on freestanding compilers.  */
--
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
--#endif
--
--#undef isinf
--
-+#include <math.h>
- /* Override any GCC internal prototype to avoid an error.
-    Use char because int might match the return type of a GCC
-    builtin and then its argument prototype would still apply.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--char isinf ();
- /* The GNU C library defines this for functions which it implements
-     to always fail with ENOSYS.  Some functions are actually named
-     something starting with __ and the normal name is an alias.  */
--#if defined __stub_isinf || defined __stub___isinf
--choke me
--#endif
- 
- int
- main ()
- {
--return isinf ();
-+return isinf(0.0);
-   ;
-   return 0;
- }
[email protected]@ -13134,39 +13120,26 @@
- /* end confdefs.h.  */
- /* Define isnan to an innocuous variant, in case <limits.h> declares isnan.
-    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
--#define isnan innocuous_isnan
- 
- /* System header to define __stub macros and hopefully few prototypes,
-     which can conflict with char isnan (); below.
-     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-     <limits.h> exists even on freestanding compilers.  */
- 
--#ifdef __STDC__
--# include <limits.h>
--#else
--# include <assert.h>
--#endif
--
--#undef isnan
-+#include <math.h>
- 
- /* Override any GCC internal prototype to avoid an error.
-    Use char because int might match the return type of a GCC
-    builtin and then its argument prototype would still apply.  */
--#ifdef __cplusplus
--extern "C"
--#endif
--char isnan ();
-+
- /* The GNU C library defines this for functions which it implements
-     to always fail with ENOSYS.  Some functions are actually named
-     something starting with __ and the normal name is an alias.  */
--#if defined __stub_isnan || defined __stub___isnan
--choke me
--#endif
- 
- int
- main ()
- {
--return isnan ();
-+return isnan(0.0);
-   ;
-   return 0;
- }
[email protected]@ -25521,7 +25494,7 @@
- exit 69
- ' >conftest
- chmod u+x conftest
--(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null 2>&1)
-+(SHELL=/bin/bash; export SHELL; ./conftest >/dev/null 2>&1)
- if test $? -ne 69; then
-    ac_cv_sys_interpreter=yes
- else
[email protected]@ -30117,9 +30090,14 @@
- int
- main ()
- {
-+#if defined(sun) || defined(__sun) || defined(__sun__)
-+#error "we want to use libcurses"
-+return 255;
-+#else
- return tgetent ();
-   ;
-   return 0;
-+#endif
- }
- _ACEOF
- rm -f conftest.$ac_objext conftest$ac_exeext
[email protected]@ -30302,7 +30280,7 @@
-   $as_echo_n "(cached) " >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
--LIBS="-lcurses  $LIBS"
-+LIBS="/usr/lib/64/libcurses.so.1  $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
[email protected]@ -30468,7 +30446,7 @@
- TERMCAP_LIB=
- TERMCAP_DEP=
- else
--TERMCAP_LIB=-lcurses
-+TERMCAP_LIB=/usr/lib/64/libcurses.so.1
- TERMCAP_DEP=
- fi
- 
[email protected]@ -30676,7 +30654,7 @@
- then
- 	{ $as_echo "$as_me:$LINENO: checking shared object configuration for loadable builtins" >&5
- $as_echo_n "checking shared object configuration for loadable builtins... " >&6; }
--	eval `${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
-+	eval `${CONFIG_SHELL-/bin/bash} ${srcdir}/support/shobj-conf -C "${CC}" -c "${host_cpu}" -o "${host_os}" -v "${host_vendor}"`
- 
- 
- 
--- a/components/bash/patches/solaris-010.input.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
---- lib/readline/input.c	2009-04-19 10:12:03.000000000 -0700
-+++ lib/readline/input.c	2010-09-01 10:46:23.386144948 -0700
[email protected]@ -51,6 +51,10 @@
- #  include <sys/ioctl.h>
- #endif
- 
-+#if defined(SOLARIS)
-+#  include <sys/filio.h>
-+#endif
-+
- #include <stdio.h>
- #include <errno.h>
- 
--- a/components/bash/patches/solaris-011.input_avail.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
---- lib/sh/input_avail.c	2009-04-19 10:01:14.000000000 -0700
-+++ lib/sh/input_avail.c	2010-09-01 10:47:30.418016819 -0700
[email protected]@ -45,6 +45,10 @@
- #  include <sys/ioctl.h>
- #endif
- 
-+#if defined(SOLARIS)
-+#  include <sys/filio.h> /* Solaris FIONREAD */
-+#endif
-+
- #include <stdio.h>
- #include <errno.h>
- 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-012.inputrc.location.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,87 @@
+# Solaris-specific system paths.
+# Our bash configuration lives in /etc/bash/inputrc.
+# Not for upstream.
+
+--- lib/readline/rlconf.h	2009-01-04 11:32:33.000000000 -0800
++++ lib/readline/rlconf.h	2010-09-01 10:48:13.018894232 -0700
[email protected]@ -43,7 +43,7 @@
+ #define DEFAULT_INPUTRC "~/.inputrc"
+ 
+ /* The ultimate last-ditch filenname for an init file -- system-wide. */
+-#define SYS_INPUTRC "/etc/inputrc"
++#define SYS_INPUTRC "/etc/bash/inputrc"
+ 
+ /* If defined, expand tabs to spaces. */
+ #define DISPLAY_TABS
+--- doc/bashref.info	2016-11-20 11:39:05.161711301 +0100
++++ doc/bashref.info	2016-11-20 11:38:49.065536928 +0100
[email protected]@ -7124,7 +7124,7 @@ putting commands in an "inputrc" file, c
+ directory.  The name of this file is taken from the value of the shell
+ variable 'INPUTRC'.  If that variable is unset, the default is
+ '~/.inputrc'.  If that file does not exist or cannot be read, the
+-ultimate default is '/etc/inputrc'.
++ultimate default is '/etc/bash/inputrc'.
+ 
+    When a program which uses the Readline library starts up, the init
+ file is read, and the key bindings are set.
[email protected]@ -7636,8 +7636,8 @@ four parser directives used.
+ '$include'
+      This directive takes a single filename as an argument and reads
+      commands and bindings from that file.  For example, the following
+-     directive reads from '/etc/inputrc':
+-          $include /etc/inputrc
++     directive reads from '/etc/bash/inputrc':
++          $include /etc/bash/inputrc
+ 
+ 
+ File: bashref.info,  Node: Sample Init File,  Prev: Conditional Init Constructs,  Up: Readline Init File
[email protected]@ -7656,8 +7656,8 @@ variable assignment, and conditional syn
+      # Lines beginning with '#' are comments.
+      #
+      # First, include any system-wide bindings and variable
+-     # assignments from /etc/Inputrc
+-     $include /etc/Inputrc
++     # assignments from /etc/bash/inputrc
++     $include /etc/bash/inputrc
+ 
+      #
+      # Set various bindings for emacs mode.
+# Solaris-specific configuration defaults.
+# Our bash system configuration files are in /etc/bash.
+# Not for upstream.
+--- doc/bash.1	2011-01-16 12:31:39.000000000 -0800
++++ doc/bash.1	2011-11-29 09:57:25.406978670 -0800
[email protected]@ -5810,11 +5810,11 @@
+ .IP \fB$include\fP
+ This directive takes a single filename as an argument and reads commands
+ and bindings from that file.  For example, the following directive
+-would read \fI/etc/inputrc\fP:
++would read \fI/etc/bash/inputrc\fP:
+ .sp 1
+ .RS
+ .nf
+-\fB$include\fP \^ \fI/etc/inputrc\fP
++\fB$include\fP \^ \fI/etc/bash/inputrc\fP
+ .fi
+ .RE
+ .SS Searching
+--- doc/bash.info	2016-12-02 09:24:09.777589027 +0000
++++ doc/bash.info	2016-12-02 09:23:42.588282332 +0000
[email protected]@ -7124,7 +7124,7 @@ putting commands in an "inputrc" file, c
+ directory.  The name of this file is taken from the value of the shell
+ variable 'INPUTRC'.  If that variable is unset, the default is
+ '~/.inputrc'.  If that file does not exist or cannot be read, the
+-ultimate default is '/etc/inputrc'.
++ultimate default is '/etc/bash/inputrc'.
+ 
+    When a program which uses the Readline library starts up, the init
+ file is read, and the key bindings are set.
[email protected]@ -7636,7 +7636,7 @@ four parser directives used.
+ '$include'
+      This directive takes a single filename as an argument and reads
+      commands and bindings from that file.  For example, the following
+-     directive reads from '/etc/inputrc':
++     directive reads from '/etc/bash/inputrc':
+           $include /etc/inputrc
+ 
+ 
--- a/components/bash/patches/solaris-012.rlconf.h.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- lib/readline/rlconf.h	2009-01-04 11:32:33.000000000 -0800
-+++ lib/readline/rlconf.h	2010-09-01 10:48:13.018894232 -0700
[email protected]@ -39,7 +39,7 @@
- #define DEFAULT_INPUTRC "~/.inputrc"
- 
- /* The ultimate last-ditch filenname for an init file -- system-wide. */
--#define SYS_INPUTRC "/etc/inputrc"
-+#define SYS_INPUTRC "/etc/bash/inputrc"
- 
- /* If defined, expand tabs to spaces. */
- #define DISPLAY_TABS
--- a/components/bash/patches/solaris-013.bashref.info.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
---- doc/bashref.info	2009-12-29 12:59:33.000000000 -0800
-+++ doc/bashref.info	2010-09-01 10:49:49.070499702 -0700
[email protected]@ -6387,7 +6387,7 @@
- directory.  The name of this file is taken from the value of the shell
- variable `INPUTRC'.  If that variable is unset, the default is
- `~/.inputrc'.  If that file does not exist or cannot be read, the
--ultimate default is `/etc/inputrc'.
-+ultimate default is `/etc/bash/inputrc'.
- 
-    When a program which uses the Readline library starts up, the init
- file is read, and the key bindings are set.
[email protected]@ -6812,8 +6812,8 @@
- `$include'
-      This directive takes a single filename as an argument and reads
-      commands and bindings from that file.  For example, the following
--     directive reads from `/etc/inputrc':
--          $include /etc/inputrc
-+     directive reads from `/etc/bash/inputrc':
-+          $include /etc/bash/inputrc
- 
- 
- File: bashref.info,  Node: Sample Init File,  Prev: Conditional Init Constructs,  Up: Readline Init File
--- a/components/bash/patches/solaris-014.bash.man.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-*** doc/bash.1.orig	Wed Oct 12 06:45:05 2011
---- doc/bash.1	Wed Oct 12 06:45:46 2011
-***************
-*** 3843,3849 ****
-  .B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP
-  conditional operator
-  .TP
-! .B = *= /= %= += \-= <<= >>= &= ^= |=
-  assignment
-  .TP
-  .B \fIexpr1\fP , \fIexpr2\fP
---- 3843,3849 ----
-  .B \fIexpr\fP?\fIexpr\fP:\fIexpr\fP
-  conditional operator
-  .TP
-! .B "= *= /= %= += \-= <<= >>= &= ^= |="
-  assignment
-  .TP
-  .B \fIexpr1\fP , \fIexpr2\fP
-***************
-*** 5235,5245 ****
-  .IP \fB$include\fP
-  This directive takes a single filename as an argument and reads commands
-  and bindings from that file.  For example, the following directive
-! would read \fI/etc/inputrc\fP:
-  .sp 1
-  .RS
-  .nf
-! \fB$include\fP \^ \fI/etc/inputrc\fP
-  .fi
-  .RE
-  .SS Searching
---- 5235,5245 ----
-  .IP \fB$include\fP
-  This directive takes a single filename as an argument and reads commands
-  and bindings from that file.  For example, the following directive
-! would read \fI/etc/bash/inputrc\fP:
-  .sp 1
-  .RS
-  .nf
-! \fB$include\fP \^ \fI/etc/bash/inputrc\fP
-  .fi
-  .RE
-  .SS Searching
--- a/components/bash/patches/solaris-015.rbash.man.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
---- doc/rbash.1	2008-08-12 06:24:51.000000000 -0700
-+++ doc/rbash.1	2010-09-01 10:52:04.397206373 -0700
[email protected]@ -1,8 +1,8 @@
--.TH RBASH 1 "2004 Apr 20" "GNU Bash-4.0"
-+.TH RBASH 1 "2004 Apr 20" "GNU Bash-4.1"
- .SH NAME
- rbash \- restricted bash, see \fBbash\fR(1)
- .SH RESTRICTED SHELL
- .nr zY 1
--.so bash.1
-+.so /usr/share/man/man1/bash.1
- .SH SEE ALSO
- bash(1)
--- a/components/bash/patches/solaris-016.eaccess.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#
-# Backported to bash 4.1 from:
-# http://lists.gnu.org/archive/html/bug-bash/2012-07/msg00027.html
-# Also see:
-# https://bugzilla.redhat.com/show_bug.cgi?id=840091
-# http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-3410
-#
---- lib/sh/eaccess.c	2008-08-12 08:50:01.000000000 -0700
-+++ lib/sh/eaccess.c	2012-07-24 09:39:37.970186946 -0700
[email protected]@ -40,6 +40,10 @@
- #if !defined (_POSIX_VERSION) && defined (HAVE_SYS_FILE_H)
- #  include <sys/file.h>
- #endif /* !_POSIX_VERSION */
-+
-+#include <string.h> /* memset(3C) */
-+#include <limits.h> /* _XOPEN_PATH_MAX */
-+
- #include "posixstat.h"
- #include "filecntl.h"
- 
[email protected]@ -82,6 +86,8 @@
-      const char *path;
-      struct stat *finfo;
- {
-+  static char pbuf[_XOPEN_PATH_MAX + 1];
-+
-   if (*path == '\0')
-     {
-       errno = ENOENT;
[email protected]@ -106,9 +112,10 @@
-      trailing slash.  Make sure /dev/fd/xx really uses DEV_FD_PREFIX/xx.
-      On most systems, with the notable exception of linux, this is
-      effectively a no-op. */
--      char pbuf[32];
-+      (void) memset (pbuf, '\0', sizeof(pbuf));
-       strcpy (pbuf, DEV_FD_PREFIX);
--      strcat (pbuf, path + 8);
-+      strncat (pbuf, path + 8,
-+	      (size_t) (sizeof(pbuf) - sizeof(DEV_FD_PREFIX)));
-       return (stat (pbuf, finfo));
- #endif /* !HAVE_DEV_FD */
-     }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-016.run-all.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,17 @@
+# Our build system exports SHELLOPTS which makes testing fail We could have set
+# "unexport SHELLOPTS" in our Makefile, but maybe this will be accepted by
+# community?
+#
+# Reported to [email protected]
+
+--- tests/run-all	2016-11-28 00:46:51.812583704 -0800
++++ tests/run-all	2016-11-28 00:45:20.302845042 -0800
[email protected]@ -17,7 +17,7 @@ export PATH
+ # unset BASH_ENV only if it is set
+ [ "${BASH_ENV+set}" = "set" ] && unset BASH_ENV
+ # ditto for SHELLOPTS
+-#[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS
++[ "${SHELLOPTS+set}" = "set" ] && unset SHELLOPTS
+ 
+ : ${THIS_SH:=../bash}
+ export THIS_SH
--- a/components/bash/patches/solaris-017.bashhist.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-- in maybe_append_history, change check for history_lines_this_session
-  so that we append the lines to the file if it's equal to the value
-  returned by where_history(). This means that without this change,
-  the history won't be appended if all the lines in the history list
-  were added in the current session since the last time the history
-  file was read or written. Fixes bug reported by Bruce Korb
-  <[email protected]>
-
-http://lists.gnu.org/archive/html/bug-bash/2010-08/msg00101.html
-
---- bashhist.c	2009-08-14 12:33:02.000000000 -0700
-+++ bashhist.c	2013-08-26 02:05:33.384872000 -0700
[email protected]@ -372,7 +372,7 @@ maybe_append_history (filename)
-   struct stat buf;
- 
-   result = EXECUTION_SUCCESS;
--  if (history_lines_this_session && (history_lines_this_session < where_history ()))
-+  if (history_lines_this_session && (history_lines_this_session <= where_history ()))
-     {
-       /* If the filename was supplied, then create it if necessary. */
-       if (stat (filename, &buf) == -1 && errno == ENOENT)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-018.posixexp2.tests.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,105 @@
+# solaris is compiled with  --enable-xpg-echo-default=yes which makes some
+# tests fail. Should we use printf '%s\n' "..." instead?
+#
+# Reported on [email protected]
+
+--- tests/posixexp2.tests	2010-11-11 17:50:47.000000000 -0800
++++ tests/posixexp2.tests	2012-07-12 13:15:14.818468328 -0700
[email protected]@ -2,6 +2,11 @@
+ 
+ set -o posix
+ 
++xpg=`shopt | grep xpg_echo | awk '{ print $2 }'`
++if [ ${xpg} = "on" ] ; then
++    shopt -u xpg_echo
++fi
++
+ (echo 1 ${IFS+'}'z}) 2>&- || echo failed in 1
+ (echo 2 "${IFS+'}'z}") 2>&- || echo failed in 2
+ (echo 3 "foo ${IFS+'bar} baz") 2>&- || echo failed in 3
+--- tests/comsub2.sub	2016-11-28 01:04:23.177652643 -0800
++++ tests/comsub2.sub	2016-11-28 01:01:49.330747645 -0800
[email protected]@ -4,5 +4,5 @@ echo "$qpath"
+ 
+ # it's crazy that all three of these produce the same result
+ echo ${qpath//\\/}
+-echo ${qpath//"`echo \\`"/}
+-echo ${qpath//`echo "\\\\\\\\"`/}
++echo ${qpath//"`echo -E \\`"/}
++echo ${qpath//`echo -E "\\\\\\\\"`/}
+--- tests/exp5.sub	2016-11-28 02:38:32.148794257 -0800
++++ tests/exp5.sub	2016-11-28 02:33:12.133199473 -0800
[email protected]@ -1,18 +1,18 @@
+ # expansions involving patterns
+ 
+ var='[hello'
+-echo "${var//[/}"
++echo -E "${var//[/}"
+ 
+ red='\[\e[0;31m\]'
+-echo "${red//\\[\\e/}"
++echo -E "${red//\\[\\e/}"
+ 
+ foo="${red//\\[\\e/}"
+ 
+ # foo == [0;31m\]
+-echo "${foo//[0;31m\\/}"
++echo -E "${foo//[0;31m\\/}"
+ 
+-echo "${var//[]/}"
+-echo "${red//[]/}"
++echo -E "${var//[]/}"
++echo -E "${red//[]/}"
+ 
+ v=hello
+ foo='[:alpha:]'
+--- tests/exp8.sub	2016-11-28 03:44:56.875686938 -0800
++++ tests/exp8.sub	2016-11-28 03:39:21.761054928 -0800
[email protected]@ -10,11 +10,11 @@ declare -p var | sed -n l
+ 
+ recho ${[email protected]}
+ recho ${[email protected]}
+-echo ${[email protected]}
++echo -E ${[email protected]}
+ 
+ unset array
+ array=( [$'x\001y\177z']=foo )	# should be error
+-echo ${array[@]@A}
++echo -E ${array[@]@A}
+ 
+ unset array
+ declare -a array=([0]=$'x\001y\177z')
[email protected]@ -23,9 +23,9 @@ declare -p array
+ unset array
+ array=( "$var" )
+ recho ${array[@]}
+-echo ${array[@]@A}
++echo -E ${array[@]@A}
+ 
+ unset array
+ declare -A array
+ array=( [$'x\001y\177z']=$'a\242b\002c' )
+-echo ${array[@]@A}
++echo -E ${array[@]@A}
+--- tests/heredoc3.sub	2016-11-28 03:58:47.587299575 -0800
++++ tests/heredoc3.sub	2016-11-28 03:55:11.935894965 -0800
[email protected]@ -69,7 +69,7 @@ cat <<END
+ hello
+ \END
+ END
+-echo end 'hello<NL>\END'
++echo -E end 'hello<NL>\END'
+ 
+ # this has to be last -- results in a syntax error
+ # doesn't currently parse because EOF is not on a line by itself -- should it?
+--- tests/quote1.sub	2016-11-28 04:11:46.210688369 -0800
++++ tests/quote1.sub	2016-11-28 04:08:49.101872596 -0800
[email protected]@ -14,7 +14,7 @@ echo "'${test//"'"/}'"
+ 
+ echo "'${test//"'"/"'\\''"}'"
+ 
+-echo "'${test//"'"/\'\\'\'}'"
++echo -E "'${test//"'"/\'\\'\'}'"
+ 
+ #echo "'${test//'/}'"   # hangs waiting for '
+ #echo "'${test//"'"/'\\''}'" # hangs waiting for '
--- a/components/bash/patches/solaris-022.bash.sighup.patch	Fri Jan 27 15:04:39 2017 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-# Internal patch. Upstream will not accept it.
-# If read EOF on a non-blank line do not interpret as a NL.
-# Clear the readline buffers and return eof_found.
---- lib/readline/readline.c	2009-08-31 05:45:31.000000000 -0700
-+++ lib/readline/readline.c	2015-02-18 11:10:55.652803033 -0800
[email protected]@ -533,7 +533,15 @@
- 
-       /* EOF typed to a non-blank line is a <NL>. */
-       if (c == EOF && rl_end)
--	c = NEWLINE;
-+      {
-+        _rl_internal_char_cleanup ();
-+        eof_found = 1;
-+#if defined (READLINE_CALLBACKS)
-+        return 0;
-+#else
-+        return (eof_found);
-+#endif
-+      }
- 
-       /* The character _rl_eof_char typed to blank line, and not as the
- 	 previous character is interpreted as EOF. */
--- a/components/bash/patches/solaris-023.eaccess.c.patch	Fri Jan 27 15:04:39 2017 -0800
+++ b/components/bash/patches/solaris-023.eaccess.c.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -1,16 +1,21 @@
-# Internal patch.
-# Do not return true if euid == 0 and file does not have the execute bit set.
---- lib/sh/eaccess.c	2015-02-26 14:23:13.619717483 -0800
-+++ lib/sh/eaccess.c	2015-02-26 14:29:09.644569957 -0800
[email protected]@ -208,8 +208,10 @@
+# Solaris-specific. The famous access(2) bug that will return
+# X_OK even if the execute bit isn't set.
+# So, we want to use stat(2) instead, which returns the actual
+# permission bits.
+#
+# I do know nothing about the mentioned bug, keeping the patch just to be sure.
+#
+# Not suitable for upstream
+
+--- lib/sh/eaccess.c	2015-04-02 10:24:43.401129429 -0700
++++ lib/sh/eaccess.c	2015-04-02 10:28:57.704781076 -0700
[email protected]@ -211,7 +211,8 @@
    if (path_is_devfd (path))
      return (sh_stataccess (path, mode));
  
--#if defined (HAVE_EACCESS)		/* FreeBSD */
-+#if defined(HAVE_EACCESS) && !defined(SOLARIS) /* FreeBSD */
-   return (eaccess (path, mode));
-+#elif defined(SOLARIS)
-+  return (sh_stataccess (path, mode));
- #elif defined (EFF_ONLY_OK)		/* SVR4(?), SVR4.2 */
-   return access (path, mode|EFF_ONLY_OK);
- #else
+-#if (defined (HAVE_FACCESSAT) && defined (AT_EACCESS)) || defined (HAVE_EACCESS)
++#if ((defined (HAVE_FACCESSAT) && defined (AT_EACCESS)) || \
++    defined (HAVE_EACCESS)) && !defined(SOLARIS)
+ #  if defined (HAVE_FACCESSAT) && defined (AT_EACCESS)
+   ret = faccessat (AT_FDCWD, path, mode, AT_EACCESS);
+ #  else		/* HAVE_EACCESS */	/* FreeBSD */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-025.false_exit_code.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,16 @@
+# This test prints return value of various commands. In this particular case
+# it's the return value of /bin/false which on Solaris returns 255.
+#
+# Not suitable for upstream.
+
+--- tests/exec.right	2016-11-28 01:58:36.053039919 -0800
++++ tests/exec.right	2016-11-28 01:58:07.419101147 -0800
[email protected]@ -83,7 +83,7 @@ foo 0
+ after
+ exit code: 1
+ exit code: 1
+-exit code: 1
++exit code: 255
+ exit code: 127
+ exit code: 127
+ exit code: 127
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-026.cd_in_rcfile.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,26 @@
+# There seems to be problem with bash
+#
+# $ bash -c 'bash -i i; bash -i i'
+# bash -c 'bash -i i; bash -i i'
+# bash: i: No such file or directory
+#
+# [1]+  Stopped                 bash -c 'bash -i i; bash -i i'
+#
+# I found out because the tests were stopped in the middle. It was caused by
+# having 'cd /somewhere' in my ~/.bashrc. The tests were being stopped in
+# read-test, exactly in read2.sub when 'read -t 2 a < /dev/tty' was executed.
+# This workaround stops the tests to be stopped in the middle.
+#
+# reported to [email protected]
+
+--- tests/execscript	2016-11-28 03:07:12.420018055 -0800
++++ tests/execscript	2016-11-28 03:03:36.431541831 -0800
[email protected]@ -108,7 +108,7 @@ ${THIS_SH} ./exec6.sub
+ # checks for properly deciding what constitutes an executable file
+ ${THIS_SH} ./exec7.sub
+ 
+-${THIS_SH} -i ./exec8.sub
++${THIS_SH} --rcfile /dev/null -i ./exec8.sub
+ 
+ ${THIS_SH} ./exec9.sub
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-027.bad_file_number_text.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,64 @@
+# Solaris says 'Bad file number' instead of 'Bad file descriptor' on Linux.
+# Make sure the test finds what it expects
+#
+# Not suitable for upstream
+
+--- tests/redir.right	2016-11-28 04:38:00.494117081 -0800
++++ tests/redir.right	2016-11-28 04:36:49.995612525 -0800
[email protected]@ -84,9 +84,9 @@ f () 
+         echo "$line";
+     done
+ }
+-./redir5.sub: line 20: read: 5: invalid file descriptor: Bad file descriptor
++./redir5.sub: line 20: read: 5: invalid file descriptor: Bad file number
+ after read
+-./redir5.sub: line 27: read: read error: 0: Bad file descriptor
++./redir5.sub: line 27: read: read error: 0: Bad file number
+ # tests of ksh93-like dup-and-close redirection operators
+ /
+ /
[email protected]@ -141,20 +141,20 @@ bix () 
+ foo
+ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+ 1
+-./redir11.sub: line 8: $a: Bad file descriptor
+-./redir11.sub: line 9: $(echo $a): Bad file descriptor
++./redir11.sub: line 8: $a: Bad file number
++./redir11.sub: line 9: $(echo $a): Bad file number
+ 7
+ after: 42
+-./redir11.sub: line 24: echo: write error: Bad file descriptor
+-./redir11.sub: line 25: echo: write error: Bad file descriptor
+-./redir11.sub: line 26: $(a=4 foo): Bad file descriptor
+-./redir11.sub: line 27: $(a=4 foo): Bad file descriptor
+-./redir11.sub: line 30: $a: Bad file descriptor
+-./redir11.sub: line 31: $(echo $a): Bad file descriptor
++./redir11.sub: line 24: echo: write error: Bad file number
++./redir11.sub: line 25: echo: write error: Bad file number
++./redir11.sub: line 26: $(a=4 foo): Bad file number
++./redir11.sub: line 27: $(a=4 foo): Bad file number
++./redir11.sub: line 30: $a: Bad file number
++./redir11.sub: line 31: $(echo $a): Bad file number
+ ./redir11.sub: line 39: $(ss= declare -i ss): ambiguous redirect
+ after: 42
+ a+=3
+ foo
+ foo
+-./redir11.sub: line 53: $(echo $a): Bad file descriptor
++./redir11.sub: line 53: $(echo $a): Bad file number
+ 123
+--- tests/vredir.right	2016-11-28 04:38:01.014664808 -0800
++++ tests/vredir.right	2016-11-28 04:36:47.695701154 -0800
[email protected]@ -11,9 +11,9 @@ bar () 
+ ./vredir.tests: line 6: v: readonly variable
+ ./vredir.tests: line 6: v: cannot assign fd to variable
+ 42
+-./vredir.tests: line 25: $v: Bad file descriptor
+-./vredir.tests: line 26: $v: Bad file descriptor
+-./vredir.tests: line 27: $v: Bad file descriptor
++./vredir.tests: line 25: $v: Bad file number
++./vredir.tests: line 26: $v: Bad file number
++./vredir.tests: line 27: $v: Bad file number
+ bar is a function
+ bar () 
+ { 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-028.missing_HOME.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,17 @@
+# If $HOME is not set (running from cron perhaps), the tests will output:
+# 26d25
+# < ./comsub-posix.tests: line 103: cd: HOME not set
+# 28d26
+# < ./comsub-posix.tests: line 106: cd: HOME not set
+#
+# Reported to [email protected]
+
+--- tests/comsub-posix.tests	2016-11-29 03:41:57.414081235 +0000
++++ tests/comsub-posix.tests	2016-11-29 03:36:30.425718528 +0000
[email protected]@ -1,4 +1,5 @@
+-
++HOME=${HOME:-/}
++export HOME
+ # works right
+ echo ab$(echo mnop)yz
+ # works right
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-029.undef_SHELL.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,23 @@
+# When SHELL is unset the test fails with
+#
+# 150,151c150,151
+# < ./redir11.sub: line 26: echo: write error: Bad file number
+# < ./redir11.sub: line 27: echo: write error: Bad file number
+# ---
+# > ./redir11.sub: line 26: $(a=4 foo): Bad file number
+# > ./redir11.sub: line 27: $(a=4 foo): Bad file number
+#
+# Reported to [email protected], but they can't reproduce. Needs more work on
+# our side.
+
+--- tests/redir.tests	2016-12-01 11:20:04.910983199 +0000
++++ tests/redir.tests	2016-12-01 11:19:34.114069067 +0000
[email protected]@ -1,7 +1,7 @@
+ : ${TMPDIR:=/tmp}
+ 
+ export LC_ALL=C
+-export LANG=C
++export LANG=C; export SHELL=
+ 
+ # catch-all for remaining untested redirection stuff
+ set +o posix
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-030.SHOBJ_STATUS_install.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,18 @@
+# If $ac_cv_func_dlopen is not 'yes' a bit earlier, SHOBJ_LIBS remains
+# undefiled. Later during 'make install' stage, examples/loadables/Makefile
+# calls install-$(SHOBJ_STATUS), and since the target 'install-' is undefined,
+# make prints error.
+#
+# Reported to [email protected]
+
+--- configure.ac	2016-12-06 05:07:31.808614344 +0000
++++ configure.ac	2016-12-06 05:07:26.791244255 +0000
[email protected]@ -1151,6 +1151,8 @@ then
+ 	AC_SUBST(SHOBJ_LIBS)
+ 	AC_SUBST(SHOBJ_STATUS)
+ 	AC_MSG_RESULT($SHOBJ_STATUS)
++else
++	SHOBJ_STATUS=unsupported
+ fi
+ 
+ # try to create a directory tree if the source is elsewhere
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/bash/patches/solaris-031.use_dynamic_temp_file.patch	Thu Jan 26 12:24:45 2017 +0100
@@ -0,0 +1,27 @@
+# The test new-exp1 used /tmp/x which is too common file to and might be
+# already present. The test then fails with:
+#
+# run-new-exp
+# ...
+# 171,172c171
+# < ./new-exp1.sub: line 8: /tmp/x: Permission denied
+# < rm: cannot remove '/tmp/x': Permission denied
+# ---
+# > this is test 2
+#
+# Reported to [email protected]
+
+--- tests/new-exp1.sub	2016-12-07 07:06:57.268664317 +0000
++++ tests/new-exp1.sub	2016-12-07 07:06:13.299361999 +0000
[email protected]@ -5,7 +5,8 @@ expect()
+ 
+ expect this is a test of proc subst
+ cat <(echo this is a test of proc subst)
+-echo this is test 2 > /tmp/x
++OUTFILE=${BASH_TSTOUT}.new-exp1
++echo this is test 2 > "$OUTFILE"
+ expect this is test 2
+-cat <(cat /tmp/x)
+-rm -f /tmp/x
++cat <(cat "$OUTFILE")
++rm -f "$OUTFILE"