fix array definition being treated as fixed array

fix suspend crashing ksh
This commit is contained in:
Michal Hlavinka 2011-03-29 17:21:19 +02:00
parent 524fb3b137
commit 45d8d3ce89
3 changed files with 37 additions and 1 deletions

12
ksh-20110208-arrays.patch Normal file
View File

@ -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)

View File

@ -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;
}

View File

@ -6,7 +6,7 @@ URL: http://www.kornshell.com/
Group: System Environment/Shells Group: System Environment/Shells
License: CPL License: CPL
Version: 20110208 Version: 20110208
Release: 2%{?dist} Release: 3%{?dist}
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz 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 Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz
Source3: kshrc.rhs Source3: kshrc.rhs
@ -22,6 +22,13 @@ Patch2: ksh-20100826-fixregr.patch
Patch3: ksh-20110208-clist.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) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Conflicts: pdksh Conflicts: pdksh
Requires: coreutils, glibc-common, diffutils Requires: coreutils, glibc-common, diffutils
@ -43,6 +50,8 @@ with "sh" (the Bourne Shell).
%patch1 -p1 -b .builtins %patch1 -p1 -b .builtins
%patch2 -p1 -b .fixregr %patch2 -p1 -b .fixregr
%patch3 -p1 -b .clist %patch3 -p1 -b .clist
%patch4 -p1 -b .oddarrays
%patch5 -p1 -b .suspend
#/dev/fd test does not work because of mock #/dev/fd test does not work because of mock
sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options 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 rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Tue Mar 29 2011 Michal Hlavinka <mhlavink@redhat.com> - 20110208-3
- fix array definition being treated as fixed array
- fix suspend crashing ksh
* Mon Mar 07 2011 Michal Hlavinka <mhlavink@redhat.com> - 20110208-2 * Mon Mar 07 2011 Michal Hlavinka <mhlavink@redhat.com> - 20110208-2
- fix ( ) compound list altering environment - fix ( ) compound list altering environment