ksh could hang when command substitution printed too much data

This commit is contained in:
Michal Hlavinka 2014-02-11 17:11:40 +01:00
parent 1e4207d538
commit 3c988bff02
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff -up ksh-20120801/src/cmd/ksh93/sh/xec.c.bigsubst ksh-20120801/src/cmd/ksh93/sh/xec.c
--- ksh-20120801/src/cmd/ksh93/sh/xec.c.bigsubst 2014-02-11 08:54:30.113556940 +0100
+++ ksh-20120801/src/cmd/ksh93/sh/xec.c 2014-02-11 08:54:30.141556816 +0100
@@ -1772,7 +1772,7 @@ int sh_exec(register const Shnode_t *t,
}
if(shp->pipepid)
shp->pipepid = parent;
- else
+ else if(shp->comsub!=1)
{
job_wait(parent);
if(parent==shp->spid)

View File

@ -6,7 +6,7 @@ URL: http://www.kornshell.com/
Group: System Environment/Shells Group: System Environment/Shells
License: EPL License: EPL
Version: 20120801 Version: 20120801
Release: 15%{?dist} Release: 16%{?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
Source2: kshcomp.conf Source2: kshcomp.conf
@ -33,6 +33,7 @@ Patch12: ksh-20130628-longer.patch
# for ksh <= 2013-04-09, rhbz#960371 # for ksh <= 2013-04-09, rhbz#960371
Patch13: ksh-20120801-lexfix.patch Patch13: ksh-20120801-lexfix.patch
Patch14: ksh-20120801-bigsubst.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Conflicts: pdksh Conflicts: pdksh
@ -65,6 +66,7 @@ with "sh" (the Bourne Shell).
%patch11 -p1 -b .argvfix %patch11 -p1 -b .argvfix
%patch12 -p1 -b .longer %patch12 -p1 -b .longer
%patch13 -p1 -b .lexfix %patch13 -p1 -b .lexfix
%patch14 -p1 -b .bigsubst
#/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
@ -159,6 +161,9 @@ fi
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Tue Feb 11 2014 Michal Hlavinka <mhlavink@redhat.com> - 20120801-16
- ksh could hang when command substitution printed too much data
* Thu Feb 06 2014 Michal Hlavinka <mhlavink@redhat.com> - 20120801-15 * Thu Feb 06 2014 Michal Hlavinka <mhlavink@redhat.com> - 20120801-15
- fix lexical parser crash (#960371) - fix lexical parser crash (#960371)