[ksh/f15/master] fix array definition being treated as fixed array fix suspend crashing ksh

Michal Hlavinka mhlavink at fedoraproject.org
Wed Mar 30 06:09:43 UTC 2011


commit 789d001c74cf152f787ee4128df1c86945a17040
Author: Michal Hlavinka <mhlavink at redhat.com>
Date:   Tue Mar 29 18:19:43 2011 +0200

    fix array definition being treated as fixed array
    fix suspend crashing ksh

 ksh-20110208-arrays.patch  |   12 ++++++++++++
 ksh-20110208-suspend.patch |   11 +++++++++++
 ksh.spec                   |   15 ++++++++++++++-
 3 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/ksh-20110208-arrays.patch b/ksh-20110208-arrays.patch
new file mode 100644
index 0000000..a02385d
--- /dev/null
+++ b/ksh-20110208-arrays.patch
@@ -0,0 +1,12 @@
+diff -up ksh-20110208/src/cmd/ksh93/bltins/typeset.c.oddarrays ksh-20110208/src/cmd/ksh93/bltins/typeset.c
+--- ksh-20110208/src/cmd/ksh93/bltins/typeset.c.oddarrays	2010-12-31 01:15:57.000000000 +0100
++++ ksh-20110208/src/cmd/ksh93/bltins/typeset.c	2011-03-29 07:21:03.484519769 +0200
+@@ -587,7 +587,7 @@ static int     b_common(char **argv,regi
+ 				path_alias(np,path_absolute(shp,nv_name(np),NIL(Pathcomp_t*)));
+ 				continue;
+ 			}
+-			np = nv_open(name,troot,nvflags|((nvflags&NV_ASSIGN)?0:NV_ARRAY)|NV_FARRAY);
++			np = nv_open(name,troot,nvflags|((nvflags&NV_ASSIGN)?0:NV_ARRAY)|(iarray?NV_FARRAY:0));
+ 			if(nv_isnull(np) && !nv_isarray(np) && nv_isattr(np,NV_NOFREE))
+ 				nv_offattr(np,NV_NOFREE);
+ 			if(tp->pflag)
diff --git a/ksh-20110208-suspend.patch b/ksh-20110208-suspend.patch
new file mode 100644
index 0000000..de7cee1
--- /dev/null
+++ b/ksh-20110208-suspend.patch
@@ -0,0 +1,11 @@
+diff -up ksh-20110208/src/cmd/ksh93/sh/jobs.c.suspend ksh-20110208/src/cmd/ksh93/sh/jobs.c
+--- ksh-20110208/src/cmd/ksh93/sh/jobs.c.suspend	2010-12-01 17:57:47.000000000 +0100
++++ ksh-20110208/src/cmd/ksh93/sh/jobs.c	2011-03-29 17:01:32.880515568 +0200
+@@ -945,6 +945,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;
+ 			}
diff --git a/ksh.spec b/ksh.spec
index 7f5cf21..15dacc1 100644
--- a/ksh.spec
+++ b/ksh.spec
@@ -6,7 +6,7 @@ URL:          http://www.kornshell.com/
 Group:        System Environment/Shells
 License:      CPL
 Version:      20110208
-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
 Source3:      kshrc.rhs
@@ -22,6 +22,13 @@ Patch2:       ksh-20100826-fixregr.patch
 
 Patch3:       ksh-20110208-clist.patch
 
+#for ksh<=20110329
+Patch4:       ksh-20110208-arrays.patch
+
+#for ksh<=20110329
+Patch5:       ksh-20110208-suspend.patch
+
+
 BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Conflicts:    pdksh
 Requires: coreutils, glibc-common, diffutils
@@ -43,6 +50,8 @@ with "sh" (the Bourne Shell).
 %patch1 -p1 -b .builtins
 %patch2 -p1 -b .fixregr
 %patch3 -p1 -b .clist
+%patch4 -p1 -b .oddarrays
+%patch5 -p1 -b .suspend
 
 #/dev/fd test does not work because of mock
 sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options
@@ -121,6 +130,10 @@ fi
     rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Tue Mar 29 2011 Michal Hlavinka <mhlavink at redhat.com> - 20110208-3
+- fix array definition being treated as fixed array
+- fix suspend crashing ksh
+
 * Mon Mar 07 2011 Michal Hlavinka <mhlavink at redhat.com> - 20110208-2
 - fix ( ) compound list altering environment
 


More information about the scm-commits mailing list