From 03a8f96626c118f00aa90730e1a34d50db15aa71 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 01 2017 03:29:35 +0000 Subject: import zsh-5.0.2-28.el7 --- diff --git a/SOURCES/zsh-5.0.2-initialize-prompt-buffer.patch b/SOURCES/zsh-5.0.2-initialize-prompt-buffer.patch new file mode 100644 index 0000000..57d5b1a --- /dev/null +++ b/SOURCES/zsh-5.0.2-initialize-prompt-buffer.patch @@ -0,0 +1,26 @@ +From 277235463256a3a59649613ef50e80ec5460feb0 Mon Sep 17 00:00:00 2001 +From: Paulo Andrade +Date: Tue, 3 Jan 2017 12:29:34 +0100 +Subject: [PATCH] 40260: zero new space allocated in prompt buffer + +Upstream-commit: 8d4c98540de9bcdba8565facc91fbc45855d27e2 +Signed-off-by: Kamil Dudka +--- + Src/prompt.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Src/prompt.c b/Src/prompt.c +index 290f227..6eb98f3 100644 +--- a/Src/prompt.c ++++ b/Src/prompt.c +@@ -862,6 +862,7 @@ addbufspc(int need) + if(need & 255) + need = (need | 255) + 1; + bv->buf = realloc(bv->buf, bv->bufspc += need); ++ memset(bv->buf + bv->bufspc - need, 0, need); + bv->bp = bv->buf + bo; + if(bo1 != -1) + bv->bp1 = bv->buf + bo1; +-- +2.7.4 + diff --git a/SOURCES/zsh-5.0.2-noexec-subscript.patch b/SOURCES/zsh-5.0.2-noexec-subscript.patch new file mode 100644 index 0000000..4f2ea6b --- /dev/null +++ b/SOURCES/zsh-5.0.2-noexec-subscript.patch @@ -0,0 +1,57 @@ +From 2f5bc6482fdddac91a7f06602d65584ebeb41a6c Mon Sep 17 00:00:00 2001 +From: "Barton E. Schaefer" +Date: Wed, 15 Jul 2015 17:51:41 -0700 +Subject: [PATCH] 35799: with NO_EXEC, parse parameter subscript expressions + +Upstream-commit: a0862f6381979b165e864e9c5b97d12432d35d48 +Signed-off-by: Kamil Dudka +--- + Src/params.c | 22 +++++++++++++++------- + 1 file changed, 15 insertions(+), 7 deletions(-) + +diff --git a/Src/params.c b/Src/params.c +index f7551b2..be8394b 100644 +--- a/Src/params.c ++++ b/Src/params.c +@@ -1070,14 +1070,12 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w, + Patprog pprog = NULL; + + /* +- * If in NO_EXEC mode, the parameters won't be set up +- * properly, so there's no point even doing any sanity checking. +- * Just return 0 now. ++ * If in NO_EXEC mode, the parameters won't be set up properly, ++ * so just pretend everything is a hash for subscript parsing + */ +- if (unset(EXECOPT)) +- return 0; + +- ishash = (v->pm && PM_TYPE(v->pm->node.flags) == PM_HASHED); ++ ishash = (unset(EXECOPT) || ++ (v->pm && PM_TYPE(v->pm->node.flags) == PM_HASHED)); + if (prevcharlen) + *prevcharlen = 1; + if (nextcharlen) +@@ -1232,8 +1230,18 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w, + } + if (!c) + return 0; +- s = dupstrpfx(s, t - s); + *str = tt = t; ++ ++ /* ++ * If in NO_EXEC mode, the parameters won't be set up properly, ++ * so there's no additional sanity checking we can do. ++ * Just return 0 now. ++ */ ++ if (unset(EXECOPT)) ++ return 0; ++ ++ s = dupstrpfx(s, t - s); ++ + /* If we're NOT reverse subscripting, strip the inull()s so brackets * + * are not backslashed after parsestr(). Otherwise leave them alone * + * so that the brackets will be escaped when we patcompile() or when * +-- +2.7.4 + diff --git a/SPECS/zsh.spec b/SPECS/zsh.spec index 72920e6..0058423 100644 --- a/SPECS/zsh.spec +++ b/SPECS/zsh.spec @@ -3,7 +3,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.0.2 -Release: 25%{?dist}.1 +Release: 28%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Group: System Environment/Shells @@ -70,6 +70,12 @@ Patch20: zsh-5.0.2-comp-args.patch # fix off-by-one error in completion utility cache code (#1344599) Patch21: zsh-5.0.2-comp-cache.patch +# fix parsing of parameter subscript expression with NOEXEC (#1398740) +Patch22: zsh-5.0.2-noexec-subscript.patch + +# zero new space allocated in prompt buffer (#1408619) +Patch23: zsh-5.0.2-initialize-prompt-buffer.patch + BuildRequires: coreutils sed ncurses-devel libcap-devel BuildRequires: texinfo texi2html gawk hostname Requires(post): /sbin/install-info grep @@ -121,6 +127,8 @@ This package contains the Zsh manual in html format. %patch19 -p1 %patch20 -p1 %patch21 -p1 +%patch22 -p1 +%patch23 -p1 cp -p %SOURCE7 . @@ -237,7 +245,13 @@ fi %doc Doc/*.html %changelog -* Mon Oct 17 2016 Kamil Dudka - 5.0.2-25.el7_3.1 +* Thu Feb 16 2017 Kamil Dudka - 5.0.2-28 +- zero new space allocated in prompt buffer (#1408619) + +* Mon Nov 28 2016 Kamil Dudka - 5.0.2-27 +- fix parsing of parameter subscript expression with NOEXEC (#1398740) + +* Mon Oct 17 2016 Kamil Dudka - 5.0.2-26 - fix crash while parsing the here-document syntax (#1374752) * Thu Jul 14 2016 Kamil Dudka - 5.0.2-25