From 98fd270b057fe98699a342305684e0f86687fea8 Mon Sep 17 00:00:00 2001 From: Tomas Smetana Date: Jan 30 2008 07:31:34 +0000 Subject: - fix #430602 - ksh segfaults after unsetting OPTIND --- diff --git a/ksh-20071105-optind.patch b/ksh-20071105-optind.patch new file mode 100644 index 0000000..2963310 --- /dev/null +++ b/ksh-20071105-optind.patch @@ -0,0 +1,12 @@ +diff -up ksh-20071105/src/cmd/ksh93/sh/init.c.optind ksh-20071105/src/cmd/ksh93/sh/init.c +--- ksh-20071105/src/cmd/ksh93/sh/init.c.optind 2008-01-30 07:56:28.000000000 +0100 ++++ ksh-20071105/src/cmd/ksh93/sh/init.c 2008-01-30 07:57:19.000000000 +0100 +@@ -198,6 +198,8 @@ static void put_optindex(Namval_t* np,co + Shell_t *shp = ((struct shell*)fp)->sh; + shp->st.opterror = shp->st.optchar = 0; + nv_putv(np, val, flags, fp); ++ if(!val) ++ nv_disc(np,fp,NV_POP); + } + + static Sfdouble_t nget_optindex(register Namval_t* np, Namfun_t *fp) diff --git a/ksh.spec b/ksh.spec index 578354d..bc194bd 100644 --- a/ksh.spec +++ b/ksh.spec @@ -8,7 +8,7 @@ URL: http://www.kornshell.com/ Group: System Environment/Shells License: Common Public License Version 1.0 Version: 20071105 -Release: 2%{?dist} +Release: 3%{?dist} Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz Source2: http://www.research.att.com/~gsf/download/tgz/ast-ksh-locale.%{releasedate}.tgz @@ -19,6 +19,7 @@ Patch3: ksh-20070328-builtins.patch Patch4: ksh-20070328-ttou.patch Patch5: ksh-20070628-unaligned.patch Patch6: ksh-20071105-ifs.patch +Patch7: ksh-20071105-optind.patch # for debugging only: #Patch100: ksh-20060124-iffedebug.patch @@ -48,6 +49,7 @@ with "sh" (the Bourne Shell). %patch4 -p1 -b .ttou %patch5 -p1 -b .unaligned %patch6 -p1 -b .ifs +%patch7 -p1 -b .optind #patch100 -p1 -b .iffedebug %build @@ -106,6 +108,9 @@ fi rm -rf $RPM_BUILD_ROOT %changelog +* Wed Jan 30 2008 Tomas Smetana 20071105-3 +- fix #430602 - ksh segfaults after unsetting OPTIND + * Mon Jan 07 2008 Tomas Smetana 20071105-2 - fix #405381 - ksh will not handle $(xxx) when typeset -r IFS - fix #386501 - bad group in spec file