# HG changeset patch # User Tomas Klacko # Date 1389708556 28800 # Node ID 8e90a6f0b109776ad511bb50c92c0a879a5918f4 # Parent 084b9f7b0aa432b6e04f6485b44250bbf273f336 17432413 Infinite /bin/sh exec loop in ksh93 diff -r 084b9f7b0aa4 -r 8e90a6f0b109 components/ksh93/Makefile --- a/components/ksh93/Makefile Mon Jan 13 23:01:50 2014 -0800 +++ b/components/ksh93/Makefile Tue Jan 14 06:09:16 2014 -0800 @@ -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. # include ../../make-rules/shared-macros.mk @@ -76,7 +76,8 @@ 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) diff -r 084b9f7b0aa4 -r 8e90a6f0b109 components/ksh93/patches/17432413.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/components/ksh93/patches/17432413.patch Tue Jan 14 06:09:16 2014 -0800 @@ -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 */ +