17432413 Infinite /bin/sh exec loop in ksh93 s11u1-sru
authorTomas Klacko <tomas.klacko@oracle.com>
Wed, 15 Jan 2014 10:53:25 +0100
branchs11u1-sru
changeset 2897 8ac8e2cc5d84
parent 2889 29acd6c42d2e
child 2899 f4049e7b2a8e
17432413 Infinite /bin/sh exec loop in ksh93
components/ksh93/Makefile
components/ksh93/patches/17432413.patch
--- a/components/ksh93/Makefile	Wed Nov 20 15:46:56 2013 +0100
+++ b/components/ksh93/Makefile	Wed Jan 15 10:53:25 2014 +0100
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 PARFAIT_BUILD=no
 
@@ -74,7 +74,9 @@
 					 CR7168611.patch CR7178717.patch \
 					 CR7175995.patch CR7128313.patch \
 					 Bug15794787,15819673.patch \
-					 Bug15808407.patch Bug17714341.patch
+					 Bug15808407.patch Bug17714341.patch \
+					 17432413.patch
+
 # Fixup HOSTTYPE to match uname output and bits
 HOSTTYPE32=sol11.$(shell uname -p)
 HOSTTYPE64=sol11.$(shell uname -p)-64
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/17432413.patch	Wed Jan 15 10:53:25 2014 +0100
@@ -0,0 +1,23 @@
+--- a/src/cmd/ksh93/sh/init.c
++++ b/src/cmd/ksh93/sh/init.c
+@@ -720,7 +720,7 @@ static char* get_lastarg(Namval_t* np, Namfun_t *fp)
+ 	char	*cp;
+ 	int	pid;
+         if(sh_isstate(SH_INIT) && (cp=shp->lastarg) && *cp=='*' && (pid=strtol(cp+1,&cp,10)) && *cp=='*')
+-		nv_putval(np,(pid==shp->gd->ppid?cp+1:0),0);
++		nv_putval(np,cp+1,0);
+ 	return(shp->lastarg);
+ }
+ 
+--- a/src/cmd/ksh93/sh/main.c
++++ b/src/cmd/ksh93/sh/main.c
+@@ -298,7 +298,7 @@ int sh_main(int ac, char *av[], Shinit_f userinit)
+ 					 */
+ 					if (shp->st.repl_index > 0)
+ 						av[shp->st.repl_index] = shp->st.repl_arg;
+-					if(((type = sh_type(cp = av[0])) & SH_TYPE_SH) && (!(name = nv_getval(L_ARGNOD)) || !((type = sh_type(cp = name)) & SH_TYPE_SH)))
++					if(((type = sh_type(cp = av[0])) & SH_TYPE_SH) && (name = nv_getval(L_ARGNOD)) && (!((type = sh_type(cp = name)) & SH_TYPE_SH)))
+ 					{
+ 						av[0] = (type & SH_TYPE_LOGIN) ? cp : path_basename(cp);
+ 						/*  exec to change $0 for ps */
+