[ksh/f22] exporting fixed with variable corrupted its data (#1192027)
Michal Hlavinka
mhlavink at fedoraproject.org
Fri Mar 6 16:18:24 UTC 2015
commit fbd6130339f232d097d00b31faa5d92be22d6c81
Author: Michal Hlavinka <mhlavink at redhat.com>
Date: Fri Mar 6 17:07:01 2015 +0100
exporting fixed with variable corrupted its data (#1192027)
ksh-20120801-xufix.patch | 29 +++++++++++++++++++++++++++++
ksh.spec | 13 ++++++++-----
2 files changed, 37 insertions(+), 5 deletions(-)
---
diff --git a/ksh-20120801-xufix.patch b/ksh-20120801-xufix.patch
new file mode 100644
index 0000000..496e0bf
--- /dev/null
+++ b/ksh-20120801-xufix.patch
@@ -0,0 +1,29 @@
+diff -up ksh-20120801/src/cmd/ksh93/bltins/typeset.c.xufix ksh-20120801/src/cmd/ksh93/bltins/typeset.c
+--- ksh-20120801/src/cmd/ksh93/bltins/typeset.c.xufix 2015-02-03 14:47:23.266022137 +0100
++++ ksh-20120801/src/cmd/ksh93/bltins/typeset.c 2015-02-03 14:47:23.308022046 +0100
+@@ -93,6 +93,8 @@ int b_readonly(int argc,char *argv[],
+ memset((void*)&tdata,0,sizeof(tdata));
+ tdata.sh = context->shp;
+ tdata.aflag = '-';
++ /* do not change size */
++ tdata.argnum = -1;
+ while((flag = optget(argv,*command=='e'?sh_optexport:sh_optreadonly))) switch(flag)
+ {
+ case 'p':
+diff -up ksh-20120801/src/cmd/ksh93/sh/name.c.xufix ksh-20120801/src/cmd/ksh93/sh/name.c
+--- ksh-20120801/src/cmd/ksh93/sh/name.c.xufix 2015-02-03 14:47:23.281022105 +0100
++++ ksh-20120801/src/cmd/ksh93/sh/name.c 2015-02-03 14:52:08.768404194 +0100
+@@ -3019,10 +3019,12 @@ void nv_newattr (register Namval_t *np,
+ nv_onattr(np,NV_EXPORT);
+ sh_envput(shp->env,np);
+ }
+- if((n^newatts)==NV_EXPORT)
++ if((n^newatts)==NV_EXPORT && size==-1)
+ return;
+ }
+ oldsize = nv_size(np);
++ if (size == -1)
++ size = oldsize;
+ if((size==oldsize|| (n&NV_INTEGER)) && !trans && ((n^newatts)&~NV_NOCHANGE)==0)
+ {
+ if(size)
diff --git a/ksh.spec b/ksh.spec
index f0ba663..19e0c36 100644
--- a/ksh.spec
+++ b/ksh.spec
@@ -9,7 +9,7 @@ Group: System Environment/Shells
#CPL everywhere else (for KSH itself)
License: CPL
Version: %{releasedate}
-Release: 21%{?dist}
+Release: 22%{?dist}
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{release_date}.tgz
Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{release_date}.tgz
Source2: kshcomp.conf
@@ -22,6 +22,9 @@ Source5: expectedresults.log
# don't use not wanted/needed builtins - Fedora/RHEL specific
Patch1: ksh-20070328-builtins.patch
+# fix regression test suite to be usable during packagebuild - Fedora/RHEL specific
+Patch2: ksh-20100826-fixregr.patch
+
# fedora/rhel specific, rhbz#619692
Patch6: ksh-20080202-manfix.patch
@@ -53,9 +56,6 @@ Patch27: ksh-20120801-macro.patch
# not completely upstream yet, rhbz#858263
Patch29: ksh-20130628-longer.patch
-# fix regression test suite to be usable during packagebuild - Fedora/RHEL specific
-Patch99: ksh-20100826-fixregr.patch
-
# for ksh <= 2013-07-19, rhbz#982142
Patch30: ksh-20120801-mlikfiks.patch
@@ -139,9 +139,9 @@ with "sh" (the Bourne Shell).
%setup -q -c
%setup -q -T -D -a 1
%patch1 -p1 -b .builtins
+%patch2 -p1 -b .fixregr
%patch6 -p1 -b .manfix
%patch17 -p1 -b .pathvar
-%patch99 -p1 -b .fixregr
%patch18 -p1 -b .fdstatus
%patch19 -p1 -b .rmdirfix
%patch20 -p1 -b .cdfix
@@ -275,6 +275,9 @@ fi
rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Mar 06 2015 Michal Hlavinka <mhlavink at redhat.com> - 20120801-22
+- exporting fixed with variable corrupted its data (#1192027)
+
* Tue Aug 26 2014 Michal Hlavinka <mhlavink at redhat.com> - 20120801-21
- cd builtin file descriptor operations messed with IO redirections (#1133586)
More information about the scm-commits
mailing list