PSARC/2014/162 ksh93 update to 2012-08-01 s11u3-sru
authorLijo George<lijo.x.george@oracle.com>
Thu, 26 May 2016 22:52:21 -0700
branchs11u3-sru
changeset 6073 99c2bf34d78a
parent 6072 a1b208a8235a
child 6074 4a3952ad8c2a
PSARC/2014/162 ksh93 update to 2012-08-01 16169978 ksh93 memory corruption with redirection 16507675 external command in double-nested here-document hangs ksh93 17533968 ksh93 uprev to latest community version 18119738 ksh93 crashes in sfio area 18302723 ksh93 segv in sh_setmatch 18426052 SPARC /usr/bin/ksh is not an XPG6 executable 18920300 remove pkglint Warnings in ksh93 build
components/ksh93/Makefile
components/ksh93/developer-astdev93.p5m
components/ksh93/ksh93.license
components/ksh93/ksh93.p5m
components/ksh93/patches/17851169.patch
components/ksh93/patches/21547336.patch
components/ksh93/patches/Bug15794787,15819673.patch
components/ksh93/patches/CR6964621.patch
components/ksh93/patches/CR7009897.patch
components/ksh93/patches/CR7032068.patch
components/ksh93/patches/CR7032821.patch
components/ksh93/patches/CR7033181.patch
components/ksh93/patches/CR7036535.patch
components/ksh93/patches/CR7046434.patch
components/ksh93/patches/CR7071431.patch
components/ksh93/patches/CR7089799.patch
components/ksh93/patches/CR7105086.patch
components/ksh93/patches/CR7110983.patch
components/ksh93/patches/CR7128313.patch
components/ksh93/patches/CR7167466.patch
components/ksh93/patches/CR7178717.patch
components/ksh93/patches/CRXXX_Error_Catalog.patch
components/ksh93/patches/compiler.patch
components/ksh93/patches/solaris_alias.patch
components/ksh93/source-demo-ksh93.p5m
--- a/components/ksh93/Makefile	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/Makefile	Thu May 26 22:52:21 2016 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -28,7 +28,7 @@
 COMPONENT_PROJECT_URL= http://www2.research.att.com/sw/download/
 
 # These are required if retrieving packages from the AT&T website.
-ATT_USERNAME= "I accept www.opensource.org/licenses/cpl"
+ATT_USERNAME= "I accept www.opensource.org/licenses/eclipse"
 ATT_PASSWD= "."
 
 # This flag controls the prep.mk behaviour to patch each archive individually
@@ -36,15 +36,15 @@
 
 COMPONENT_NAME = ksh93
 COMPONENT_SRC_NAME = INIT
-COMPONENT_VERSION = 2011-02-08
+COMPONENT_VERSION = 2012-08-01
 COMPONENT_SRC = $(COMPONENT_SRC_NAME).$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE =	$(COMPONENT_SRC).tgz
 COMPONENT_ARCHIVE_HASH = \
-    sha256:d692d476fe4bb933e7b6459c0cc99a2e9f428bfd81a495ed4201ec197e070f57
-COMPONENT_ARCHIVE_URL = http://www2.research.att.com/~gsf/download/tgz/$(COMPONENT_ARCHIVE) 
+    sha256:c40cf57e9b2186271a9c362a560aa4a6e25ba911a8258ab931d2bbdbce44cfe5
+COMPONENT_ARCHIVE_URL = http://www2.research.att.com/~astopen/download/tgz/$(COMPONENT_ARCHIVE)
 COMPONENT_PATCHES = 
 
-TPNO=		9000
+TPNO=		16530
 
 # Patch only required if building ksh93 only and not ast-base
 # package-pax-suid.patch
@@ -54,34 +54,34 @@
 
 NUM_EXTRA_ARCHIVES= 1
 COMPONENT_NAME_1= ast-base
-COMPONENT_VERSION_1= 2011-02-08
+COMPONENT_VERSION_1= 2012-08-01
 COMPONENT_SRC_1= $(COMPONENT_NAME_1).$(COMPONENT_VERSION_1)
 COMPONENT_ARCHIVE_1= $(COMPONENT_NAME_1).$(COMPONENT_VERSION_1).tgz
 COMPONENT_ARCHIVE_HASH_1= \
-    sha256:44ae3913e6c0c8992c6c3cba16864fd4c4a18c6da8e7d87c85a23060cea7cd1a
-COMPONENT_ARCHIVE_URL_1= http://www2.research.att.com/~gsf/download/tgz/$(COMPONENT_ARCHIVE_1)
+    sha256:3bd668dbd922790f1d24c78e3522ef4816501e9cf80abf3c480f554c74f4dbac
+COMPONENT_ARCHIVE_URL_1= http://www2.research.att.com/~astopen/download/tgz/$(COMPONENT_ARCHIVE_1)
 COMPONENT_PATCHES_1= compiler.patch path_utmp.patch\
-					 solaris_alias.patch \
-					 CR6919590.patch CR7033181.patch \
-					 CR7071431.patch CR7036535.patch \
-					 CRXXX_Error_Catalog.patch CR7025778.patch \
-					 CR7065478.patch CR7026179.patch \
-					 CR7065900.patch CR7110983.patch \
-					 CR7105086.patch multi_lang_arith.patch \
-					 CR7057565.patch CR7046434.patch \
-					 CR7032821.patch CR7009897.patch \
-					 CR6964621.patch CR7032068.patch \
-					 CR7061011.patch CR6934836.patch \
-					 CR7089799.patch CR6917338.patch \
-					 CR7019368.patch CR6729252.patch \
-					 MAP_TYPE_64_Bits.patch CR7167466.patch \
-					 CR7168611.patch CR7178717.patch \
-					 CR7175995.patch CR7128313.patch \
-					 Bug15794787,15819673.patch \
-					 Bug15808407.patch Bug17714341.patch \
-					 17432413.patch 17824699.patch \
-					 17435456.patch 17851169.patch \
-					 Bug15993811.patch 21547336.patch
+                     solaris_alias.patch \
+                     CR6919590.patch CR7036535.patch \
+                     CRXXX_Error_Catalog.patch CR7025778.patch \
+                     CR7065478.patch CR7026179.patch \
+                     CR7065900.patch CR7110983.patch \
+                     multi_lang_arith.patch \
+                     CR7057565.patch \
+                     CR6964621.patch CR7032068.patch \
+                     CR7061011.patch CR6934836.patch \
+                     CR7089799.patch CR6917338.patch \
+                     CR7019368.patch CR6729252.patch \
+                     MAP_TYPE_64_Bits.patch \
+                     CR7168611.patch \
+                     CR7175995.patch CR7186440_ksh93_disable_predictive_editing.patch \
+                     Bug15808407.patch Bug17714341.patch \
+                     17432413.patch 17824699.patch \
+                     17435456.patch 17851169.patch \
+                     Bug15993811.patch 21547336.patch \
+                     17777549.patch 17699248.patch \
+                     17817727.patch 18229654.patch \
+                     19907453.patch
 
 # Fixup HOSTTYPE to match uname output and bits
 HOSTTYPE32=sol11.$(shell uname -p)
@@ -145,14 +145,18 @@
 # IPS Version number: 93.21.1.20110208
 #
 IPS_PKG_NAME= ksh93
-IPS_COMPONENT_VERSION= 93.21.0.20110208
-IPS_HUMAN_VERSION= "93u 2011-02-08"
+IPS_COMPONENT_VERSION= 93.21.1.20120801
+IPS_HUMAN_VERSION= "93u+ 2012-08-01"
 
 # common targets
 build:		$(BUILD_32_and_64)
 	
 install:	$(INSTALL_32_and_64)	
-		
+	(for binary in msgcvt msgcpp msgget msggen ksh shcomp alias; do \
+		/usr/bin/elfedit -e 'dyn:delete RPATH' -e 'dyn:delete RUNPATH' \
+		    "$(PROTO_DIR)/$(MACH64)/bin/$$binary" ; \
+	done )
+
 test:		$(TEST_32_and_64)
 
 
--- a/components/ksh93/developer-astdev93.p5m	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/developer-astdev93.p5m	Thu May 26 22:52:21 2016 -0700
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 # The man pages are all at the top of a "files" directory; setting the hash to
@@ -60,7 +60,7 @@
 file path=usr/share/man/man1/msgget.1
 legacy pkg=SUNWastdev desc="AT&T AST development utilities" \
     name="AT&T AST development utilities"
-license ksh93.license license=CPL
+license ksh93.license license=EPL1.0
 # Ensure that we upgrade the old package to the version where it's
 # renamed.
 depend type=optional fmri=pkg:/developer/[email protected]
--- a/components/ksh93/ksh93.license	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/ksh93.license	Thu May 26 22:52:21 2016 -0700
@@ -1,5 +1,5 @@
-1. The following files are available in source code form under the Common
-Public License at: http://www2.research.att.com/~astopen/download. (The CPL
+1. The follow files are available in source code form under the Eclipse 
+Public License at: http://www2.research.att.com/~astopen/download. (The EPL
 license is reproduced below).
 
 2. All past Contributors to the Korn Shell 93 (ksh 93) disclaim all warranties
@@ -9,23 +9,27 @@
 Contributors are not liable for any damages, including direct, indirect,
 special, incidental and consequential damages, such as lost profits.
 
-3. Any provisions of the Oracle license agreement that differ from the Common
+3. Any provisions of the Oracle license agreement that differ from the Eclipse
 Public License are offered by Oracle alone and not by any other party.
 
 4. Oracle has modified the following files: lib/package/ast-base.pkg
 src/cmd/alias/alias.c src/cmd/alias/alias.h src/cmd/alias/Makefile
 src/cmd/builtin/asa.c src/cmd/INIT/cc.sol11.i386 src/cmd/INIT/cc.sol11.i386-64
-src/cmd/INIT/cc.sol11.sun4 src/cmd/INIT/cc.sol11.sun4-64
-src/cmd/INIT/regress.sh src/cmd/ksh93/bltins/cd_pwd.c
-src/cmd/ksh93/bltins/typeset.c src/cmd/ksh93/data/builtins.c
+src/cmd/INIT/cc.sol11.sparc src/cmd/INIT/cc.sol11.sparc-64
+src/cmd/INIT/regress.sh src/cmd/ksh93/bltins/alarm.c
+src/cmd/ksh93/bltins/cd_pwd.c src/cmd/ksh93/data/builtins.c
 src/cmd/ksh93/edit/edit.c src/cmd/ksh93/include/defs.h
 src/cmd/ksh93/include/edit.h src/cmd/ksh93/include/io.h
-src/cmd/ksh93/include/ulimit.h src/cmd/ksh93/Makefile src/cmd/ksh93/sh/args.c
-src/cmd/ksh93/sh/init.c src/cmd/ksh93/sh/io.c src/cmd/ksh93/sh/jobs.c
-src/cmd/ksh93/sh/lex.c src/cmd/ksh93/sh/macro.c src/cmd/ksh93/sh/main.c
-src/cmd/ksh93/sh/name.c src/cmd/ksh93/sh/nvdisc.c src/cmd/ksh93/sh/nvtree.c
-src/cmd/ksh93/sh/nvtype.c src/cmd/ksh93/sh/path.c src/cmd/ksh93/sh/subshell.c
-src/cmd/ksh93/sh/xec.c src/cmd/ss/ssd.c src/lib/libast/comp/mkdir.c
+src/cmd/ksh93/Makefile src/cmd/ksh93/sh/args.c
+src/cmd/ksh93/sh/array.c src/cmd/ksh93/sh/fault.c
+src/cmd/ksh93/sh/init.c src/cmd/ksh93/sh/io.c
+src/cmd/ksh93/sh/jobs.c src/cmd/ksh93/sh/lex.c
+src/cmd/ksh93/sh/macro.c src/cmd/ksh93/sh/main.c
+src/cmd/ksh93/sh/name.c src/cmd/ksh93/sh/nvdisc.c
+src/cmd/ksh93/sh/nvtree.c src/cmd/ksh93/sh/nvtype.c
+src/cmd/ksh93/sh/path.c src/cmd/ksh93/sh/streval.c
+src/cmd/ksh93/sh/subshell.c src/cmd/ksh93/sh/xec.c
+src/cmd/ss/ssd.c src/lib/libast/comp/mkdir.c
 src/lib/libast/comp/rmdir.c src/lib/libast/comp/setlocale.c
 src/lib/libast/port/astconf.c src/lib/libast/port/mnt.c
 src/lib/libast/sfio/sfmode.c src/lib/libast/sfio/sfstrtof.h
@@ -35,287 +39,49 @@
 agreement. Oracle is solely responsible for any representations and warranties
 contained therein.
 
-6. 
 
-+------------------------------------------------------------------------------+
-|          This license covers all software that refers to the URL             |
-|            http://www.opensource.org/licenses/bsd-license.php                |
-+------------------------------------------------------------------------------+
-
-The BSD License
-
-Copyright (c) <YEAR>, <OWNER>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the
-      distribution.
-    * Neither the name of the <ORGANIZATION> nor the names of its
-      contributors may be used to endorse or promote products derived
-      from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-+------------------------------------------------------------------------------+
-|          This license covers all software that refers to the URL             |
-|               http://www.opensource.org/licenses/cpl1.0.txt                  |
-+------------------------------------------------------------------------------+
-
-Common Public License Version 1.0
 
-   THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON
-   PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
-   THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-   
-   1. DEFINITIONS 
-   
-   "Contribution" means:
-   
-     a) in the case of the initial Contributor, the initial code and
-     documentation distributed under this Agreement, and
-     
-     b) in the case of each subsequent Contributor:
-     
-     i) changes to the Program, and
-     
-     ii) additions to the Program;
-     
-     where such changes and/or additions to the Program originate from
-     and are distributed by that particular Contributor. A Contribution
-     'originates' from a Contributor if it was added to the Program by
-     such Contributor itself or anyone acting on such Contributor's
-     behalf. Contributions do not include additions to the Program
-     which: (i) are separate modules of software distributed in
-     conjunction with the Program under their own license agreement, and
-     (ii) are not derivative works of the Program.
-     
-   "Contributor" means any person or entity that distributes the Program.
-   
-   "Licensed Patents " mean patent claims licensable by a Contributor
-   which are necessarily infringed by the use or sale of its Contribution
-   alone or when combined with the Program.
-   
-   "Program" means the Contributions distributed in accordance with this
-   Agreement.
-   
-   "Recipient" means anyone who receives the Program under this
-   Agreement, including all Contributors.
-   
-   2. GRANT OF RIGHTS
-   
-     a) Subject to the terms of this Agreement, each Contributor hereby
-     grants Recipient a non-exclusive, worldwide, royalty-free copyright
-     license to reproduce, prepare derivative works of, publicly
-     display, publicly perform, distribute and sublicense the
-     Contribution of such Contributor, if any, and such derivative
-     works, in source code and object code form.
-     
-     b) Subject to the terms of this Agreement, each Contributor hereby
-     grants Recipient a non-exclusive, worldwide, royalty-free patent
-     license under Licensed Patents to make, use, sell, offer to sell,
-     import and otherwise transfer the Contribution of such Contributor,
-     if any, in source code and object code form. This patent license
-     shall apply to the combination of the Contribution and the Program
-     if, at the time the Contribution is added by the Contributor, such
-     addition of the Contribution causes such combination to be covered
-     by the Licensed Patents. The patent license shall not apply to any
-     other combinations which include the Contribution. No hardware per
-     se is licensed hereunder.
-     
-     c) Recipient understands that although each Contributor grants the
-     licenses to its Contributions set forth herein, no assurances are
-     provided by any Contributor that the Program does not infringe the
-     patent or other intellectual property rights of any other entity.
-     Each Contributor disclaims any liability to Recipient for claims
-     brought by any other entity based on infringement of intellectual
-     property rights or otherwise. As a condition to exercising the
-     rights and licenses granted hereunder, each Recipient hereby
-     assumes sole responsibility to secure any other intellectual
-     property rights needed, if any. For example, if a third party
-     patent license is required to allow Recipient to distribute the
-     Program, it is Recipient's responsibility to acquire that license
-     before distributing the Program.
-     
-     d) Each Contributor represents that to its knowledge it has
-     sufficient copyright rights in its Contribution, if any, to grant
-     the copyright license set forth in this Agreement.
-     
-   3. REQUIREMENTS
-   
-   A Contributor may choose to distribute the Program in object code form
-   under its own license agreement, provided that:
-   
-     a) it complies with the terms and conditions of this Agreement; and
-     
-     b) its license agreement:
-     
-     i) effectively disclaims on behalf of all Contributors all
-     warranties and conditions, express and implied, including
-     warranties or conditions of title and non-infringement, and implied
-     warranties or conditions of merchantability and fitness for a
-     particular purpose;
-     
-     ii) effectively excludes on behalf of all Contributors all
-     liability for damages, including direct, indirect, special,
-     incidental and consequential damages, such as lost profits;
-     
-     iii) states that any provisions which differ from this Agreement
-     are offered by that Contributor alone and not by any other party;
-     and
-     
-     iv) states that source code for the Program is available from such
-     Contributor, and informs licensees how to obtain it in a reasonable
-     manner on or through a medium customarily used for software
-     exchange.
-     
-   When the Program is made available in source code form:
-   
-     a) it must be made available under this Agreement; and
-     
-     b) a copy of this Agreement must be included with each copy of the
-     Program.
-     
-   Contributors may not remove or alter any copyright notices contained
-   within the Program.
-   
-   Each Contributor must identify itself as the originator of its
-   Contribution, if any, in a manner that reasonably allows subsequent
-   Recipients to identify the originator of the Contribution.
-   
-   4. COMMERCIAL DISTRIBUTION
-   
-   Commercial distributors of software may accept certain
-   responsibilities with respect to end users, business partners and the
-   like. While this license is intended to facilitate the commercial use
-   of the Program, the Contributor who includes the Program in a
-   commercial product offering should do so in a manner which does not
-   create potential liability for other Contributors. Therefore, if a
-   Contributor includes the Program in a commercial product offering,
-   such Contributor ("Commercial Contributor") hereby agrees to defend
-   and indemnify every other Contributor ("Indemnified Contributor")
-   against any losses, damages and costs (collectively "Losses") arising
-   from claims, lawsuits and other legal actions brought by a third party
-   against the Indemnified Contributor to the extent caused by the acts
-   or omissions of such Commercial Contributor in connection with its
-   distribution of the Program in a commercial product offering. The
-   obligations in this section do not apply to any claims or Losses
-   relating to any actual or alleged intellectual property infringement.
-   In order to qualify, an Indemnified Contributor must: a) promptly
-   notify the Commercial Contributor in writing of such claim, and b)
-   allow the Commercial Contributor to control, and cooperate with the
-   Commercial Contributor in, the defense and any related settlement
-   negotiations. The Indemnified Contributor may participate in any such
-   claim at its own expense.
-   
-   For example, a Contributor might include the Program in a commercial
-   product offering, Product X. That Contributor is then a Commercial
-   Contributor. If that Commercial Contributor then makes performance
-   claims, or offers warranties related to Product X, those performance
-   claims and warranties are such Commercial Contributor's responsibility
-   alone. Under this section, the Commercial Contributor would have to
-   defend claims against the other Contributors related to those
-   performance claims and warranties, and if a court requires any other
-   Contributor to pay any damages as a result, the Commercial Contributor
-   must pay those damages.
-   
-   5. NO WARRANTY
-   
-   EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
-   PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-   KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
-   WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
-   OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-   responsible for determining the appropriateness of using and
-   distributing the Program and assumes all risks associated with its
-   exercise of rights under this Agreement, including but not limited to
-   the risks and costs of program errors, compliance with applicable
-   laws, damage to or loss of data, programs or equipment, and
-   unavailability or interruption of operations.
-   
-   6. DISCLAIMER OF LIABILITY 
-   
-   EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
-   ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-   WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-   DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-   HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-   
-   7. GENERAL
-   
-   If any provision of this Agreement is invalid or unenforceable under
-   applicable law, it shall not affect the validity or enforceability of
-   the remainder of the terms of this Agreement, and without further
-   action by the parties hereto, such provision shall be reformed to the
-   minimum extent necessary to make such provision valid and enforceable.
-   
-   If Recipient institutes patent litigation against a Contributor with
-   respect to a patent applicable to software (including a cross-claim or
-   counterclaim in a lawsuit), then any patent licenses granted by that
-   Contributor to such Recipient under this Agreement shall terminate as
-   of the date such litigation is filed. In addition, if Recipient
-   institutes patent litigation against any entity (including a
-   cross-claim or counterclaim in a lawsuit) alleging that the Program
-   itself (excluding combinations of the Program with other software or
-   hardware) infringes such Recipient's patent(s), then such Recipient's
-   rights granted under Section 2(b) shall terminate as of the date such
-   litigation is filed.
-   
-   All Recipient's rights under this Agreement shall terminate if it
-   fails to comply with any of the material terms or conditions of this
-   Agreement and does not cure such failure in a reasonable period of
-   time after becoming aware of such noncompliance. If all Recipient's
-   rights under this Agreement terminate, Recipient agrees to cease use
-   and distribution of the Program as soon as reasonably practicable.
-   However, Recipient's obligations under this Agreement and any licenses
-   granted by Recipient relating to the Program shall continue and
-   survive.
-   
-   Everyone is permitted to copy and distribute copies of this Agreement,
-   but in order to avoid inconsistency the Agreement is copyrighted and
-   may only be modified in the following manner. The Agreement Steward
-   reserves the right to publish new versions (including revisions) of
-   this Agreement from time to time. No one other than the Agreement
-   Steward has the right to modify this Agreement. IBM is the initial
-   Agreement Steward. IBM may assign the responsibility to serve as the
-   Agreement Steward to a suitable separate entity. Each new version of
-   the Agreement will be given a distinguishing version number. The
-   Program (including Contributions) may always be distributed subject to
-   the version of the Agreement under which it was received. In addition,
-   after a new version of the Agreement is published, Contributor may
-   elect to distribute the Program (including its Contributions) under
-   the new version. Except as expressly stated in Sections 2(a) and 2(b)
-   above, Recipient receives no rights or licenses to the intellectual
-   property of any Contributor under this Agreement, whether expressly,
-   by implication, estoppel or otherwise. All rights in the Program not
-   expressly granted under this Agreement are reserved.
-   
-   This Agreement is governed by the laws of the State of New York and
-   the intellectual property laws of the United States of America. No
-   party to this Agreement will bring a legal action under this Agreement
-   more than one year after the cause of action arose. Each party waives
-   its rights to a jury trial in any resulting litigation.
-
-Copyright (c) 2004 by the Open Source Initiative
-This is a copy of the license posted on 2004-10-06 at:
-   http://www.opensource.org/licenses/cpl
-
+Eclipse Public License - v 1.0 
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 
+1. DEFINITIONS 
+"Contribution" means: 
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. 
+"Contributor" means any person or entity that distributes the Program. 
+"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. 
+"Program" means the Contributions distributed in accordance with this Agreement. 
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors. 
+2. GRANT OF RIGHTS 
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. 
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. 
+3. REQUIREMENTS 
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that: 
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; 
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; 
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange. 
+When the Program is made available in source code form: 
+a) it must be made available under this Agreement; and 
+b) a copy of this Agreement must be included with each copy of the Program. 
+Contributors may not remove or alter any copyright notices contained within the Program. 
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. 
+4. COMMERCIAL DISTRIBUTION 
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense. 
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages. 
+5. NO WARRANTY 
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations. 
+6. DISCLAIMER OF LIABILITY 
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
+7. GENERAL 
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. 
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. 
+All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. 
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved. 
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation. 
--- a/components/ksh93/ksh93.p5m	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/ksh93.p5m	Thu May 26 22:52:21 2016 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 # The man pages are all at the top of a "files" directory; setting the hash to
@@ -111,7 +111,7 @@
 file ksh93.1.zh_CN.UTF-8 path=usr/share/man/zh_CN.UTF-8/man1/ksh93.1
 file rksh.1.zh_CN.UTF-8 path=usr/share/man/zh_CN.UTF-8/man1/rksh.1
 file shcomp.1.zh_CN.UTF-8 path=usr/share/man/zh_CN.UTF-8/man1/shcomp.1
-license ksh93.license license=CPL
+license ksh93.license license=EPL1.0
 # Ensure that we upgrade the old package to the version where it's
 # renamed.
 depend type=optional fmri=pkg:/shell/[email protected]
--- a/components/ksh93/patches/17851169.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/17851169.patch	Thu May 26 22:52:21 2016 -0700
@@ -1,8 +1,9 @@
-http://lists.research.att.com/pipermail/ast-developers/2014q1/003809.html
----
---- a/src/cmd/ksh93/sh/subshell.c
-+++ b/src/cmd/ksh93/sh/subshell.c
-@@ -234,15 +234,22 @@ Namval_t *sh_assignok(register Namval_t *np,int add)
+#	This has been submitted to the community but has not been accepted yet.
+#	The details can be found at the following location.
+#	http://lists.research.att.com/pipermail/ast-developers/2014q1/003809.html
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/subshell.c	2015-02-24 13:25:19.363479570 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/subshell.c	2015-03-05 13:02:10.389323525 -0800
+@@ -242,15 +244,22 @@ Namval_t *sh_assignok(register Namval_t
  {
  	register Namval_t	*mp;
  	register struct Link	*lp;
@@ -16,7 +17,7 @@
  	Namarr_t		*ap;
  	int			save;
 +
-+        sp = (struct subshell*)subshell_data;
++	sp = (struct subshell*)subshell_data;
 +
  	/* don't bother with this */
 -	if(!sp->shpwd || np==SH_LEVELNOD || np==L_ARGNOD || np==SH_SUBSCRNOD || np==SH_NAMENOD)
@@ -26,7 +27,6 @@
 +	shp = sp->shp;
 +	dp = shp->var_tree;
 +
- 	if((ap=nv_arrayptr(np)) && (mp=nv_opensub(np)))
- 	{
- 		shp->last_root = ap->table;
-
+ 	/* don't bother to save if in newer scope */
+ 	if(sp->var!=shp->var_tree && sp->var!=shp->var_base && shp->last_root==shp->var_tree)
+ 		return(np);
--- a/components/ksh93/patches/21547336.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/21547336.patch	Thu May 26 22:52:21 2016 -0700
@@ -5,12 +5,12 @@
 index 0735be9..ed544bf 100644
 --- a/src/cmd/ksh93/bltins/cd_pwd.c
 +++ b/src/cmd/ksh93/bltins/cd_pwd.c
-@@ -191,7 +191,7 @@ success:
- 	if(*dir != '/')
- 		return(0);
- 	nv_putval(opwdnod,oldpwd,NV_RDONLY);
+@@ -223,7 +223,7 @@
+ 	nv_scan(shp->track_tree,rehash,(void*)0,NV_TAGGED,NV_TAGGED);
+ 	path_newdir(shp,shp->pathlist);
+ 	path_newdir(shp,shp->cdpathlist);
 -	if(oldpwd)
 +	if(oldpwd && (oldpwd!=e_dot))
  		free(oldpwd);
- 	flag = strlen(dir);
- 	/* delete trailing '/' */
+ 	return(0);
+ }
--- a/components/ksh93/patches/Bug15794787,15819673.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
---- a/src/cmd/ksh93/sh/xec.c	Thu Nov 29 22:06:17 2012
-+++ b/src/cmd/ksh93/sh/xec.c	Fri Nov 30 00:45:30 2012
-@@ -540,8 +540,10 @@
- 	static Sfio_t *io_save;
- 	volatile int traceon=0, lineno=0;
- 	int binscript=shp->binscript;
-+	char comsub = shp->comsub;
- 	io_save = iop; /* preserve correct value across longjmp */
- 	shp->binscript = 0;
-+	shp->comsub = 0;
- #define SH_TOPFUN	0x8000	/* this is a temporary tksh hack */
- 	if (mode & SH_TOPFUN)
- 	{
-@@ -581,6 +583,7 @@
- 	}
- 	sh_popcontext(shp,&buff);
- 	shp->binscript = binscript;
-+	shp->comsub = comsub;
- 	if(traceon)
- 		sh_onoption(SH_XTRACE);
- 	if(lineno)
-@@ -3281,7 +3284,8 @@
- 	struct funenv fun;
- 	char *fname = nv_getval(SH_FUNNAMENOD);
- 	struct Level	*lp =(struct Level*)(SH_LEVELNOD->nvfun);
--	int		level, pipepid=shp->pipepid;
-+	int		level, pipepid=shp->pipepid, comsub=shp->comsub;
-+	shp->comsub = 0;
- 	shp->pipepid = 0;
- 	sh_stats(STAT_FUNCT);
- 	if(!lp->hdr.disc)
-@@ -3323,6 +3327,7 @@
- 	lp->maxlevel = level;
- 	SH_LEVELNOD->nvalue.s = lp->maxlevel;
- 	shp->last_root = nv_dict(DOTSHNOD);
-+	shp->comsub = comsub;
- #if 0
- 	nv_putval(SH_FUNNAMENOD,shp->st.funname,NV_NOFREE);
- #else
--- a/components/ksh93/patches/CR6964621.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/CR6964621.patch	Thu May 26 22:52:21 2016 -0700
@@ -1,6 +1,7 @@
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/include/io.h INIT.2011-02-08/src/cmd/ksh93/include/io.h
---- INIT.2011-02-08.clean/src/cmd/ksh93/include/io.h	2012-05-02 03:16:17.383778774 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/include/io.h	2012-05-02 03:17:53.562408338 -0700
+# This patch has been developed inhouse. This fixes a Solaris specific
+# issue and has not been submitted to the community.
+--- INIT.2012-08-01.old/src/cmd/ksh93/include/io.h	2015-02-24 13:25:19.331558350 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/include/io.h	2015-03-04 13:27:49.205782578 -0800
 @@ -23,6 +23,9 @@
   *	David Korn
   *
@@ -11,7 +12,7 @@
  
  #include	<ast.h>
  #include	<sfio.h>
-@@ -84,6 +87,12 @@ extern int	sh_devtofd(const char*);
+@@ -87,6 +90,12 @@ extern int	sh_devtofd(const char*);
  extern int	sh_isdevfd(const char*);
  extern int	sh_source(Shell_t*, Sfio_t*, const char*);
  
@@ -24,16 +25,15 @@
  /* the following are readonly */
  extern const char	e_pexists[];
  extern const char	e_query[];
-@@ -123,4 +132,5 @@ extern const char	e_bash_profile[];
+@@ -126,4 +135,5 @@ extern const char	e_bash_profile[];
  extern const char	e_stdprompt[];
  extern const char	e_supprompt[];
  extern const char	e_ambiguous[];
 +
  #endif /* KSHELL */
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/io.c INIT.2011-02-08/src/cmd/ksh93/sh/io.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/io.c	2012-05-02 03:16:17.389917698 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/io.c	2012-05-02 03:19:12.669621809 -0700
-@@ -596,8 +596,10 @@ static void io_preserve(Shell_t* shp, re
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/io.c	2015-02-24 13:25:19.362427732 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/io.c	2015-03-04 14:04:54.981280201 -0800
+@@ -605,8 +605,10 @@ static void io_preserve(Shell_t* shp, re
  		((struct checkpt*)shp->jmplist)->mode = SH_JMPERREXIT;
  		errormsg(SH_DICT,ERROR_system(1),e_toomany);
  	}
@@ -46,7 +46,7 @@
  	if(shp->fdptrs[fd]=shp->fdptrs[f2])
  	{
  		if(f2==job.fd)
-@@ -623,7 +625,12 @@ static void io_preserve(Shell_t* shp, re
+@@ -632,7 +634,12 @@ static void io_preserve(Shell_t* shp, re
   */
  int sh_iorenumber(Shell_t *shp, register int f1,register int f2)
  {
@@ -60,7 +60,7 @@
  	if(f1!=f2)
  	{
  		/* see whether file descriptor is in use */
-@@ -663,8 +670,7 @@ int sh_iorenumber(Shell_t *shp, register
+@@ -672,8 +679,7 @@ int sh_iorenumber(Shell_t *shp, register
  		if(f2<=2)
  			sfset(sp,SF_SHARE|SF_PUBLIC,1);
  	}
@@ -70,7 +70,7 @@
  	return(f2);
  }
  
-@@ -678,8 +684,9 @@ int sh_close(register int fd)
+@@ -687,8 +693,9 @@ int sh_close(register int fd)
  	register int r = 0;
  	if(fd<0)
  		return(-1);
@@ -81,18 +81,18 @@
 +
  	if(!(sp=shp->sftable[fd]) || sfclose(sp) < 0)
  	{
- 		if(fdnotify)
-@@ -835,6 +842,9 @@ int sh_open(register const char *path, i
+ 		int err=errno;
+@@ -846,8 +853,7 @@ int sh_open(register const char *path, i
  		mode = (IOREAD|IOWRITE);
  	else
  		mode = IOREAD;
-+
+-	if(fd >= shp->gd->lim.open_max)
+-		sh_iovalidfd(shp,fd);
 +	VALIDATE_FD(shp, fd);
-+
  	shp->fdstatus[fd] = mode;
  	return(fd);
  }
-@@ -861,6 +871,8 @@ int sh_iomovefd(register int fdold)
+@@ -876,6 +882,8 @@ int sh_iomovefd(register int fdold)
  	if(fdold<0 || fdold>2)
  		return(fdold);
  	fdnew = sh_iomovefd(dup(fdold));
@@ -101,7 +101,7 @@
  	shp->fdstatus[fdnew] = (shp->fdstatus[fdold]&~IOCLEX);
  	close(fdold);
  	shp->fdstatus[fdold] = IOCLOSE;
-@@ -897,6 +909,9 @@ int	sh_pipe(register int pv[])
+@@ -936,6 +944,9 @@ int	sh_pipe(register int pv[])
  		sh_close(fd);
  	else
  		pv[out] = sh_iomovefd(fd);
@@ -111,7 +111,7 @@
  	if(fcntl(pv[out],F_SETFD,FD_CLOEXEC) >=0)
  		shp->fdstatus[pv[out]] |= IOCLEX;
  	shp->fdstatus[pv[out]] = (out?IOWRITE:IOREAD);
-@@ -929,6 +944,9 @@ int	sh_pipe(register int pv[])
+@@ -968,6 +979,9 @@ int	sh_pipe(register int pv[])
  		errormsg(SH_DICT,ERROR_system(1),e_pipe);
  	}
  	fcntl(pv[out],F_SETFD,FD_CLOEXEC);
@@ -121,7 +121,7 @@
  	shp->fdstatus[pv[out]] |= IOCLEX;
  	pv[1-out] = -1;
  	pv[2] = port;
-@@ -958,9 +976,13 @@ static int pat_line(const regex_t* rp, c
+@@ -997,9 +1011,13 @@ static int pat_line(const regex_t* rp, c
  static int io_patseek(Shell_t *shp, regex_t *rp, Sfio_t* sp, int flags)
  {
  	char	*cp, *match;
@@ -136,7 +136,7 @@
  	shp->fdstatus[sffileno(sp)] |= IOCLEX;
  	if(fd==0)
  		was_share = sfset(sp,SF_SHARE,1);
-@@ -994,12 +1016,17 @@ static int io_patseek(Shell_t *shp, rege
+@@ -1033,12 +1051,17 @@ static int io_patseek(Shell_t *shp, rege
  
  static Sfoff_t	file_offset(Shell_t *shp, int fn, char *fname)
  {
@@ -155,7 +155,7 @@
  	memset(&endf,0,sizeof(struct Eof));
  	endf.fd = fn;
  	endf.hdr.disc = &EOF_disc;
-@@ -1169,7 +1196,7 @@ int	sh_redirect(Shell_t *shp,struct iono
+@@ -1216,7 +1239,7 @@ int	sh_redirect(Shell_t *shp,struct iono
  			if((iof&IOLSEEK) || ((iof&IOMOV) && *fname=='-'))
  				fn = nv_getnum(np);
  		}
@@ -164,7 +164,7 @@
  			errormsg(SH_DICT,ERROR_system(1),e_file+4);
  		if(iof&IOLSEEK)
  		{
-@@ -1212,6 +1239,7 @@ int	sh_redirect(Shell_t *shp,struct iono
+@@ -1259,6 +1282,7 @@ int	sh_redirect(Shell_t *shp,struct iono
  						message = e_file;
  						goto fail;
  					}
@@ -172,7 +172,7 @@
  					if(shp->subshell && dupfd==1)
  					{
  						if(sfset(sfstdout,0,0)&SF_STRING)
-@@ -1248,8 +1276,7 @@ int	sh_redirect(Shell_t *shp,struct iono
+@@ -1295,8 +1319,7 @@ int	sh_redirect(Shell_t *shp,struct iono
  					goto traceit;
  				if((fd=sh_fcntl(dupfd,F_DUPFD,3))<0)
  					goto fail;
@@ -182,7 +182,7 @@
  				sh_iocheckfd(shp,dupfd);
  				shp->fdstatus[fd] = (shp->fdstatus[dupfd]&~IOCLEX);
  				if(toclose<0 && shp->fdstatus[fd]&IOREAD)
-@@ -1362,7 +1389,11 @@ int	sh_redirect(Shell_t *shp,struct iono
+@@ -1410,7 +1433,11 @@ int	sh_redirect(Shell_t *shp,struct iono
  			}
  			if(iof&IOLSEEK)
  			{
@@ -195,7 +195,7 @@
  				r = shp->fdstatus[fn];
  				if(!(r&(IOSEEK|IONOSEEK)))
  					r = sh_iocheckfd(shp,fn);
-@@ -1443,6 +1474,7 @@ int	sh_redirect(Shell_t *shp,struct iono
+@@ -1491,6 +1518,7 @@ int	sh_redirect(Shell_t *shp,struct iono
  			}
  			if(fd<0)
  			{
@@ -203,16 +203,16 @@
  				if(sh_inuse(shp,fn) || (fn && fn==shp->infd))
  				{
  					if(fn>9 || !(shp->inuse_bits&(1<<fn)))
-@@ -1462,7 +1494,7 @@ int	sh_redirect(Shell_t *shp,struct iono
+@@ -1510,7 +1538,7 @@ int	sh_redirect(Shell_t *shp,struct iono
  					{
  						if((fn=fcntl(fd,F_DUPFD,10)) < 0)
  							goto fail;
 -						if(fn>=shp->gd->lim.open_max && !sh_iovalidfd(shp,fn))
 +						if (!VALIDATE_FD(shp, fn))
  							goto fail;
- 						shp->fdstatus[fn] = shp->fdstatus[fd];
- 						sh_close(fd);
-@@ -1622,7 +1654,12 @@ void sh_iosave(Shell_t *shp, register in
+ 						if(flag!=2 || shp->subshell)
+ 							sh_iosave(shp,fn,indx|0x10000,tname?fname:(trunc?Empty:0));
+@@ -1701,7 +1729,12 @@ void sh_iosave(Shell_t *shp, register in
  	filemap[shp->topfd++].save_fd = savefd;
  	if(savefd >=0)
  	{
@@ -226,7 +226,7 @@
  		/* make saved file close-on-exec */
  		sh_fcntl(savefd,F_SETFD,FD_CLOEXEC);
  		if(origfd==job.fd)
-@@ -1655,6 +1692,7 @@ void	sh_iounsave(Shell_t* shp)
+@@ -1734,6 +1767,7 @@ void	sh_iounsave(Shell_t* shp)
  			filemap[newfd++] = filemap[fd];
  		else
  		{
@@ -234,7 +234,7 @@
  			shp->sftable[savefd] = 0;
  			sh_close(savefd);
  		}
-@@ -1678,16 +1716,19 @@ void	sh_iorestore(Shell_t *shp, int last
+@@ -1757,16 +1791,19 @@ void	sh_iorestore(Shell_t *shp, int last
  		{
  			if ((savefd = filemap[fd].save_fd) >= 0)
  			{
@@ -254,7 +254,7 @@
  			shp->sftable[savefd] = 0;
  			sh_close(savefd);
  			return;
-@@ -1699,6 +1740,7 @@ void	sh_iorestore(Shell_t *shp, int last
+@@ -1778,6 +1815,7 @@ void	sh_iorestore(Shell_t *shp, int last
  		sh_close(origfd);
  		if ((savefd = filemap[fd].save_fd) >= 0)
  		{
@@ -262,7 +262,7 @@
  			sh_fcntl(savefd, F_DUPFD, origfd);
  			if(savefd==job.fd)
  				job.fd=origfd;
-@@ -1954,6 +1996,9 @@ static ssize_t slowread(Sfio_t *iop,void
+@@ -2035,6 +2073,9 @@ static ssize_t slowread(Sfio_t *iop,void
  int sh_iocheckfd(Shell_t *shp, register int fd)
  {
  	register int flags, n;
@@ -272,16 +272,16 @@
  	if((n=shp->fdstatus[fd])&IOCLOSE)
  		return(n);
  	if(!(n&(IOREAD|IOWRITE)))
-@@ -2145,7 +2190,7 @@ static void	sftrack(Sfio_t* sp, int flag
+@@ -2226,7 +2267,7 @@ static void	sftrack(Sfio_t* sp, int flag
  		return;
  	}
  #endif
--	if(fd<0 || (fd>=shp->gd->lim.open_max && !sh_iovalidfd(shp,fd)))
-+	if (fd < 0 || !VALIDATE_FD(shp, fd))
+-	if(fd<0 || fd==PSEUDOFD || (fd>=shp->gd->lim.open_max && !sh_iovalidfd(shp,fd)))
++	if(fd<0 || fd==PSEUDOFD || !VALIDATE_FD(shp, fd))
  		return;
  	if(sh_isstate(SH_NOTRACK))
  		return;
-@@ -2413,6 +2458,8 @@ ssize_t sh_read(register int fd, void* b
+@@ -2495,6 +2536,8 @@ ssize_t sh_read(register int fd, void* b
  {
  	Shell_t *shp = sh_getinterp();
  	register Sfio_t *sp;
@@ -290,7 +290,7 @@
  	if(sp=shp->sftable[fd])
  		return(sfread(sp,buff,n));
  	else
-@@ -2427,6 +2474,8 @@ ssize_t sh_write(register int fd, const 
+@@ -2509,6 +2552,8 @@ ssize_t sh_write(register int fd, const
  {
  	Shell_t *shp = sh_getinterp();
  	register Sfio_t *sp;
@@ -299,7 +299,7 @@
  	if(sp=shp->sftable[fd])
  		return(sfwrite(sp,buff,n));
  	else
-@@ -2441,6 +2490,8 @@ off_t sh_seek(register int fd, off_t off
+@@ -2523,6 +2568,8 @@ off_t sh_seek(register int fd, off_t off
  {
  	Shell_t *shp = sh_getinterp();
  	register Sfio_t *sp;
@@ -308,7 +308,7 @@
  	if((sp=shp->sftable[fd]) && (sfset(sp,0,0)&(SF_READ|SF_WRITE)))
  		return(sfseek(sp,offset,whence));
  	else
-@@ -2452,6 +2503,9 @@ int sh_dup(register int old)
+@@ -2534,6 +2581,9 @@ int sh_dup(register int old)
  {
  	Shell_t *shp = sh_getinterp();
  	register int fd = dup(old);
@@ -318,7 +318,7 @@
  	if(fd>=0)
  	{
  		if(shp->fdstatus[old] == IOCLOSE)
-@@ -2473,13 +2527,15 @@ int sh_fcntl(register int fd, int op, ..
+@@ -2555,13 +2605,15 @@ int sh_fcntl(register int fd, int op, ..
  	arg =  va_arg(ap, int) ;
  	va_end(ap);
  	newfd = fcntl(fd,op,arg);
@@ -336,7 +336,7 @@
  		shp->fdstatus[newfd] = (shp->fdstatus[fd]&~IOCLEX);
  		if(fdnotify)
  			(*fdnotify)(fd,newfd);
-@@ -2548,6 +2604,7 @@ Sfio_t *sh_iogetiop(int fd, int mode)
+@@ -2630,6 +2682,7 @@ Sfio_t *sh_iogetiop(int fd, int mode)
  		return(iop);
  	if(mode==SF_READ && !(n&IOREAD))
  		return(iop);
@@ -344,7 +344,7 @@
  	if(!(iop = shp->sftable[fd]))
  		iop=sh_iostream(shp,fd);
  	return(iop);
-@@ -2567,7 +2624,10 @@ Sfio_t	*sh_fd2sfio(int fd)
+@@ -2649,7 +2702,10 @@ Sfio_t	*sh_fd2sfio(int fd)
  {
  	Shell_t	*shp = sh_getinterp();
  	register int status;
@@ -356,9 +356,8 @@
  	if(!sp  && (status = sh_iocheckfd(shp,fd))!=IOCLOSE)
  	{
  		register int flags=0;
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/lex.c INIT.2011-02-08/src/cmd/ksh93/sh/lex.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/lex.c	2012-05-02 03:16:17.388010187 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/lex.c	2012-05-02 03:17:53.567785551 -0700
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/lex.c	2015-02-24 13:25:19.370183959 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/lex.c	2015-03-04 13:27:49.211457345 -0800
 @@ -25,6 +25,9 @@
   * AT&T Labs
   *
@@ -369,7 +368,7 @@
  
  #include	<ast.h>
  #include	<stak.h>
-@@ -2053,6 +2056,7 @@ void	sh_syntax(Lex_t *lp)
+@@ -2122,6 +2125,7 @@ void	sh_syntax(Lex_t *lp)
  	else
  		lp->lastline = shp->inlineno;
  	tokstr = fmttoken(lp,tok,tokbuf);
@@ -377,10 +376,9 @@
  	if((sp=fcfile()) || (shp->infd>=0 && (sp=shp->sftable[shp->infd])))
  	{
  		/* clear out any pending input */
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/macro.c INIT.2011-02-08/src/cmd/ksh93/sh/macro.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/macro.c	2012-05-02 03:16:26.100861446 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/macro.c	2012-05-02 03:17:53.569195199 -0700
-@@ -2086,6 +2086,7 @@ static void comsubst(Mac_t *mp,register 
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/macro.c	2015-02-24 13:25:19.363200741 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/macro.c	2015-03-04 13:27:49.212566247 -0800
+@@ -2121,6 +2121,7 @@ static void comsubst(Mac_t *mp,register
  			sh_popcontext(mp->shp,&buff);
  			if(r==0 && ip && (ip->iofile&IOLSEEK))
  			{
@@ -388,9 +386,8 @@
  				if(sp=mp->shp->sftable[fd])
  					num = sftell(sp);
  				else
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/main.c INIT.2011-02-08/src/cmd/ksh93/sh/main.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/main.c	2012-05-02 03:16:17.389138504 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/main.c	2012-05-02 03:17:53.570027033 -0700
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/main.c	2015-02-24 13:25:19.364162232 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/main.c	2015-03-04 13:27:49.213386462 -0800
 @@ -26,6 +26,9 @@
   * AT&T Labs
   *
@@ -401,7 +398,7 @@
  
  #include	<ast.h>
  #include	<sfio.h>
-@@ -396,8 +399,10 @@ static void	exfile(register Shell_t *shp
+@@ -376,8 +379,10 @@ static void	exfile(register Shell_t *shp
  		if(fno > 0)
  		{
  			int r;
@@ -412,9 +409,8 @@
  				shp->fdstatus[r] = shp->fdstatus[fno];
  				sh_close(fno);
  				fno = r;
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/path.c INIT.2011-02-08/src/cmd/ksh93/sh/path.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/path.c	2012-05-02 03:16:20.752378905 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/path.c	2012-05-02 03:17:53.571078341 -0700
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/path.c	2015-02-24 13:25:19.360898415 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/path.c	2015-03-04 13:27:49.214381188 -0800
 @@ -23,6 +23,9 @@
   * AT&T Labs
   *
@@ -425,7 +421,7 @@
  
  #include	"defs.h"
  #include	<fcin.h>
-@@ -1239,6 +1242,7 @@ static void exscript(Shell_t *shp,regist
+@@ -1272,6 +1275,7 @@ static void exscript(Shell_t *shp,regist
  	if(sp=fcfile())
  		while(sfstack(sp,SF_POPSTACK));
  	job_clear();
@@ -433,10 +429,9 @@
  	if(shp->infd>0 && (shp->fdstatus[shp->infd]&IOCLEX))
  		sh_close(shp->infd);
  	sh_setstate(sh_state(SH_FORKED));
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/subshell.c INIT.2011-02-08/src/cmd/ksh93/sh/subshell.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/subshell.c	2012-05-02 03:16:25.241021529 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/subshell.c	2012-05-02 03:17:53.571942019 -0700
-@@ -115,6 +115,7 @@ void	sh_subtmpfile(Shell_t *shp)
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/subshell.c	2015-02-24 13:25:19.363479570 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/subshell.c	2015-03-04 14:05:03.665801329 -0800
+@@ -125,6 +125,7 @@ void	sh_subtmpfile(Shell_t *shp)
  		if((sp->tmpfd = fd = fcntl(1,F_DUPFD,10)) >= 0)
  		{
  			fcntl(fd,F_SETFD,FD_CLOEXEC);
@@ -444,7 +439,7 @@
  			shp->fdstatus[fd] = shp->fdstatus[1]|IOCLEX;
  			close(1);
  		}
-@@ -141,6 +142,7 @@ void	sh_subtmpfile(Shell_t *shp)
+@@ -151,6 +152,7 @@ void	sh_subtmpfile(Shell_t *shp)
  		}
  		else
  		{
@@ -452,35 +447,36 @@
  			shp->fdstatus[fd] = IOREAD|IOWRITE;
  			sfsync(sfstdout);
  			if(fd==1)
-@@ -627,6 +629,7 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_
+@@ -679,8 +681,7 @@ Sfio_t *sh_subshell(Shell_t *shp,Shnode_
  					((struct checkpt*)shp->jmplist)->mode = SH_JMPERREXIT;
  					errormsg(SH_DICT,ERROR_system(1),e_toomany);
  				}
+-				if(fd >= shp->gd->lim.open_max)
+-					sh_iovalidfd(shp,fd);
 +				VALIDATE_FD(shp, fd);
  				shp->sftable[fd] = iop;
  				fcntl(fd,F_SETFD,FD_CLOEXEC);
  				shp->fdstatus[fd] = (shp->fdstatus[1]|IOCLEX);
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/xec.c INIT.2011-02-08/src/cmd/ksh93/sh/xec.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/xec.c	2012-05-02 03:16:17.393286735 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/xec.c	2012-05-02 03:17:53.574535124 -0700
-@@ -94,6 +94,8 @@ static void iousepipe(Shell_t *shp)
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/xec.c	2015-02-24 13:25:19.365424099 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/xec.c	2015-03-04 14:05:12.823587666 -0800
+@@ -117,6 +117,8 @@ static int iousepipe(Shell_t *shp)
  	usepipe++;
  	fcntl(subpipe[0],F_SETFD,FD_CLOEXEC);
  	subpipe[2] = fcntl(1,F_DUPFD,10);
 +	VALIDATE_FD(shp, subpipe[1]);
-+	VALIDATE_FD(shp, subpipe[2]);
++	VALIDATE_FD(shp, subpipe[2]);	
+ 	fcntl(subpipe[2],F_SETFD,FD_CLOEXEC);
  	shp->fdstatus[subpipe[2]] = shp->fdstatus[1];
  	close(1);
- 	fcntl(subpipe[1],F_DUPFD,1);
-@@ -117,6 +119,7 @@ static void iounpipe(Shell_t *shp)
- 	usepipe = 0;
+@@ -141,6 +143,7 @@ static void iounpipe(Shell_t *shp)
+ 	char buff[SF_BUFSIZE];
  	close(1);
  	fcntl(subpipe[2], F_DUPFD, 1);
 +	VALIDATE_FD(shp, subpipe[2]);
  	shp->fdstatus[1] = shp->fdstatus[subpipe[2]];
+ 	--usepipe;
  	if(subdup) for(n=0; n < 10; n++)
- 	{
-@@ -844,6 +847,7 @@ static int sh_coexec(Shell_t *shp,const 
+@@ -886,6 +889,7 @@ static int sh_coexec(Shell_t *shp,const
  			if(filt > 2)
  			{
  				shp->coutpipe = shp->inpipe[1];
@@ -488,7 +484,7 @@
  				shp->fdptrs[shp->coutpipe] = &shp->coutpipe;
  			}
  		}
-@@ -1487,6 +1491,7 @@ int sh_exec(register const Shnode_t *t, 
+@@ -1646,6 +1650,7 @@ int sh_exec(register const Shnode_t *t,
  						if(shp->cpipe[0]<0 || shp->cpipe[1] < 0)
  						{
  							sh_copipe(shp,shp->outpipe=shp->cpipe,0);
@@ -496,7 +492,7 @@
  							shp->fdptrs[shp->cpipe[0]] = shp->cpipe;
  						}
  						sh_copipe(shp,shp->inpipe=pipes,0);
-@@ -3419,6 +3424,8 @@ static void coproc_init(Shell_t *shp, in
+@@ -3623,6 +3628,8 @@ static void coproc_init(Shell_t *shp, in
  		if((outfd=shp->cpipe[1]) < 10) 
  		{
  		        int fd=fcntl(shp->cpipe[1],F_DUPFD,10);
@@ -505,7 +501,7 @@
  			if(fd>=10)
  			{
  			        shp->fdstatus[fd] = (shp->fdstatus[outfd]&~IOCLEX);
-@@ -3427,6 +3434,9 @@ static void coproc_init(Shell_t *shp, in
+@@ -3631,6 +3638,9 @@ static void coproc_init(Shell_t *shp, in
  				shp->cpipe[1] = fd;
  			}
  		}
@@ -515,7 +511,7 @@
  		if(fcntl(*shp->cpipe,F_SETFD,FD_CLOEXEC)>=0)
  			shp->fdstatus[shp->cpipe[0]] |= IOCLEX;
  		shp->fdptrs[shp->cpipe[0]] = shp->cpipe;
-@@ -3437,7 +3447,9 @@ static void coproc_init(Shell_t *shp, in
+@@ -3641,7 +3651,9 @@ static void coproc_init(Shell_t *shp, in
  	shp->outpipe = shp->cpipe;
  	sh_pipe(shp->inpipe=pipes);
  	shp->coutpipe = shp->inpipe[1];
@@ -525,23 +521,23 @@
  	if(fcntl(shp->outpipe[0],F_SETFD,FD_CLOEXEC)>=0)
  		shp->fdstatus[shp->outpipe[0]] |= IOCLEX;
  }
-@@ -3608,6 +3620,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
+@@ -3812,6 +3824,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
  				int fd = shp->inpipe[1];
- 				sh_iosave(shp,0,buff.topfd,(char*)0);
+ 				sh_iosave(shp,0,buffp->topfd,(char*)0);
  				sh_iorenumber(shp,shp->inpipe[0],0);
 +				VALIDATE_FD(shp, fd);
  				if(fd>=0 && (!(otype&FPOU) || (otype&FCOOP)) && fcntl(fd,F_SETFD,FD_CLOEXEC)>=0)
  					shp->fdstatus[fd] |= IOCLEX;
  			}
-@@ -3619,6 +3632,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
+@@ -3823,6 +3836,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
  #endif /* SHOPT_COSHELL */
- 				sh_iosave(shp,1,buff.topfd,(char*)0);
+ 				sh_iosave(shp,1,buffp->topfd,(char*)0);
  				sh_iorenumber(shp,sh_dup(shp->outpipe[1]),1);
 +				VALIDATE_FD(shp, shp->outpipe[0]);
  				if(fcntl(shp->outpipe[0],F_SETFD,FD_CLOEXEC)>=0)
  					shp->fdstatus[shp->outpipe[0]] |= IOCLEX;
  			}
-@@ -3658,6 +3672,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
+@@ -3862,6 +3876,7 @@ static pid_t sh_ntfork(Shell_t *shp,cons
  			signal(SIGQUIT,sh_fault);
  			signal(SIGINT,sh_fault);
  		}
--- a/components/ksh93/patches/CR7009897.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/macro.c INIT.2011-02-08/src/cmd/ksh93/sh/macro.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/macro.c	2012-05-02 01:59:48.571110152 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/macro.c	2012-05-02 02:05:56.082206972 -0700
-@@ -1262,7 +1262,7 @@ retry1:
- 				stkseek(stkp,stktell(stkp)-2);
- 				nv_local = 1;
- 			}
--			else
-+			else if (type != M_VNAME)
- 			{
- 				stkseek(stkp,stktell(stkp)-1);
- 				type = M_TREE;
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/nvtree.c INIT.2011-02-08/src/cmd/ksh93/sh/nvtree.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/nvtree.c	2012-05-02 01:59:52.497548227 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/nvtree.c	2012-05-02 02:07:16.084944399 -0700
-@@ -1069,7 +1069,7 @@ Namfun_t *nv_isvtree(Namval_t *np)
-  */
- char *nv_getvtree(register Namval_t *np, Namfun_t *fp)
- {
--	int flags=0, dsize=fp->dsize;
-+	int flags=0;
- 	for(; fp && fp->next; fp=fp->next)
- 	{
- 		if(fp->next->disc && (fp->next->disc->getnum || fp->next->disc->getval))
-@@ -1083,7 +1083,7 @@ char *nv_getvtree(register Namval_t *np,
- 		nv_offattr(np,NV_EXPORT);
- 	if(flags |= nv_isattr(np,NV_TABLE))
- 		nv_offattr(np,NV_TABLE);
--	if(dsize && (flags&NV_EXPORT))
-+	if( (fp) && (fp->dsize) && (flags&NV_EXPORT))
- 		return("()");
- 	return(walk_tree(np,(Namval_t*)0,flags));
- }
--- a/components/ksh93/patches/CR7032068.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/CR7032068.patch	Thu May 26 22:52:21 2016 -0700
@@ -1,7 +1,8 @@
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/macro.c INIT.2011-02-08/src/cmd/ksh93/sh/macro.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/macro.c	2012-05-02 03:34:48.830258020 -0700
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/macro.c	2012-05-02 03:42:51.584924888 -0700
-@@ -1084,7 +1084,7 @@ static int varsub(Mac_t *mp)
+This patch has been developed inhouse. This fixes a Solaris
+specific issue and has not been submitted to the community.
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/macro.c	2015-02-24 13:25:19.363200741 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/macro.c	2015-03-05 11:11:46.044880541 -0800
+@@ -1086,7 +1086,7 @@ static int varsub(Mac_t *mp)
  {
  	register int	c;
  	register int	type=0; /* M_xxx */
@@ -10,20 +11,25 @@
  	register Namval_t	*np = NIL(Namval_t*);
  	register int 	dolg=0, mode=0;
  	Lex_t		*lp = (Lex_t*)mp->shp->lex_context;
-@@ -1436,6 +1436,7 @@ retry1:
- 				if( (mp->arith||mp->let) && (np->nvfun || nv_isattr(np,(NV_LJUST|NV_RJUST|NV_ZFILL))) && !nv_isattr(np,NV_INTEGER) && (offset==0 || !isalnum(c)))
+@@ -1439,6 +1439,7 @@ retry1:
+ 				if((mp->let || (mp->arith&&nv_isattr(np,(NV_LJUST|NV_RJUST|NV_ZFILL)))) && !nv_isattr(np,NV_INTEGER) && (offset==0 || isspace(c) || strchr(",.+-*/=%&|^?!<>",c)))
  					mp->zeros = 1;
  			}
 +			new_v = v = strdup(v);
  			if(savptr==stakptr(0))
  				stkseek(stkp,offset);
  			else
-@@ -1963,8 +1964,12 @@ retry2:
+@@ -1989,6 +1990,8 @@ retry2:
  	}
  	if(np)
  		nv_close(np);
-+ 	if (new_v)
++	if (new_v)
 +		free(new_v);
+ 	if(pattern)
+ 		free(pattern);
+ 	if(repstr)
+@@ -1997,6 +2000,8 @@ retry2:
+ 		free(idx);
  	return(1);
  nosub:
 +	if (new_v)
--- a/components/ksh93/patches/CR7032821.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/jobs.c INIT.2011-02-08/src/cmd/ksh93/sh/jobs.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/jobs.c	2012-05-08 12:44:12.309610229 +0100
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/jobs.c	2012-05-08 12:48:34.559797683 +0100
-@@ -950,6 +950,7 @@ int job_walk(Sfio_t *file,int (*fun)(str
- 			if(!(pw = job_bypid(pid)))
- 			{
- 				pw = &dummy;
-+				pw->p_shp = sh_getinterp();
- 				pw->p_pid = pid;
- 				pw->p_pgrp = pid;
- 			}
--- a/components/ksh93/patches/CR7033181.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- a/src/cmd/ksh93/bltins/typeset.c	Fri Dec 31 00:15:57 2010
-+++ b/src/cmd/ksh93/bltins/typeset.c	Tue Jun 28 13:59:53 2011
-@@ -608,7 +608,7 @@
- 			}
- 			if(!nv_isarray(np) && !strchr(name,'=') && !(shp->envlist  && nv_onlist(shp->envlist,name)))
- 			{
--				if(comvar || (shp->last_root==shp->var_tree && (tp->tp || (!shp->st.real_fun && (nvflags&NV_STATIC)) || (!(flag&NV_EXPORT) && nv_isattr(np,(NV_EXPORT|NV_IMPORT))==(NV_EXPORT|NV_IMPORT)))))
-+				if(comvar || (shp->last_root==shp->var_tree && (tp->tp || (!shp->st.real_fun && (nvflags&NV_STATIC)) || (!(flag&(NV_EXPORT|NV_RDONLY)) && nv_isattr(np,(NV_EXPORT|NV_IMPORT))==(NV_EXPORT|NV_IMPORT)))))
- {
- 					_nv_unset(np,0);
- }
--- a/components/ksh93/patches/CR7036535.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/CR7036535.patch	Thu May 26 22:52:21 2016 -0700
@@ -1,15 +1,16 @@
---- a/src/cmd/ksh93/sh/path.c	Mon Nov 22 20:55:38 2010
-+++ b/src/cmd/ksh93/sh/path.c	Tue Sep 27 10:48:45 2011
-@@ -1430,7 +1435,7 @@
+# Solaris specific issue. Not submitted to the community.
+--- a/src/cmd/ksh93/sh/path.c	2015-02-24 13:25:19.360898415 -0800
++++ b/src/cmd/ksh93/sh/path.c	2015-02-25 00:54:42.168155178 -0800
+@@ -1463,7 +1463,7 @@
  		len = strlen(name);
  	for(pp=first; pp; pp=pp->next)
  	{
--		if(memcmp(name,pp->name,len)==0 && (pp->name[len]==':' || pp->name[len]==0))
-+		if(strncmp(name,pp->name,len)==0 && (pp->name[len]==':' || pp->name[len]==0))
+-		if(len == pp->len && memcmp(name,pp->name,len)==0)
++		if(len == pp->len && strncmp(name,pp->name,len)==0)
  		{
  			pp->flags |= flag;
  			return(first);
-@@ -1740,7 +1745,7 @@
+@@ -1751,7 +1751,7 @@
  	register Pathcomp_t *pp=first;
  	while(pp)
  	{
@@ -66,3 +67,4 @@
  			{
  				int	k=1;
  				Namarr_t *ap=0;
+
--- a/components/ksh93/patches/CR7046434.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-diff -rupN INIT.2011-02-08/src/cmd/ksh93/sh/subshell.c INIT.2011-02-08.clean/src/cmd/ksh93/sh/subshell.c
---- INIT.2011-02-08/src/cmd/ksh93/sh/subshell.c	2012-05-01 10:06:04.621554775 -0700
-+++ INIT.2011-02-08.clean/src/cmd/ksh93/sh/subshell.c	2012-05-01 10:05:25.139965959 -0700
-@@ -241,9 +241,6 @@ Namval_t *sh_assignok(register Namval_t 
- 	/* don't bother with this */
- 	if(!sp->shpwd || np==SH_LEVELNOD || np==L_ARGNOD || np==SH_SUBSCRNOD || np==SH_NAMENOD)
- 		return(np);
--	/* don't bother to save if in newer scope */
--	if(sp->var!=shp->var_tree && shp->last_root==shp->var_tree)
--		return(np);
- 	if((ap=nv_arrayptr(np)) && (mp=nv_opensub(np)))
- 	{
- 		shp->last_root = ap->table;
--- a/components/ksh93/patches/CR7071431.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- a/src/cmd/ksh93/include/ulimit.h	Tue Oct 26 16:25:26 2010
-+++ b/src/cmd/ksh93/include/ulimit.h	Thu Aug 25 10:19:37 2011
-@@ -157,7 +157,7 @@
- 
- typedef struct Limit_s
- {
--	const char	name[8];
-+	const char*	name;
- 	const char*	description;
- 	int		index;
- 	const char*	conf;
--- a/components/ksh93/patches/CR7089799.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/CR7089799.patch	Thu May 26 22:52:21 2016 -0700
@@ -1,19 +1,18 @@
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/io.c INIT.2011-02-08/src/cmd/ksh93/sh/io.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/io.c	2012-05-07 14:33:37.179788579 +0100
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/io.c	2012-05-07 14:39:11.089877123 +0100
-@@ -868,10 +868,10 @@ int sh_iomovefd(register int fdold)
+# This patch has been developed inhouse. This fixes a Solaris specific
+# issue and has not been submitted to the community.
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/io.c	2015-02-24 13:25:19.362427732 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/io.c	2015-03-05 12:11:01.233941923 -0800
+@@ -871,7 +877,6 @@ int sh_iomovefd(register int fdold)
  {
  	Shell_t *shp = sh_getinterp();
  	register int fdnew;
+-	if(fdold >= shp->gd->lim.open_max)
+-		sh_iovalidfd(shp,fdold);
 +	VALIDATE_FD(shp, fdold);
  	if(fdold<0 || fdold>2)
  		return(fdold);
  	fdnew = sh_iomovefd(dup(fdold));
--	VALIDATE_FD(shp, fdold);
- 	VALIDATE_FD(shp, fdnew);
- 	shp->fdstatus[fdnew] = (shp->fdstatus[fdold]&~IOCLEX);
- 	close(fdold);
-@@ -890,6 +890,8 @@ int	sh_pipe(register int pv[])
+@@ -893,6 +899,8 @@ int	sh_pipe(register int pv[])
  		errormsg(SH_DICT,ERROR_system(1),e_pipe);
  	pv[0] = sh_iomovefd(pv[0]);
  	pv[1] = sh_iomovefd(pv[1]);
@@ -22,10 +21,9 @@
  	shp->fdstatus[pv[0]] = IONOSEEK|IOREAD;
  	shp->fdstatus[pv[1]] = IONOSEEK|IOWRITE;
  	sh_subsavefd(pv[0]);
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/sh/path.c INIT.2011-02-08/src/cmd/ksh93/sh/path.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/sh/path.c	2012-05-07 14:33:37.182443770 +0100
-+++ INIT.2011-02-08/src/cmd/ksh93/sh/path.c	2012-05-07 14:40:06.256096054 +0100
-@@ -565,6 +565,7 @@ static int	path_opentype(Shell_t *shp,co
+--- INIT.2012-08-01.old/src/cmd/ksh93/sh/path.c	2015-02-24 13:25:19.360898415 -0800
++++ INIT.2012-08-01/src/cmd/ksh93/sh/path.c	2015-03-05 11:17:55.650549374 -0800
+@@ -534,6 +537,7 @@ static int	path_opentype(Shell_t *shp,co
  	if(fd>=0 && (fd = sh_iomovefd(fd)) > 0)
  	{
  		fcntl(fd,F_SETFD,FD_CLOEXEC);
--- a/components/ksh93/patches/CR7105086.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-diff -r bb8978c251cb -r 6fbea5c30b60 usr/src/cmd/ast/lib/libshell/common/sh/jobs.c
---- a/src/cmd/ksh93/sh/jobs.c	Sun Mar 25 23:19:46 2012 -0700
-+++ b/src/cmd/ksh93/sh/jobs.c	Mon Mar 26 05:09:19 2012 -0700
-@@ -28,6 +28,9 @@
-  *  Rewritten April, 1988
-  *  Revised January, 1992
-  */
-+/*
-+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
-+ */
- 
- #include	"defs.h"
- #include	<wait.h>
-@@ -57,6 +60,7 @@
- {
- 	struct jobsave	*next;
- 	pid_t		pid;
-+	short		curenv;
- 	unsigned short	exitval;
- };
- 
-@@ -232,6 +236,7 @@
- 		jp->pid = pid;
- 		jp->next = bck.list;
- 		bck.list = jp;
-+		jp->curenv = 0;
- 		jp->exitval = 0;
- 	}
- 	return(jp);
-@@ -1790,6 +1795,7 @@
- 			/* save status for future wait */
- 			if(jp = jobsave_create(pw->p_pid))
- 			{
-+				jp->curenv = pw->p_env;
- 				jp->exitval = pw->p_exit;
- 				if(pw->p_flag&P_SIGNALLED)
- 					jp->exitval |= SH_EXITSIG;
-@@ -1967,7 +1973,7 @@
- 	for(jp=bck.list; jp; jp=jpnext)
- 	{
- 		jpnext = jp->next;
--		if(jp->pid==sh.spid)
-+		if(jp->curenv != sh.curenv || jp->pid==sh.spid)
- 		{
- 			jp->next = bp->list;
- 			bp->list = jp;
--- a/components/ksh93/patches/CR7110983.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/CR7110983.patch	Thu May 26 22:52:21 2016 -0700
@@ -1,6 +1,8 @@
+# This patch has been developed inhouse. This fixes a Solaris specific
+# issue and has not been submitted to the community.
 diff -r bb8978c251cb -r 6fbea5c30b60 usr/src/cmd/ast/lib/libshell/common/sh/name.c
---- a/src/cmd/ksh93/sh/name.c	Sun Mar 25 23:19:46 2012 -0700
-+++ b/src/cmd/ksh93/sh/name.c	Mon Mar 26 05:09:19 2012 -0700
+--- a/src/cmd/ksh93/sh/name.c   Sun Mar 25 23:19:46 2012 -0700
++++ b/src/cmd/ksh93/sh/name.c   Mon Mar 26 05:09:19 2012 -0700
 @@ -22,6 +22,9 @@
   * AT&T Labs
   *
@@ -9,16 +11,16 @@
 + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
 + */
  
- #define putenv	___putenv
+ #define putenv ___putenv
  
-@@ -1832,7 +1835,10 @@
- 			else
+@@ -1926,7 +1923,10 @@
  #endif
- 			if(size==0 && nv_isattr(np,NV_HOST)!=NV_HOST &&nv_isattr(np,NV_LJUST|NV_RJUST|NV_ZFILL))
-+			{
- 				nv_setsize(np,size=dot);
-+				tofree = up->cp;
-+			}
- 			else if(size > dot)
- 				dot = size;
- 			else if(nv_isattr(np,NV_LJUST|NV_RJUST)==NV_LJUST && dot>size)
+ 			{
+ 				if(size==0 && nv_isattr(np,NV_HOST)!=NV_HOST &&nv_isattr(np,NV_LJUST|NV_RJUST|NV_ZFILL))
++				{
+ 					nv_setsize(np,size=dot);
++					tofree = up->cp;
++				}
+ 				else if(size > dot)
+ 					dot = size;
+ 				else if(nv_isattr(np,NV_LJUST|NV_RJUST)==NV_LJUST && dot>size)
--- a/components/ksh93/patches/CR7128313.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
---- a/src/cmd/ksh93/sh/path.c
-+++ b/src/cmd/ksh93/sh/path.c
-@@ -1761,6 +1761,7 @@
- 	char *ptr;
- 	if(!pp)
- 		return(NULL);
-+	pp->shp->last_table = 0;
- 	path_nextcomp(pp->shp,pp,nv_name(np),pp);
- 	ptr = stakfreeze(0);
- 	return(ptr+PATH_OFFSET);
--- a/components/ksh93/patches/CR7167466.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/edit/edit.c INIT.2011-02-08/src/cmd/ksh93/edit/edit.c
---- INIT.2011-02-08.clean/src/cmd/ksh93/edit/edit.c	2012-05-10 12:44:32.651317787 +0100
-+++ INIT.2011-02-08/src/cmd/ksh93/edit/edit.c	2012-05-10 12:49:00.804744460 +0100
-@@ -1652,7 +1652,7 @@ int ed_histgen(Edit_t *ep,const char *pa
- 	History_t	*hp;
- 	off_t		offset;
- 	int 		ac=0,l,m,n,index1,index2;
--	char		*cp, **argv, **av, **ar;
-+	char		*cp, **argv=NULL, **av, **ar;
- 	if(!(hp=ep->sh->gd->hist_ptr))
- 		return(0);
- 	if(*pattern=='#')
-@@ -1731,7 +1731,7 @@ int ed_histgen(Edit_t *ep,const char *pa
- 		mplast->next = 0;
- 	}
- 	ep->hlist = (Histmatch_t**)argv;
--	ep->hfirst = ep->hlist[0];
-+	ep->hfirst = ep->hlist ? ep->hlist[0] : NULL;
- 	return(ep->hmax=ac);
- }
- 
--- a/components/ksh93/patches/CR7178717.patch	Wed May 18 14:06:45 2016 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-*** INIT.2011-02-08/src/cmd/ksh93/sh/jobs.c	Tue Jul 10 17:37:30 2012
---- ./jobs.c	Tue Jul 10 18:59:39 2012
-***************
-*** 1969,1985 ****
-  	register struct back_save *bp = (struct back_save*)ptr;
-  	register struct process *pw, *px, *pwnext;
-  	struct jobsave *jpnext;
-  	job_lock();
-! 	for(jp=bck.list; jp; jp=jpnext)
-! 	{
-  		jpnext = jp->next;
-! 		if(jp->curenv != sh.curenv || jp->pid==sh.spid)
-! 		{
-! 			jp->next = bp->list;
-! 			bp->list = jp;
-! 			bp->count++;
-! 		}
-! 		else
-  			job_chksave(jp->pid);
-  	}
-  	for(pw=job.pwlist; pw; pw=pwnext)
---- 1969,2000 ----
-  	register struct back_save *bp = (struct back_save*)ptr;
-  	register struct process *pw, *px, *pwnext;
-  	struct jobsave *jpnext;
-+ 
-  	job_lock();
-! 	for(jp = bck.list; jp != NULL; jp = jpnext) {
-  		jpnext = jp->next;
-! 		if (jp->curenv != sh.curenv || jp->pid == sh.spid) {
-! 			struct jobsave *jp2, *jp2next;
-! 			/*
-! 			 * We may have same pid in both saved list and current
-! 			 * list. We discard the old jobsave by copying the new
-! 			 * one.
-! 			 */
-! 			for (jp2 = bp->list; jp2 != NULL; jp2 = jp2->next) {
-! 				if (jp->pid == jp2->pid)
-! 					break;
-! 			}
-! 			if (jp2 != NULL) {
-! 				jp2next = jp2->next;
-! 				*jp2 = *jp;
-! 				jp2->next = jp2next;
-! 				job_chksave(jp2->pid);
-! 			} else {
-! 				jp->next = bp->list;
-! 				bp->list = jp;
-! 				bp->count++;
-! 			}
-! 		} else
-  			job_chksave(jp->pid);
-  	}
-  	for(pw=job.pwlist; pw; pw=pwnext)
--- a/components/ksh93/patches/CRXXX_Error_Catalog.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/CRXXX_Error_Catalog.patch	Thu May 26 22:52:21 2016 -0700
@@ -1,10 +1,12 @@
---- a/src/cmd/builtin/asa.c	Wed Nov  1 16:47:27 2006
-+++ b/src/cmd/builtin/asa.c	Tue Jun 28 13:59:47 2011
-@@ -110,7 +110,7 @@
+# This patch developed inhouse fixes some Solaris specific issues
+# and has not been submitted to the community.
+--- a/src/cmd/builtin/asa.c	2014-07-14 00:38:14.796528534 -0700
++++ b/src/cmd/builtin/asa.c	2014-07-14 00:38:58.469687039 -0700
+@@ -111,7 +111,7 @@
  	register Sfio_t	*fp;
  	register int	n, reclen=0;
  
--	cmdinit(argc, argv,(void*)0,(const char*)0,0);
+-	cmdinit(argc, argv, (void*)0, (const char*)0, 0);
 +	cmdinit(argc, argv, context, ERROR_CATALOG, 0);
  	while (n = optget(argv, usage)) switch (n)
  	{
--- a/components/ksh93/patches/compiler.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/compiler.patch	Thu May 26 22:52:21 2016 -0700
@@ -1,3 +1,5 @@
+# This patch has been developed inhouse. This is needed for some Solaris specific build 
+# tasks and has not been submitted to the community.
 diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.i386-64 INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.i386-64
 diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.i386-64 INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.i386-64
 --- INIT.2011-02-08/src/cmd/INIT/cc.sol11.i386-64	1970-01-01 01:00:00.000000000 +0100
@@ -24,26 +26,26 @@
 +esac
 +
 +$CC_EXPLICIT -m32 -xc99 -D_XPG6 "$@"
-diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.sun4-64 INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sun4-64
---- INIT.2011-02-08/src/cmd/INIT/cc.sol11.sun4-64	1970-01-01 01:00:00.000000000 +0100
-+++ INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sun4-64	2012-05-18 10:49:20.339537677 +0100
+diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.sparc-64 INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sparc-64
+--- INIT.2011-02-08/src/cmd/INIT/cc.sol11.sparc-64	1970-01-01 01:00:00.000000000 +0100
++++ INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sparc-64	2012-05-18 10:49:20.339537677 +0100
 @@ -0,0 +1,9 @@
-+: solaris.sun4-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2012-05-18 :
++: solaris.sparc-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2012-05-18 :
 +
-+HOSTTYPE=sol11.sun4-64
++HOSTTYPE=sol11.sparc-64
 +
 +case " $* " in
 +*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
 +esac
 +
 +$CC_EXPLICIT -m64 -xc99 -D_XPG6 "$@"
-diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.sun4 INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sun4-64
---- INIT.2011-02-08/src/cmd/INIT/cc.sol11.sun4	1970-01-01 01:00:00.000000000 +0100
-+++ INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sun4	2012-05-18 10:49:20.339537677 +0100
+diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.sparc INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sparc-64
+--- INIT.2011-02-08/src/cmd/INIT/cc.sol11.sparc	1970-01-01 01:00:00.000000000 +0100
++++ INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sparc	2012-05-18 10:49:20.339537677 +0100
 @@ -0,0 +1,9 @@
-+: solaris.sun4 cc wrapper for reasonable ansi C defaults and 32 bit : 2012-05-18 :
++: solaris.sparc cc wrapper for reasonable ansi C defaults and 32 bit : 2012-05-18 :
 +
-+HOSTTYPE=sol11.sun4
++HOSTTYPE=sol11.sparc
 +
 +case " $* " in
 +*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
--- a/components/ksh93/patches/solaris_alias.patch	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/patches/solaris_alias.patch	Thu May 26 22:52:21 2016 -0700
@@ -1,3 +1,6 @@
+# This patch has been developed inhouse and has not been submitted
+# to the community. This is a Solaris specific patch which is needed
+# to implement the /usr/bin/alias Solaris functionality.
 diff -rupN b/lib/package/ast-base.pkg a/lib/package/ast-base.pkg
 --- b/lib/package/ast-base.pkg	2009-09-21 20:35:51.000000000 +0000
 +++ a/lib/package/ast-base.pkg	2011-11-10 16:24:52.515495613 +0000
@@ -5,15 +8,15 @@
  		libdll libexpr libodelta librecsort libsum libuu libvdelta \
  		libbz libz tests 3d coshell cpp cs mam msgcc nmake probe ss \
  		libcoshell libcs libmam libpp libcodex paxlib codexlib \
--		libdss libpz dsslib
-+		libdss libpz dsslib alias
+-		libdss libpz dsslib libtaso
++		libdss libpz dsslib libtaso alias
  
  :COVERS: ast-make ast-ksh ast-ast
  
 diff -rupN b/src/cmd/alias/alias.c a/src/cmd/alias/alias.c
 --- b/src/cmd/alias/alias.c	1970-01-01 00:00:00.000000000 +0000
 +++ a/src/cmd/alias/alias.c	2011-11-10 16:24:28.356925339 +0000
-@@ -0,0 +1,255 @@
+@@ -0,0 +1,256 @@
 +/*
 + * CDDL HEADER START
 + *
@@ -36,7 +39,7 @@
 + */
 +
 +/*
-+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
++ * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
 + */
 +
 +/*
@@ -53,7 +56,7 @@
 +
 +typedef struct {
 +	const char *name;
-+	int (* func)(int, char **, void *);
++	int (* func)(int, char **, Shbltin_t *);
 +} bfastpathrec;
 +
 +/*
@@ -128,8 +131,9 @@
 +	{ "tty",	b_tty		},
 +	{ "uname",	b_uname		},
 +	{ "uniq",	b_uniq		},
++	{ "vmstate",	b_vmstate		},
 +	{ "wc",		b_wc		},
-+	{ NULL, 	(int (*)(int, char **, void *))NULL }
++	{ NULL, 	(int (*)(int, char **, Shbltin_t *))NULL }
 +};
 +
 +static inline
@@ -272,86 +276,87 @@
 diff -rupN b/src/cmd/alias/alias.h a/src/cmd/alias/alias.h
 --- b/src/cmd/alias/alias.h	1970-01-01 00:00:00.000000000 +0000
 +++ a/src/cmd/alias/alias.h	2011-11-10 16:24:28.357387725 +0000
-@@ -0,0 +1,79 @@
+@@ -0,0 +1,67 @@
 +/***********************************************************************
 +*                                                                      *
 +*               This software is part of the ast package               *
-+*          Copyright (c) 1992-2011 AT&T Intellectual Property          *
++*          Copyright (c) 1982-2012 AT&T Intellectual Property          *
 +*                      and is licensed under the                       *
-+*                  Common Public License, Version 1.0                  *
++*                 Eclipse Public License, Version 1.0                  *
 +*                    by AT&T Intellectual Property                     *
 +*                                                                      *
 +*                A copy of the License is available at                 *
-+*            http://www.opensource.org/licenses/cpl1.0.txt             *
-+*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
++*          http://www.eclipse.org/org/documents/epl-v10.html           *
++*         (with md5 checksum b35adb5213ca9657e911e9befb180842)         *
 +*                                                                      *
 +*              Information and Software Systems Research               *
 +*                            AT&T Research                             *
 +*                           Florham Park NJ                            *
 +*                                                                      *
-+*                 Glenn Fowler <[email protected]>                  *
 +*                  David Korn <[email protected]>                   *
 +*                                                                      *
 +***********************************************************************/
 +
-+extern int b_asa (int, char**, void *);
-+extern int b_basename (int, char**, void *);
-+extern int b_cat (int, char**, void *);
-+extern int b_chgrp (int, char**, void *);
-+extern int b_chmod (int, char**, void *);
-+extern int b_chown (int, char**, void *);
-+extern int b_cksum (int, char**, void *);
-+extern int b_cmp (int, char**, void *);
-+extern int b_comm (int, char**, void *);
-+extern int b_cp (int, char**, void *);
-+extern int b_cut (int, char**, void *);
-+extern int b_date (int, char**, void *);
-+extern int b_dirname (int, char**, void *);
-+extern int b_egrep (int, char**, void *);
-+extern int b_expr (int, char**, void *);
-+extern int b_fds (int, char**, void *);
-+extern int b_fgrep (int, char**, void *);
-+extern int b_find (int, char**, void *);
-+extern int b_fmt (int, char**, void *);
-+extern int b_fold (int, char**, void *);
-+extern int b_getconf (int, char**, void *);
-+extern int b_grep (int, char**, void *);
-+extern int b_head (int, char**, void *);
-+extern int b_id (int, char**, void *);
-+extern int b_join (int, char**, void *);
-+extern int b_line (int, char**, void *);
-+extern int b_ln (int, char**, void *);
-+extern int b_logname (int, char**, void *);
-+extern int b_ls (int, char**, void *);
-+extern int b_md5sum (int, char**, void *);
-+extern int b_mkdir (int, char**, void *);
-+extern int b_mkfifo (int, char**, void *);
-+extern int b_mktemp (int, char**, void *);
-+extern int b_mv (int, char**, void *);
-+extern int b_paste (int, char**, void *);
-+extern int b_od (int, char**, void *);
-+extern int b_pathchk (int, char**, void *);
-+extern int b_pids (int, char**, void *);
-+extern int b_pr (int, char**, void *);
-+extern int b_rev (int, char**, void *);
-+extern int b_readlink (int, char**, void *);
-+extern int b_rm (int, char**, void *);
-+extern int b_rmdir (int, char**, void *);
-+extern int b_stty (int, char**, void *);
-+extern int b_sum (int, char**, void *);
-+extern int b_sync (int, char**, void *);
-+extern int b_strings (int, char**, void *);
-+extern int b_tail (int, char**, void *);
-+extern int b_tee (int, char**, void *);
-+extern int b_tr (int, char**, void *);
-+extern int b_tty (int, char**, void *);
-+extern int b_uname (int, char**, void *);
-+extern int b_uniq (int, char**, void *);
-+extern int b_vmstate (int, char**, void *);
-+extern int b_wc (int, char**, void *);
-+extern int b_who (int, char**, void *);
-+extern int b_xgrep (int, char**, void *);
-+extern int b_xargs (int, char**, void *);
++#include <shcmd.h>
++
++extern int b_asa (int, char**, Shbltin_t *);
++extern int b_basename (int, char**, Shbltin_t *);
++extern int b_cat (int, char**, Shbltin_t *);
++extern int b_chgrp (int, char**, Shbltin_t *);
++extern int b_chmod (int, char**, Shbltin_t *);
++extern int b_chown (int, char**, Shbltin_t *);
++extern int b_cksum (int, char**, Shbltin_t *);
++extern int b_cmp (int, char**, Shbltin_t *);
++extern int b_comm (int, char**, Shbltin_t *);
++extern int b_cp (int, char**, Shbltin_t *);
++extern int b_cut (int, char**, Shbltin_t *);
++extern int b_date (int, char**, Shbltin_t *);
++extern int b_dirname (int, char**, Shbltin_t *);
++extern int b_egrep (int, char**, Shbltin_t *);
++extern int b_expr (int, char**, Shbltin_t *);
++extern int b_fds (int, char**, Shbltin_t *);
++extern int b_fgrep (int, char**, Shbltin_t *);
++extern int b_find (int, char**, Shbltin_t *);
++extern int b_fmt (int, char**, Shbltin_t *);
++extern int b_fold (int, char**, Shbltin_t *);
++extern int b_getconf (int, char**, Shbltin_t *);
++extern int b_grep (int, char**, Shbltin_t *);
++extern int b_head (int, char**, Shbltin_t *);
++extern int b_id (int, char**, Shbltin_t *);
++extern int b_join (int, char**, Shbltin_t *);
++extern int b_line (int, char**, Shbltin_t *);
++extern int b_ln (int, char**, Shbltin_t *);
++extern int b_logname (int, char**, Shbltin_t *);
++extern int b_ls (int, char**, Shbltin_t *);
++extern int b_md5sum (int, char**, Shbltin_t *);
++extern int b_mkdir (int, char**, Shbltin_t *);
++extern int b_mkfifo (int, char**, Shbltin_t *);
++extern int b_mktemp (int, char**, Shbltin_t *);
++extern int b_mv (int, char**, Shbltin_t *);
++extern int b_paste (int, char**, Shbltin_t *);
++extern int b_od (int, char**, Shbltin_t *);
++extern int b_pathchk (int, char**, Shbltin_t *);
++extern int b_pids (int, char**, Shbltin_t *);
++extern int b_pr (int, char**, Shbltin_t *);
++extern int b_rev (int, char**, Shbltin_t *);
++extern int b_readlink (int, char**, Shbltin_t *);
++extern int b_rm (int, char**, Shbltin_t *);
++extern int b_rmdir (int, char**, Shbltin_t *);
++extern int b_stty (int, char**, Shbltin_t *);
++extern int b_sum (int, char**, Shbltin_t *);
++extern int b_sync (int, char**, Shbltin_t *);
++extern int b_strings (int, char**, Shbltin_t *);
++extern int b_tail (int, char**, Shbltin_t *);
++extern int b_tee (int, char**, Shbltin_t *);
++extern int b_tr (int, char**, Shbltin_t *);
++extern int b_tty (int, char**, Shbltin_t *);
++extern int b_uname (int, char**, Shbltin_t *);
++extern int b_uniq (int, char**, Shbltin_t *);
++extern int b_vmstate (int, char**, Shbltin_t *);
++extern int b_wc (int, char**, Shbltin_t *);
++extern int b_who (int, char**, Shbltin_t *);
++extern int b_xgrep (int, char**, Shbltin_t *);
++extern int b_xargs (int, char**, Shbltin_t *);
 diff -rupN b/src/cmd/alias/Makefile a/src/cmd/alias/Makefile
 --- b/src/cmd/alias/Makefile	1970-01-01 00:00:00.000000000 +0000
 +++ a/src/cmd/alias/Makefile	2011-11-10 16:24:28.357746164 +0000
--- a/components/ksh93/source-demo-ksh93.p5m	Wed May 18 14:06:45 2016 -0700
+++ b/components/ksh93/source-demo-ksh93.p5m	Thu May 26 22:52:21 2016 -0700
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 # The man pages are all at the top of a "files" directory; setting the hash to
@@ -58,7 +58,7 @@
 file path=usr/share/man/man1/dirs.1
 file path=usr/share/man/man1/popd.1
 file path=usr/share/man/man1/pushd.1
-license ksh93.license license=CPL
+license ksh93.license license=EPL1.0
 # Ensure that we upgrade the old package to the version where it's
 # renamed.
 depend type=optional fmri=pkg:/source/demo/[email protected]