From 71a78604d43290883023da0897ae012fa0cbc4c8 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 28 Aug 2017 23:09:40 +0200 Subject: [PATCH 01/74] update to latest upstream release: 5.4.2 --- .gitignore | 1 + sources | 2 +- zsh-5.4.1.tar.xz.asc | 11 ----------- zsh-5.4.2.tar.gz.asc | 11 +++++++++++ zsh.spec | 8 ++++++-- 5 files changed, 19 insertions(+), 14 deletions(-) delete mode 100644 zsh-5.4.1.tar.xz.asc create mode 100644 zsh-5.4.2.tar.gz.asc diff --git a/.gitignore b/.gitignore index 6ca8bd2..5bca285 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /zsh-5.*.*.tar.bz2 /zsh-5.*.tar.xz +/zsh-5.4.2.tar.gz diff --git a/sources b/sources index 8b029ff..8a7d03f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.4.1.tar.xz) = c666c54b05e2707e3a3cf9a87a17863792f0c89ec14f5fdc85a3064f26249cfba42a2953bc76bb90205fb87a08c203a165a5240c9fd6c489c13d8cc82ee6e979 +SHA512 (zsh-5.4.2.tar.gz) = 5eaa2ff3dc8052dfb50d2be19bfeed1856b00f7c2dc698129c95c2373a516ee61dba5b42ded390ac20b171abe352b1875f177a4dda8fdc15a4f2a05bb7a024e2 diff --git a/zsh-5.4.1.tar.xz.asc b/zsh-5.4.1.tar.xz.asc deleted file mode 100644 index 7f2f33d..0000000 --- a/zsh-5.4.1.tar.xz.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1 - -iQEcBAABCAAGBQJZif8QAAoJEKcdmp1L2yezOv4H/iO2qf0EZPBIb1Yq2qC1DRYI -6EaqaBkNTHCExURqSW66WzSZkuwv2brtPuzLjFkqmZrWsoW/w5xEKSfsuxfGpQ+c -PvLvXH7rxHGARazUYC1IMFO0WTXnS9Ucrs4k0b6xruKs88M/nD74C8syhaKaPx9/ -Gl/kXjBZWLQsIzJdUCVmo04Y2Xdob9XFwMsRA0tNTw0a5qoMJiMvKt866bwvVUrQ -i/YxcPsIuKBN9llTyjf/EpF2X+SdYw99/ZT0RV60srd949CIG9itAOy5NhC8HeTD -Ici7iOQcDdi0LO0qPeKmnN4Y7DCX2SYyCVAETMykQaIOcol9m/KBTo3CtBExw2I= -=h8ZF ------END PGP SIGNATURE----- diff --git a/zsh-5.4.2.tar.gz.asc b/zsh-5.4.2.tar.gz.asc new file mode 100644 index 0000000..06b0b10 --- /dev/null +++ b/zsh-5.4.2.tar.gz.asc @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQEcBAABCAAGBQJZoyoaAAoJEKcdmp1L2yezt7AIAJ9D+qiWPJZiXCzi7kBU7hoZ +1+3Nr2QXcXBp2ENDktKFY9zygXQ8m65JqpRHUAYSyKeXsIjCaDLPWHG6HNGN+csg +TxAflLapm/d+53ESNLMju5CeNHkV1pdbEE5LmgmPUpOzHwmV092IYVLsLC5d8CEC +c6hMb2cl8/lWv9S/3WYAAa0gKnmcRLGkyyA4iPoH1BsDGuxQfBfU+Vdh+h1wrq/A ++P81UqvutjM0limDyFGngkJoesuVabRettxR0wA24QBh9mIJxPZLL86QISiVD7a1 +SPkzH88E4vjVtTXEau9TxIHLpukJPIoUNPcfeg+hUdfJ6hkLZdsWxtPRvaXgIEw= +=yDM8 +-----END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index 079d152..6696f8b 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,10 +1,11 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.4.1 +Version: 5.4.2 Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ -Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.xz +# FIXME: use .xz once available +Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.gz Source1: zlogin.rhs Source2: zlogout.rhs Source3: zprofile.rhs @@ -168,6 +169,9 @@ fi %doc Doc/*.html %changelog +* Mon Aug 28 2017 Kamil Dudka - 5.4.2-1 +- update to latest upstream release + * Wed Aug 09 2017 Kamil Dudka - 5.4.1-1 - update to latest upstream release From bde7c93140c86926182fe2c592ae011fd541cc05 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Wed, 4 Oct 2017 16:57:55 +0200 Subject: [PATCH 02/74] Resolves: #1441092 - make the call depth limit configurable by $FUNCNEST --- 0001-zsh-5.4.2-funcnest.patch | 563 ++++++++++++++++++++++++++++++++++ zsh.spec | 17 +- 2 files changed, 572 insertions(+), 8 deletions(-) create mode 100644 0001-zsh-5.4.2-funcnest.patch diff --git a/0001-zsh-5.4.2-funcnest.patch b/0001-zsh-5.4.2-funcnest.patch new file mode 100644 index 0000000..4ba6fa0 --- /dev/null +++ b/0001-zsh-5.4.2-funcnest.patch @@ -0,0 +1,563 @@ +From 932bb5a32c7b9a477c5209e62363920efdbc71d1 Mon Sep 17 00:00:00 2001 +From: Peter Stephenson +Date: Fri, 29 Sep 2017 16:46:01 +0100 +Subject: [PATCH 1/2] 41787 (plus minor tweaks): use $FUNCSTACK for function + nesting depth. + +Initialised from existing configuration value. + +Upstream-commit: 174e560a23e40725cd0b50669a52d831342e5246 +Signed-off-by: Kamil Dudka +--- + Doc/Zsh/params.yo | 10 ++++++++++ + Doc/zshparam.1 | 9 +++++++++ + README | 26 +++++++++++++++++++++++++- + Src/exec.c | 17 ++++++----------- + Src/params.c | 14 ++++++++++++++ + Test/C04funcdef.ztst | 8 ++++++++ + configure.ac | 6 +++--- + 7 files changed, 75 insertions(+), 15 deletions(-) + +diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo +index 817496b..26d5039 100644 +--- a/Doc/Zsh/params.yo ++++ b/Doc/Zsh/params.yo +@@ -668,6 +668,16 @@ This value is system dependent and is intended for debugging + purposes. It is also useful with the tt(zsh/system) module which + allows the number to be turned into a name or message. + ) ++vindex(FUNCNEST) ++item(tt(FUNCNEST) )( ++Integer. If greater than or equal to zero, the maximum nesting depth of ++shell functions. When it is exceeded, an error is raised at the point ++where a function is called. The default value is determined when ++the shell is configured, but is typically 500. Increasing ++the value increases the danger of a runaway function recursion ++causing the shell to crash. Setting a negative value turns off ++the check. ++) + vindex(GID) + item(tt(GID) )( + The real group ID of the shell process. If you have sufficient privileges, +diff --git a/Doc/zshparam.1 b/Doc/zshparam.1 +index 44d8629..c7188cb 100644 +--- a/Doc/zshparam.1 ++++ b/Doc/zshparam.1 +@@ -701,6 +701,15 @@ This value is system dependent and is intended for debugging + purposes\&. It is also useful with the \fBzsh/system\fP module which + allows the number to be turned into a name or message\&. + .TP ++\fBFUNCNEST\fP ++Integer\&. If greater than or equal to zero, the maximum nesting depth of ++shell functions\&. When it is exceeded, an error is raised at the point ++where a function is called\&. The default value is determined when ++the shell is configured, but is typically 500\&. Increasing ++the value increases the danger of a runaway function recursion ++causing the shell to crash\&. Setting a negative value turns off ++the check\&. ++.TP + \fBGID\fP + The real group ID of the shell process\&. If you have sufficient privileges, + you may change the group ID of the shell process by assigning to this +diff --git a/README b/README +index e22cfc1..b5c0769 100644 +--- a/README ++++ b/README +@@ -30,9 +30,33 @@ Zsh is a shell with lots of features. For a list of some of these, see the + file FEATURES, and for the latest changes see NEWS. For more + details, see the documentation. + +-Incompatibilities since 5.3.1 ++Incompatibilities since 5.4.2 + ----------------------------- + ++1) The default build-time maximum nested function depth has been ++decreased from 1000 to 500 based on user experience. However, ++it can now be changed at run time via the variable FUNCNEST. ++If you previously configured the shell to set a different value, ++or to remove the check, this is now reflected in the default ++value of the variable. ++ ++2) The syntax ++ ++foo=([key]=value) ++ ++can be used to set elements of arrays and associative arrays. In the ++unlikely event that you need to set an array by matching files using a ++pattern that starts with a character range followed by '=', you need to ++quote the '=', e.g.: ++ ++foo=([aeiou]\=vowel) ++ ++This is only required for array values contained within parentheses; ++command line expansion for normal arguments has not changed. ++ ++Incompatibilities between 5.3.1 and 5.4.2 ++----------------------------------------- ++ + 1) The default behaviour of code like the following has changed: + + alias foo='noglob foo' +diff --git a/Src/exec.c b/Src/exec.c +index cd99733..0f2bb4a 100644 +--- a/Src/exec.c ++++ b/Src/exec.c +@@ -5475,9 +5475,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + struct funcstack fstack; + static int oflags; + Emulation_options save_sticky = NULL; +-#ifdef MAX_FUNCTION_DEPTH + static int funcdepth; +-#endif + Heap funcheap; + + queue_signals(); /* Lots of memory and global state changes coming */ +@@ -5607,13 +5605,12 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + argzero = ztrdup(argzero); + } + } +-#ifdef MAX_FUNCTION_DEPTH +- if(++funcdepth > MAX_FUNCTION_DEPTH) +- { +- zerr("maximum nested function level reached"); +- goto undoshfunc; +- } +-#endif ++ ++funcdepth; ++ if (zsh_funcnest >= 0 && funcdepth > zsh_funcnest) { ++ zerr("maximum nested function level reached; increase FUNCNEST?"); ++ lastval = 1; ++ goto undoshfunc; ++ } + fstack.name = dupstring(name); + /* + * The caller is whatever is immediately before on the stack, +@@ -5652,10 +5649,8 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + runshfunc(prog, wrappers, fstack.name); + doneshfunc: + funcstack = fstack.prev; +-#ifdef MAX_FUNCTION_DEPTH + undoshfunc: + --funcdepth; +-#endif + if (retflag) { + retflag = 0; + breaks = obreaks; +diff --git a/Src/params.c b/Src/params.c +index 6fbee88..9c7833f 100644 +--- a/Src/params.c ++++ b/Src/params.c +@@ -101,6 +101,19 @@ zlong lastval, /* $? */ + rprompt_indent, /* $ZLE_RPROMPT_INDENT */ + ppid, /* $PPID */ + zsh_subshell; /* $ZSH_SUBSHELL */ ++ ++/* $FUNCNEST */ ++/**/ ++mod_export ++zlong zsh_funcnest = ++#ifdef MAX_FUNCTION_DEPTH ++ MAX_FUNCTION_DEPTH ++#else ++ /* Disabled by default but can be enabled at run time */ ++ -1 ++#endif ++ ; ++ + /**/ + zlong lineno, /* $LINENO */ + zoptind, /* $OPTIND */ +@@ -337,6 +350,7 @@ IPDEF5("COLUMNS", &zterm_columns, zlevar_gsu), + IPDEF5("LINES", &zterm_lines, zlevar_gsu), + IPDEF5U("ZLE_RPROMPT_INDENT", &rprompt_indent, rprompt_indent_gsu), + IPDEF5("SHLVL", &shlvl, varinteger_gsu), ++IPDEF5("FUNCNEST", &zsh_funcnest, varinteger_gsu), + + /* Don't import internal integer status variables. */ + #define IPDEF6(A,B,F) {{NULL,A,PM_INTEGER|PM_SPECIAL|PM_DONTIMPORT},BR((void *)B),GSU(F),10,0,NULL,NULL,NULL,0} +diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst +index 6a675e0..0c00a04 100644 +--- a/Test/C04funcdef.ztst ++++ b/Test/C04funcdef.ztst +@@ -515,6 +515,14 @@ + 0:autoload with absolute path not cancelled by bare autoload + >I have been loaded by explicit path. + ++ ( ++ FUNCNEST=0 ++ fn() { true; } ++ fn ++ ) ++1: ++?fn:4: maximum nested function level reached; increase FUNCNEST? ++ + %clean + + rm -f file.in file.out +diff --git a/configure.ac b/configure.ac +index ec0bdae..1a498f8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -415,13 +415,13 @@ ifdef([max_function_depth],[undefine([max_function_depth])])dnl + AH_TEMPLATE([MAX_FUNCTION_DEPTH], + [Define for function depth limits]) + AC_ARG_ENABLE(max-function-depth, +-AC_HELP_STRING([--enable-max-function-depth=MAX], [limit function depth to MAX, default 1000]), ++AC_HELP_STRING([--enable-max-function-depth=MAX], [limit function depth to MAX, default 500]), + [if test x$enableval = xyes; then +- AC_DEFINE(MAX_FUNCTION_DEPTH, 1000) ++ AC_DEFINE(MAX_FUNCTION_DEPTH, 500) + elif test x$enableval != xno; then + AC_DEFINE_UNQUOTED(MAX_FUNCTION_DEPTH, $enableval) + fi], +-[AC_DEFINE(MAX_FUNCTION_DEPTH, 1000)] ++[AC_DEFINE(MAX_FUNCTION_DEPTH, 500)] + ) + + ifdef([default_readnullcmd],[undefine([default_readnullcmd])])dnl +-- +2.13.6 + + +From aee6a617b5769ee6224165560db43bb8b8ee64ba Mon Sep 17 00:00:00 2001 +From: Peter Stephenson +Date: Wed, 4 Oct 2017 09:18:51 +0100 +Subject: [PATCH 2/2] 41802 (minor tweaks): use heap during shell function + call. + +Replaces stack for more efficient memory management. + +Also fix debug message when FUNCNEST is increased. + +Upstream-commit: e573857a033504f7918c4a2309151329820f115f +Signed-off-by: Kamil Dudka +--- + Src/exec.c | 154 +++++++++++++++++++++++++++++++++--------------------------- + Src/parse.c | 3 +- + 2 files changed, 87 insertions(+), 70 deletions(-) + +diff --git a/Src/exec.c b/Src/exec.c +index 0f2bb4a..db77303 100644 +--- a/Src/exec.c ++++ b/Src/exec.c +@@ -41,6 +41,20 @@ enum { + ADDVAR_RESTORE = 1 << 2 + }; + ++/* Structure in which to save values around shell function call */ ++ ++struct funcsave { ++ char opts[OPT_SIZE]; ++ char *argv0; ++ int zoptind, lastval, optcind, numpipestats; ++ int *pipestats; ++ char *scriptname; ++ int breaks, contflag, loops, emulation, noerrexit, oflags, restore_sticky; ++ Emulation_options sticky; ++ struct funcstack fstack; ++}; ++typedef struct funcsave *Funcsave; ++ + /* + * used to suppress ERREXIT and trapping of SIGZERR, SIGEXIT. + * Bits from noerrexit_bits. +@@ -5462,34 +5476,36 @@ int sticky_emulation_differs(Emulation_options sticky2) + mod_export int + doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + { +- char **pptab, **x, *oargv0; +- int oldzoptind, oldlastval, oldoptcind, oldnumpipestats, ret; +- int *oldpipestats = NULL; +- char saveopts[OPT_SIZE], *oldscriptname = scriptname; ++ char **pptab, **x; ++ int ret; + char *name = shfunc->node.nam; +- int flags = shfunc->node.flags, ooflags; +- int savnoerrexit; ++ int flags = shfunc->node.flags; + char *fname = dupstring(name); +- int obreaks, ocontflag, oloops, saveemulation, restore_sticky; + Eprog prog; +- struct funcstack fstack; + static int oflags; +- Emulation_options save_sticky = NULL; + static int funcdepth; + Heap funcheap; + + queue_signals(); /* Lots of memory and global state changes coming */ + + NEWHEAPS(funcheap) { +- oargv0 = NULL; +- obreaks = breaks; +- ocontflag = contflag; +- oloops = loops; ++ /* ++ * Save data in heap rather than on stack to keep recursive ++ * function cost down --- use of heap memory should be efficient ++ * at this point. Saving is not actually massive. ++ */ ++ Funcsave funcsave = zhalloc(sizeof(struct funcsave)); ++ funcsave->scriptname = scriptname; ++ funcsave->argv0 = NULL; ++ funcsave->breaks = breaks; ++ funcsave->contflag = contflag; ++ funcsave->loops = loops; ++ funcsave->lastval = lastval; ++ funcsave->pipestats = NULL; ++ funcsave->numpipestats = numpipestats; ++ funcsave->noerrexit = noerrexit; + if (trap_state == TRAP_STATE_PRIMED) + trap_return--; +- oldlastval = lastval; +- oldnumpipestats = numpipestats; +- savnoerrexit = noerrexit; + /* + * Suppression of ERR_RETURN is turned off in function scope. + */ +@@ -5500,8 +5516,8 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + * immediately by a pushheap/popheap pair. + */ + size_t bytes = sizeof(int)*numpipestats; +- oldpipestats = (int *)zhalloc(bytes); +- memcpy(oldpipestats, pipestats, bytes); ++ funcsave->pipestats = (int *)zhalloc(bytes); ++ memcpy(funcsave->pipestats, pipestats, bytes); + } + + starttrapscope(); +@@ -5510,8 +5526,8 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + pptab = pparams; + if (!(flags & PM_UNDEFINED)) + scriptname = dupstring(name); +- oldzoptind = zoptind; +- oldoptcind = optcind; ++ funcsave->zoptind = zoptind; ++ funcsave->optcind = optcind; + if (!isset(POSIXBUILTINS)) { + zoptind = 1; + optcind = 0; +@@ -5520,9 +5536,9 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + /* We need to save the current options even if LOCALOPTIONS is * + * not currently set. That's because if it gets set in the * + * function we need to restore the original options on exit. */ +- memcpy(saveopts, opts, sizeof(opts)); +- saveemulation = emulation; +- save_sticky = sticky; ++ memcpy(funcsave->opts, opts, sizeof(opts)); ++ funcsave->emulation = emulation; ++ funcsave->sticky = sticky; + + if (sticky_emulation_differs(shfunc->sticky)) { + /* +@@ -5539,7 +5555,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + */ + sticky = sticky_emulation_dup(shfunc->sticky, 1); + emulation = sticky->emulation; +- restore_sticky = 1; ++ funcsave->restore_sticky = 1; + installemulation(emulation, opts); + if (sticky->n_on_opts) { + OptIndex *onptr; +@@ -5558,7 +5574,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + /* All emulations start with pattern disables clear */ + clearpatterndisables(); + } else +- restore_sticky = 0; ++ funcsave->restore_sticky = 0; + + if (flags & (PM_TAGGED|PM_TAGGED_LOCAL)) + opts[XTRACE] = 1; +@@ -5576,11 +5592,11 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + else + opts[WARNNESTEDVAR] = 0; + } +- ooflags = oflags; ++ funcsave->oflags = oflags; + /* + * oflags is static, because we compare it on the next recursive +- * call. Hence also we maintain ooflags for restoring the previous +- * value of oflags after the call. ++ * call. Hence also we maintain a saved version for restoring ++ * the previous value of oflags after the call. + */ + oflags = flags; + opts[PRINTEXITVALUE] = 0; +@@ -5591,7 +5607,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + pparams = x = (char **) zshcalloc(((sizeof *x) * + (1 + countlinknodes(doshargs)))); + if (isset(FUNCTIONARGZERO)) { +- oargv0 = argzero; ++ funcsave->argv0 = argzero; + argzero = ztrdup(getdata(node)); + } + /* first node contains name regardless of option */ +@@ -5601,7 +5617,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + } else { + pparams = (char **) zshcalloc(sizeof *pparams); + if (isset(FUNCTIONARGZERO)) { +- oargv0 = argzero; ++ funcsave->argv0 = argzero; + argzero = ztrdup(argzero); + } + } +@@ -5611,21 +5627,21 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + lastval = 1; + goto undoshfunc; + } +- fstack.name = dupstring(name); ++ funcsave->fstack.name = dupstring(name); + /* + * The caller is whatever is immediately before on the stack, + * unless we're at the top, in which case it's the script + * or interactive shell name. + */ +- fstack.caller = funcstack ? funcstack->name : +- dupstring(oargv0 ? oargv0 : argzero); +- fstack.lineno = lineno; +- fstack.prev = funcstack; +- fstack.tp = FS_FUNC; +- funcstack = &fstack; ++ funcsave->fstack.caller = funcstack ? funcstack->name : ++ dupstring(funcsave->argv0 ? funcsave->argv0 : argzero); ++ funcsave->fstack.lineno = lineno; ++ funcsave->fstack.prev = funcstack; ++ funcsave->fstack.tp = FS_FUNC; ++ funcstack = &funcsave->fstack; + +- fstack.flineno = shfunc->lineno; +- fstack.filename = getshfuncfile(shfunc); ++ funcsave->fstack.flineno = shfunc->lineno; ++ funcsave->fstack.filename = getshfuncfile(shfunc); + + prog = shfunc->funcdef; + if (prog->flags & EF_RUN) { +@@ -5633,7 +5649,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + + prog->flags &= ~EF_RUN; + +- runshfunc(prog, NULL, fstack.name); ++ runshfunc(prog, NULL, funcsave->fstack.name); + + if (!(shf = (Shfunc) shfunctab->getnode(shfunctab, + (name = fname)))) { +@@ -5646,52 +5662,52 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + } + prog = shf->funcdef; + } +- runshfunc(prog, wrappers, fstack.name); ++ runshfunc(prog, wrappers, funcsave->fstack.name); + doneshfunc: +- funcstack = fstack.prev; ++ funcstack = funcsave->fstack.prev; + undoshfunc: + --funcdepth; + if (retflag) { + retflag = 0; +- breaks = obreaks; ++ breaks = funcsave->breaks; + } + freearray(pparams); +- if (oargv0) { ++ if (funcsave->argv0) { + zsfree(argzero); +- argzero = oargv0; ++ argzero = funcsave->argv0; + } + pparams = pptab; + if (!isset(POSIXBUILTINS)) { +- zoptind = oldzoptind; +- optcind = oldoptcind; ++ zoptind = funcsave->zoptind; ++ optcind = funcsave->optcind; + } +- scriptname = oldscriptname; +- oflags = ooflags; ++ scriptname = funcsave->scriptname; ++ oflags = funcsave->oflags; + + endpatternscope(); /* before restoring old LOCALPATTERNS */ + +- if (restore_sticky) { ++ if (funcsave->restore_sticky) { + /* + * If we switched to an emulation environment just for + * this function, we interpret the option and emulation + * switch as being a firewall between environments. + */ +- memcpy(opts, saveopts, sizeof(opts)); +- emulation = saveemulation; +- sticky = save_sticky; ++ memcpy(opts, funcsave->opts, sizeof(opts)); ++ emulation = funcsave->emulation; ++ sticky = funcsave->sticky; + } else if (isset(LOCALOPTIONS)) { + /* restore all shell options except PRIVILEGED and RESTRICTED */ +- saveopts[PRIVILEGED] = opts[PRIVILEGED]; +- saveopts[RESTRICTED] = opts[RESTRICTED]; +- memcpy(opts, saveopts, sizeof(opts)); +- emulation = saveemulation; ++ funcsave->opts[PRIVILEGED] = opts[PRIVILEGED]; ++ funcsave->opts[RESTRICTED] = opts[RESTRICTED]; ++ memcpy(opts, funcsave->opts, sizeof(opts)); ++ emulation = funcsave->emulation; + } else { + /* just restore a couple. */ +- opts[XTRACE] = saveopts[XTRACE]; +- opts[PRINTEXITVALUE] = saveopts[PRINTEXITVALUE]; +- opts[LOCALOPTIONS] = saveopts[LOCALOPTIONS]; +- opts[LOCALLOOPS] = saveopts[LOCALLOOPS]; +- opts[WARNNESTEDVAR] = saveopts[WARNNESTEDVAR]; ++ opts[XTRACE] = funcsave->opts[XTRACE]; ++ opts[PRINTEXITVALUE] = funcsave->opts[PRINTEXITVALUE]; ++ opts[LOCALOPTIONS] = funcsave->opts[LOCALOPTIONS]; ++ opts[LOCALLOOPS] = funcsave->opts[LOCALLOOPS]; ++ opts[WARNNESTEDVAR] = funcsave->opts[WARNNESTEDVAR]; + } + + if (opts[LOCALLOOPS]) { +@@ -5699,9 +5715,9 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + zwarn("`continue' active at end of function scope"); + if (breaks) + zwarn("`break' active at end of function scope"); +- breaks = obreaks; +- contflag = ocontflag; +- loops = oloops; ++ breaks = funcsave->breaks; ++ contflag = funcsave->contflag; ++ loops = funcsave->loops; + } + + endtrapscope(); +@@ -5709,11 +5725,11 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) + if (trap_state == TRAP_STATE_PRIMED) + trap_return++; + ret = lastval; +- noerrexit = savnoerrexit; ++ noerrexit = funcsave->noerrexit; + if (noreturnval) { +- lastval = oldlastval; +- numpipestats = oldnumpipestats; +- memcpy(pipestats, oldpipestats, sizeof(int)*numpipestats); ++ lastval = funcsave->lastval; ++ numpipestats = funcsave->numpipestats; ++ memcpy(pipestats, funcsave->pipestats, sizeof(int)*numpipestats); + } + } OLDHEAPS; + +diff --git a/Src/parse.c b/Src/parse.c +index 2705252..d94ee99 100644 +--- a/Src/parse.c ++++ b/Src/parse.c +@@ -2737,7 +2737,8 @@ freeeprog(Eprog p) + DPUTS(p->nref < 0 && !(p->flags & EF_HEAP), "Real EPROG has nref < 0"); + DPUTS(p->nref < -1, "Uninitialised EPROG nref"); + #ifdef MAX_FUNCTION_DEPTH +- DPUTS(p->nref > MAX_FUNCTION_DEPTH + 10, "Overlarge EPROG nref"); ++ DPUTS(zsh_funcnest >=0 && p->nref > zsh_funcnest + 10, ++ "Overlarge EPROG nref"); + #endif + if (p->nref > 0 && !--p->nref) { + for (i = p->npats, pp = p->pats; i--; pp++) +-- +2.13.6 + diff --git a/zsh.spec b/zsh.spec index 6696f8b..2008cc4 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.4.2 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: http://zsh.sourceforge.net/ # FIXME: use .xz once available @@ -13,6 +13,10 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc +# make the call depth limit configurable by $FUNCNEST (#1441092) +Patch1: 0001-zsh-5.4.2-funcnest.patch + +BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk BuildRequires: gdbm-devel @@ -60,18 +64,12 @@ This package contains the Zsh manual in html format. %prep %autosetup -p1 +autoreconf -fiv # enable parallel build sed -e 's|^\.NOTPARALLEL|#.NOTPARALLEL|' -i 'Config/defs.mk.in' %build -# Compile with -fconserve-stack to prevent stack overflow while executing -# unbounded call recursion in a shell script. Without this compiler flag, -# the default stack allocation limit (8192 KiB) is exceeded before the default -# shell call nesting limit (1000) is reached. See #1441092 for details. -# Minimal example: zsh -c 'foo() { if true; then foo; fi }; foo' -export CFLAGS="$RPM_OPT_FLAGS -fconserve-stack" - # make loading of module's dependencies work again (#1277996) export LIBLDFLAGS='-z lazy' @@ -169,6 +167,9 @@ fi %doc Doc/*.html %changelog +* Wed Oct 04 2017 Kamil Dudka - 5.4.2-2 +- make the call depth limit configurable by $FUNCNEST (#1441092) + * Mon Aug 28 2017 Kamil Dudka - 5.4.2-1 - update to latest upstream release From 71407aafec97017887d2c280db48aefd9bd7d18e Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 16 Jan 2018 18:20:35 +0100 Subject: [PATCH 03/74] Resolves: #1533176 - rebuild against latest gdbm-devel --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 2008cc4..08c352f 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.4.2 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: http://zsh.sourceforge.net/ # FIXME: use .xz once available @@ -167,6 +167,9 @@ fi %doc Doc/*.html %changelog +* Tue Jan 16 2018 Kamil Dudka - 5.4.2-3 +- rebuild against latest gdbm-devel (#1533176) + * Wed Oct 04 2017 Kamil Dudka - 5.4.2-2 - make the call depth limit configurable by $FUNCNEST (#1441092) From 024b7543ed545edab8f262c5f81ef3d29c109bbb Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 22 Jan 2018 17:14:02 +0100 Subject: [PATCH 04/74] Related: #1535422 make build of run-time loadable modules work again --- zsh.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 08c352f..e42bb2c 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.4.2 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT URL: http://zsh.sourceforge.net/ # FIXME: use .xz once available @@ -70,6 +70,9 @@ autoreconf -fiv sed -e 's|^\.NOTPARALLEL|#.NOTPARALLEL|' -i 'Config/defs.mk.in' %build +# make build of run-time loadable modules work again (#1535422) +%undefine _strict_symbol_defs_build + # make loading of module's dependencies work again (#1277996) export LIBLDFLAGS='-z lazy' @@ -167,6 +170,9 @@ fi %doc Doc/*.html %changelog +* Mon Jan 22 2018 Kamil Dudka - 5.4.2-4 +- make build of run-time loadable modules work again (#1535422) + * Tue Jan 16 2018 Kamil Dudka - 5.4.2-3 - rebuild against latest gdbm-devel (#1533176) From 35751b4086211bfe2df26fa71bdcfb0d49630fd1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 22:32:16 +0000 Subject: [PATCH 05/74] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index e42bb2c..b1f0ee3 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.4.2 -Release: 4%{?dist} +Release: 5%{?dist} License: MIT URL: http://zsh.sourceforge.net/ # FIXME: use .xz once available @@ -170,6 +170,9 @@ fi %doc Doc/*.html %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 5.4.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Mon Jan 22 2018 Kamil Dudka - 5.4.2-4 - make build of run-time loadable modules work again (#1535422) From d8fb0ec40b342eaeef20823bc26cb1f0480310b8 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 19 Feb 2018 17:44:44 +0100 Subject: [PATCH 06/74] add explicit BR for the gcc compiler ... as instructed at: https://fedoraproject.org/wiki/Packaging:C_and_C%2B%2B --- zsh.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index b1f0ee3..e1987fa 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.4.2 -Release: 5%{?dist} +Release: 6%{?dist} License: MIT URL: http://zsh.sourceforge.net/ # FIXME: use .xz once available @@ -19,6 +19,7 @@ Patch1: 0001-zsh-5.4.2-funcnest.patch BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk +BuildRequires: gcc BuildRequires: gdbm-devel BuildRequires: libcap-devel BuildRequires: ncurses-devel @@ -170,6 +171,9 @@ fi %doc Doc/*.html %changelog +* Mon Feb 19 2018 Kamil Dudka - 5.4.2-6 +- add explicit BR for the gcc compiler + * Fri Feb 09 2018 Fedora Release Engineering - 5.4.2-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 1ae62648a186d943f6c5791a7957f7f5c7d42ff8 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 6 Mar 2018 16:22:12 +0100 Subject: [PATCH 07/74] Resolves: CVE-2018-7548 - avoid NULL dereference when using ${(PA)...} on an empty array --- 0004-zsh-5.4.2-CVE-2018-7548.patch | 28 ++++++++++++++++++++++++++++ zsh.spec | 8 +++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0004-zsh-5.4.2-CVE-2018-7548.patch diff --git a/0004-zsh-5.4.2-CVE-2018-7548.patch b/0004-zsh-5.4.2-CVE-2018-7548.patch new file mode 100644 index 0000000..944b888 --- /dev/null +++ b/0004-zsh-5.4.2-CVE-2018-7548.patch @@ -0,0 +1,28 @@ +From fc22af40437f4de42f7505ca93361391eab788e3 Mon Sep 17 00:00:00 2001 +From: Joey Pabalinas +Date: Tue, 23 Jan 2018 22:28:08 -0800 +Subject: [PATCH 1/2] 42313: avoid null-pointer deref when using ${(PA)...} on + an empty array result + +Upstream-commit: 110b13e1090bc31ac1352b28adc2d02b6d25a102 +Signed-off-by: Kamil Dudka +--- + Src/subst.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Src/subst.c b/Src/subst.c +index 5b1bf89..94b0207 100644 +--- a/Src/subst.c ++++ b/Src/subst.c +@@ -2340,7 +2340,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, + val = aval[0]; + isarr = 0; + } +- s = dyncat(val, s); ++ s = val ? dyncat(val, s) : dupstring(s); + /* Now behave po-faced as if it was always like that... */ + subexp = 0; + /* +-- +2.14.3 + diff --git a/zsh.spec b/zsh.spec index e1987fa..db8f5c0 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.4.2 -Release: 6%{?dist} +Release: 7%{?dist} License: MIT URL: http://zsh.sourceforge.net/ # FIXME: use .xz once available @@ -16,6 +16,9 @@ Source6: dotzshrc # make the call depth limit configurable by $FUNCNEST (#1441092) Patch1: 0001-zsh-5.4.2-funcnest.patch +# avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) +Patch4: 0004-zsh-5.4.2-CVE-2018-7548.patch + BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -171,6 +174,9 @@ fi %doc Doc/*.html %changelog +* Tue Mar 06 2018 Kamil Dudka - 5.4.2-7 +- avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) + * Mon Feb 19 2018 Kamil Dudka - 5.4.2-6 - add explicit BR for the gcc compiler From 13131778484f9de2b192985a0ea237d186e8f35f Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 6 Mar 2018 16:23:29 +0100 Subject: [PATCH 08/74] Resolves: CVE-2018-7549 - avoid crash when copying empty hash table --- 0005-zsh-5.4.2-CVE-2018-7549.patch | 38 ++++++++++++++++++++++++++++++ zsh.spec | 4 ++++ 2 files changed, 42 insertions(+) create mode 100644 0005-zsh-5.4.2-CVE-2018-7549.patch diff --git a/0005-zsh-5.4.2-CVE-2018-7549.patch b/0005-zsh-5.4.2-CVE-2018-7549.patch new file mode 100644 index 0000000..6dfafe8 --- /dev/null +++ b/0005-zsh-5.4.2-CVE-2018-7549.patch @@ -0,0 +1,38 @@ +From 016b8889a6c30279f6ee362e34262c204ef834c2 Mon Sep 17 00:00:00 2001 +From: Stephane Chazelas +Date: Fri, 22 Dec 2017 22:17:09 +0000 +Subject: [PATCH 2/2] Avoid crash copying empty hash table. + +Visible with typeset -p. + +Upstream-commit: c2cc8b0fbefc9868fa83537f5b6d90fc1ec438dd +Signed-off-by: Kamil Dudka +--- + Src/params.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/Src/params.c b/Src/params.c +index 9c7833f..d9da7f6 100644 +--- a/Src/params.c ++++ b/Src/params.c +@@ -549,10 +549,13 @@ scancopyparams(HashNode hn, UNUSED(int flags)) + HashTable + copyparamtable(HashTable ht, char *name) + { +- HashTable nht = newparamtable(ht->hsize, name); +- outtable = nht; +- scanhashtable(ht, 0, 0, 0, scancopyparams, 0); +- outtable = NULL; ++ HashTable nht = 0; ++ if (ht) { ++ nht = newparamtable(ht->hsize, name); ++ outtable = nht; ++ scanhashtable(ht, 0, 0, 0, scancopyparams, 0); ++ outtable = NULL; ++ } + return nht; + } + +-- +2.14.3 + diff --git a/zsh.spec b/zsh.spec index db8f5c0..aa4a9d5 100644 --- a/zsh.spec +++ b/zsh.spec @@ -19,6 +19,9 @@ Patch1: 0001-zsh-5.4.2-funcnest.patch # avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) Patch4: 0004-zsh-5.4.2-CVE-2018-7548.patch +# avoid crash when copying empty hash table (CVE-2018-7549) +Patch5: 0005-zsh-5.4.2-CVE-2018-7549.patch + BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -175,6 +178,7 @@ fi %changelog * Tue Mar 06 2018 Kamil Dudka - 5.4.2-7 +- avoid crash when copying empty hash table (CVE-2018-7549) - avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) * Mon Feb 19 2018 Kamil Dudka - 5.4.2-6 From 256a07bcfb20f84c4cd3ee67a0a8f69d98b1f5ad Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 6 Mar 2018 16:22:12 +0100 Subject: [PATCH 09/74] Resolves: CVE-2018-7548 - avoid NULL dereference when using ${(PA)...} on an empty array --- 0004-zsh-5.4.2-CVE-2018-7548.patch | 28 ++++++++++++++++++++++++++++ zsh.spec | 8 +++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0004-zsh-5.4.2-CVE-2018-7548.patch diff --git a/0004-zsh-5.4.2-CVE-2018-7548.patch b/0004-zsh-5.4.2-CVE-2018-7548.patch new file mode 100644 index 0000000..944b888 --- /dev/null +++ b/0004-zsh-5.4.2-CVE-2018-7548.patch @@ -0,0 +1,28 @@ +From fc22af40437f4de42f7505ca93361391eab788e3 Mon Sep 17 00:00:00 2001 +From: Joey Pabalinas +Date: Tue, 23 Jan 2018 22:28:08 -0800 +Subject: [PATCH 1/2] 42313: avoid null-pointer deref when using ${(PA)...} on + an empty array result + +Upstream-commit: 110b13e1090bc31ac1352b28adc2d02b6d25a102 +Signed-off-by: Kamil Dudka +--- + Src/subst.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Src/subst.c b/Src/subst.c +index 5b1bf89..94b0207 100644 +--- a/Src/subst.c ++++ b/Src/subst.c +@@ -2340,7 +2340,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, + val = aval[0]; + isarr = 0; + } +- s = dyncat(val, s); ++ s = val ? dyncat(val, s) : dupstring(s); + /* Now behave po-faced as if it was always like that... */ + subexp = 0; + /* +-- +2.14.3 + diff --git a/zsh.spec b/zsh.spec index 079d152..99e81f5 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.4.1 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.xz @@ -12,6 +12,9 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc +# avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) +Patch4: 0004-zsh-5.4.2-CVE-2018-7548.patch + BuildRequires: coreutils BuildRequires: gawk BuildRequires: gdbm-devel @@ -168,6 +171,9 @@ fi %doc Doc/*.html %changelog +* Tue Mar 06 2018 Kamil Dudka - 5.4.1-2 +- avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) + * Wed Aug 09 2017 Kamil Dudka - 5.4.1-1 - update to latest upstream release From 5bfb8a440f9b76efb4f0a65f1a9a182b28a875ac Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 6 Mar 2018 16:23:29 +0100 Subject: [PATCH 10/74] Resolves: CVE-2018-7549 - avoid crash when copying empty hash table --- 0005-zsh-5.4.2-CVE-2018-7549.patch | 38 ++++++++++++++++++++++++++++++ zsh.spec | 4 ++++ 2 files changed, 42 insertions(+) create mode 100644 0005-zsh-5.4.2-CVE-2018-7549.patch diff --git a/0005-zsh-5.4.2-CVE-2018-7549.patch b/0005-zsh-5.4.2-CVE-2018-7549.patch new file mode 100644 index 0000000..6dfafe8 --- /dev/null +++ b/0005-zsh-5.4.2-CVE-2018-7549.patch @@ -0,0 +1,38 @@ +From 016b8889a6c30279f6ee362e34262c204ef834c2 Mon Sep 17 00:00:00 2001 +From: Stephane Chazelas +Date: Fri, 22 Dec 2017 22:17:09 +0000 +Subject: [PATCH 2/2] Avoid crash copying empty hash table. + +Visible with typeset -p. + +Upstream-commit: c2cc8b0fbefc9868fa83537f5b6d90fc1ec438dd +Signed-off-by: Kamil Dudka +--- + Src/params.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/Src/params.c b/Src/params.c +index 9c7833f..d9da7f6 100644 +--- a/Src/params.c ++++ b/Src/params.c +@@ -549,10 +549,13 @@ scancopyparams(HashNode hn, UNUSED(int flags)) + HashTable + copyparamtable(HashTable ht, char *name) + { +- HashTable nht = newparamtable(ht->hsize, name); +- outtable = nht; +- scanhashtable(ht, 0, 0, 0, scancopyparams, 0); +- outtable = NULL; ++ HashTable nht = 0; ++ if (ht) { ++ nht = newparamtable(ht->hsize, name); ++ outtable = nht; ++ scanhashtable(ht, 0, 0, 0, scancopyparams, 0); ++ outtable = NULL; ++ } + return nht; + } + +-- +2.14.3 + diff --git a/zsh.spec b/zsh.spec index 99e81f5..48ed3b6 100644 --- a/zsh.spec +++ b/zsh.spec @@ -15,6 +15,9 @@ Source6: dotzshrc # avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) Patch4: 0004-zsh-5.4.2-CVE-2018-7548.patch +# avoid crash when copying empty hash table (CVE-2018-7549) +Patch5: 0005-zsh-5.4.2-CVE-2018-7549.patch + BuildRequires: coreutils BuildRequires: gawk BuildRequires: gdbm-devel @@ -172,6 +175,7 @@ fi %changelog * Tue Mar 06 2018 Kamil Dudka - 5.4.1-2 +- avoid crash when copying empty hash table (CVE-2018-7549) - avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) * Wed Aug 09 2017 Kamil Dudka - 5.4.1-1 From b106d6314efda1100d33b07841a6b938399565c9 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 9 Apr 2018 11:23:15 +0200 Subject: [PATCH 11/74] update to latest upstream release Resolves: CVE-2018-1100 - stack-based buffer overflow in utils.c:checkmailpath() Resolves: CVE-2018-1083 - stack-based buffer overflow in compctl.c:gen_matches_files() Resolves: CVE-2018-1071 - stack-based buffer overflow in exec.c:hashcmd() --- 0001-zsh-5.4.2-funcnest.patch | 563 ----------------------------- 0004-zsh-5.4.2-CVE-2018-7548.patch | 28 -- 0005-zsh-5.4.2-CVE-2018-7549.patch | 38 -- sources | 2 +- zsh-5.4.2.tar.gz.asc | 11 - zsh-5.5.tar.xz.asc | 11 + zsh.spec | 22 +- zshprompt.pl | 235 ------------ 8 files changed, 21 insertions(+), 889 deletions(-) delete mode 100644 0001-zsh-5.4.2-funcnest.patch delete mode 100644 0004-zsh-5.4.2-CVE-2018-7548.patch delete mode 100644 0005-zsh-5.4.2-CVE-2018-7549.patch delete mode 100644 zsh-5.4.2.tar.gz.asc create mode 100644 zsh-5.5.tar.xz.asc delete mode 100644 zshprompt.pl diff --git a/0001-zsh-5.4.2-funcnest.patch b/0001-zsh-5.4.2-funcnest.patch deleted file mode 100644 index 4ba6fa0..0000000 --- a/0001-zsh-5.4.2-funcnest.patch +++ /dev/null @@ -1,563 +0,0 @@ -From 932bb5a32c7b9a477c5209e62363920efdbc71d1 Mon Sep 17 00:00:00 2001 -From: Peter Stephenson -Date: Fri, 29 Sep 2017 16:46:01 +0100 -Subject: [PATCH 1/2] 41787 (plus minor tweaks): use $FUNCSTACK for function - nesting depth. - -Initialised from existing configuration value. - -Upstream-commit: 174e560a23e40725cd0b50669a52d831342e5246 -Signed-off-by: Kamil Dudka ---- - Doc/Zsh/params.yo | 10 ++++++++++ - Doc/zshparam.1 | 9 +++++++++ - README | 26 +++++++++++++++++++++++++- - Src/exec.c | 17 ++++++----------- - Src/params.c | 14 ++++++++++++++ - Test/C04funcdef.ztst | 8 ++++++++ - configure.ac | 6 +++--- - 7 files changed, 75 insertions(+), 15 deletions(-) - -diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo -index 817496b..26d5039 100644 ---- a/Doc/Zsh/params.yo -+++ b/Doc/Zsh/params.yo -@@ -668,6 +668,16 @@ This value is system dependent and is intended for debugging - purposes. It is also useful with the tt(zsh/system) module which - allows the number to be turned into a name or message. - ) -+vindex(FUNCNEST) -+item(tt(FUNCNEST) )( -+Integer. If greater than or equal to zero, the maximum nesting depth of -+shell functions. When it is exceeded, an error is raised at the point -+where a function is called. The default value is determined when -+the shell is configured, but is typically 500. Increasing -+the value increases the danger of a runaway function recursion -+causing the shell to crash. Setting a negative value turns off -+the check. -+) - vindex(GID) - item(tt(GID) )( - The real group ID of the shell process. If you have sufficient privileges, -diff --git a/Doc/zshparam.1 b/Doc/zshparam.1 -index 44d8629..c7188cb 100644 ---- a/Doc/zshparam.1 -+++ b/Doc/zshparam.1 -@@ -701,6 +701,15 @@ This value is system dependent and is intended for debugging - purposes\&. It is also useful with the \fBzsh/system\fP module which - allows the number to be turned into a name or message\&. - .TP -+\fBFUNCNEST\fP -+Integer\&. If greater than or equal to zero, the maximum nesting depth of -+shell functions\&. When it is exceeded, an error is raised at the point -+where a function is called\&. The default value is determined when -+the shell is configured, but is typically 500\&. Increasing -+the value increases the danger of a runaway function recursion -+causing the shell to crash\&. Setting a negative value turns off -+the check\&. -+.TP - \fBGID\fP - The real group ID of the shell process\&. If you have sufficient privileges, - you may change the group ID of the shell process by assigning to this -diff --git a/README b/README -index e22cfc1..b5c0769 100644 ---- a/README -+++ b/README -@@ -30,9 +30,33 @@ Zsh is a shell with lots of features. For a list of some of these, see the - file FEATURES, and for the latest changes see NEWS. For more - details, see the documentation. - --Incompatibilities since 5.3.1 -+Incompatibilities since 5.4.2 - ----------------------------- - -+1) The default build-time maximum nested function depth has been -+decreased from 1000 to 500 based on user experience. However, -+it can now be changed at run time via the variable FUNCNEST. -+If you previously configured the shell to set a different value, -+or to remove the check, this is now reflected in the default -+value of the variable. -+ -+2) The syntax -+ -+foo=([key]=value) -+ -+can be used to set elements of arrays and associative arrays. In the -+unlikely event that you need to set an array by matching files using a -+pattern that starts with a character range followed by '=', you need to -+quote the '=', e.g.: -+ -+foo=([aeiou]\=vowel) -+ -+This is only required for array values contained within parentheses; -+command line expansion for normal arguments has not changed. -+ -+Incompatibilities between 5.3.1 and 5.4.2 -+----------------------------------------- -+ - 1) The default behaviour of code like the following has changed: - - alias foo='noglob foo' -diff --git a/Src/exec.c b/Src/exec.c -index cd99733..0f2bb4a 100644 ---- a/Src/exec.c -+++ b/Src/exec.c -@@ -5475,9 +5475,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - struct funcstack fstack; - static int oflags; - Emulation_options save_sticky = NULL; --#ifdef MAX_FUNCTION_DEPTH - static int funcdepth; --#endif - Heap funcheap; - - queue_signals(); /* Lots of memory and global state changes coming */ -@@ -5607,13 +5605,12 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - argzero = ztrdup(argzero); - } - } --#ifdef MAX_FUNCTION_DEPTH -- if(++funcdepth > MAX_FUNCTION_DEPTH) -- { -- zerr("maximum nested function level reached"); -- goto undoshfunc; -- } --#endif -+ ++funcdepth; -+ if (zsh_funcnest >= 0 && funcdepth > zsh_funcnest) { -+ zerr("maximum nested function level reached; increase FUNCNEST?"); -+ lastval = 1; -+ goto undoshfunc; -+ } - fstack.name = dupstring(name); - /* - * The caller is whatever is immediately before on the stack, -@@ -5652,10 +5649,8 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - runshfunc(prog, wrappers, fstack.name); - doneshfunc: - funcstack = fstack.prev; --#ifdef MAX_FUNCTION_DEPTH - undoshfunc: - --funcdepth; --#endif - if (retflag) { - retflag = 0; - breaks = obreaks; -diff --git a/Src/params.c b/Src/params.c -index 6fbee88..9c7833f 100644 ---- a/Src/params.c -+++ b/Src/params.c -@@ -101,6 +101,19 @@ zlong lastval, /* $? */ - rprompt_indent, /* $ZLE_RPROMPT_INDENT */ - ppid, /* $PPID */ - zsh_subshell; /* $ZSH_SUBSHELL */ -+ -+/* $FUNCNEST */ -+/**/ -+mod_export -+zlong zsh_funcnest = -+#ifdef MAX_FUNCTION_DEPTH -+ MAX_FUNCTION_DEPTH -+#else -+ /* Disabled by default but can be enabled at run time */ -+ -1 -+#endif -+ ; -+ - /**/ - zlong lineno, /* $LINENO */ - zoptind, /* $OPTIND */ -@@ -337,6 +350,7 @@ IPDEF5("COLUMNS", &zterm_columns, zlevar_gsu), - IPDEF5("LINES", &zterm_lines, zlevar_gsu), - IPDEF5U("ZLE_RPROMPT_INDENT", &rprompt_indent, rprompt_indent_gsu), - IPDEF5("SHLVL", &shlvl, varinteger_gsu), -+IPDEF5("FUNCNEST", &zsh_funcnest, varinteger_gsu), - - /* Don't import internal integer status variables. */ - #define IPDEF6(A,B,F) {{NULL,A,PM_INTEGER|PM_SPECIAL|PM_DONTIMPORT},BR((void *)B),GSU(F),10,0,NULL,NULL,NULL,0} -diff --git a/Test/C04funcdef.ztst b/Test/C04funcdef.ztst -index 6a675e0..0c00a04 100644 ---- a/Test/C04funcdef.ztst -+++ b/Test/C04funcdef.ztst -@@ -515,6 +515,14 @@ - 0:autoload with absolute path not cancelled by bare autoload - >I have been loaded by explicit path. - -+ ( -+ FUNCNEST=0 -+ fn() { true; } -+ fn -+ ) -+1: -+?fn:4: maximum nested function level reached; increase FUNCNEST? -+ - %clean - - rm -f file.in file.out -diff --git a/configure.ac b/configure.ac -index ec0bdae..1a498f8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -415,13 +415,13 @@ ifdef([max_function_depth],[undefine([max_function_depth])])dnl - AH_TEMPLATE([MAX_FUNCTION_DEPTH], - [Define for function depth limits]) - AC_ARG_ENABLE(max-function-depth, --AC_HELP_STRING([--enable-max-function-depth=MAX], [limit function depth to MAX, default 1000]), -+AC_HELP_STRING([--enable-max-function-depth=MAX], [limit function depth to MAX, default 500]), - [if test x$enableval = xyes; then -- AC_DEFINE(MAX_FUNCTION_DEPTH, 1000) -+ AC_DEFINE(MAX_FUNCTION_DEPTH, 500) - elif test x$enableval != xno; then - AC_DEFINE_UNQUOTED(MAX_FUNCTION_DEPTH, $enableval) - fi], --[AC_DEFINE(MAX_FUNCTION_DEPTH, 1000)] -+[AC_DEFINE(MAX_FUNCTION_DEPTH, 500)] - ) - - ifdef([default_readnullcmd],[undefine([default_readnullcmd])])dnl --- -2.13.6 - - -From aee6a617b5769ee6224165560db43bb8b8ee64ba Mon Sep 17 00:00:00 2001 -From: Peter Stephenson -Date: Wed, 4 Oct 2017 09:18:51 +0100 -Subject: [PATCH 2/2] 41802 (minor tweaks): use heap during shell function - call. - -Replaces stack for more efficient memory management. - -Also fix debug message when FUNCNEST is increased. - -Upstream-commit: e573857a033504f7918c4a2309151329820f115f -Signed-off-by: Kamil Dudka ---- - Src/exec.c | 154 +++++++++++++++++++++++++++++++++--------------------------- - Src/parse.c | 3 +- - 2 files changed, 87 insertions(+), 70 deletions(-) - -diff --git a/Src/exec.c b/Src/exec.c -index 0f2bb4a..db77303 100644 ---- a/Src/exec.c -+++ b/Src/exec.c -@@ -41,6 +41,20 @@ enum { - ADDVAR_RESTORE = 1 << 2 - }; - -+/* Structure in which to save values around shell function call */ -+ -+struct funcsave { -+ char opts[OPT_SIZE]; -+ char *argv0; -+ int zoptind, lastval, optcind, numpipestats; -+ int *pipestats; -+ char *scriptname; -+ int breaks, contflag, loops, emulation, noerrexit, oflags, restore_sticky; -+ Emulation_options sticky; -+ struct funcstack fstack; -+}; -+typedef struct funcsave *Funcsave; -+ - /* - * used to suppress ERREXIT and trapping of SIGZERR, SIGEXIT. - * Bits from noerrexit_bits. -@@ -5462,34 +5476,36 @@ int sticky_emulation_differs(Emulation_options sticky2) - mod_export int - doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - { -- char **pptab, **x, *oargv0; -- int oldzoptind, oldlastval, oldoptcind, oldnumpipestats, ret; -- int *oldpipestats = NULL; -- char saveopts[OPT_SIZE], *oldscriptname = scriptname; -+ char **pptab, **x; -+ int ret; - char *name = shfunc->node.nam; -- int flags = shfunc->node.flags, ooflags; -- int savnoerrexit; -+ int flags = shfunc->node.flags; - char *fname = dupstring(name); -- int obreaks, ocontflag, oloops, saveemulation, restore_sticky; - Eprog prog; -- struct funcstack fstack; - static int oflags; -- Emulation_options save_sticky = NULL; - static int funcdepth; - Heap funcheap; - - queue_signals(); /* Lots of memory and global state changes coming */ - - NEWHEAPS(funcheap) { -- oargv0 = NULL; -- obreaks = breaks; -- ocontflag = contflag; -- oloops = loops; -+ /* -+ * Save data in heap rather than on stack to keep recursive -+ * function cost down --- use of heap memory should be efficient -+ * at this point. Saving is not actually massive. -+ */ -+ Funcsave funcsave = zhalloc(sizeof(struct funcsave)); -+ funcsave->scriptname = scriptname; -+ funcsave->argv0 = NULL; -+ funcsave->breaks = breaks; -+ funcsave->contflag = contflag; -+ funcsave->loops = loops; -+ funcsave->lastval = lastval; -+ funcsave->pipestats = NULL; -+ funcsave->numpipestats = numpipestats; -+ funcsave->noerrexit = noerrexit; - if (trap_state == TRAP_STATE_PRIMED) - trap_return--; -- oldlastval = lastval; -- oldnumpipestats = numpipestats; -- savnoerrexit = noerrexit; - /* - * Suppression of ERR_RETURN is turned off in function scope. - */ -@@ -5500,8 +5516,8 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - * immediately by a pushheap/popheap pair. - */ - size_t bytes = sizeof(int)*numpipestats; -- oldpipestats = (int *)zhalloc(bytes); -- memcpy(oldpipestats, pipestats, bytes); -+ funcsave->pipestats = (int *)zhalloc(bytes); -+ memcpy(funcsave->pipestats, pipestats, bytes); - } - - starttrapscope(); -@@ -5510,8 +5526,8 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - pptab = pparams; - if (!(flags & PM_UNDEFINED)) - scriptname = dupstring(name); -- oldzoptind = zoptind; -- oldoptcind = optcind; -+ funcsave->zoptind = zoptind; -+ funcsave->optcind = optcind; - if (!isset(POSIXBUILTINS)) { - zoptind = 1; - optcind = 0; -@@ -5520,9 +5536,9 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - /* We need to save the current options even if LOCALOPTIONS is * - * not currently set. That's because if it gets set in the * - * function we need to restore the original options on exit. */ -- memcpy(saveopts, opts, sizeof(opts)); -- saveemulation = emulation; -- save_sticky = sticky; -+ memcpy(funcsave->opts, opts, sizeof(opts)); -+ funcsave->emulation = emulation; -+ funcsave->sticky = sticky; - - if (sticky_emulation_differs(shfunc->sticky)) { - /* -@@ -5539,7 +5555,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - */ - sticky = sticky_emulation_dup(shfunc->sticky, 1); - emulation = sticky->emulation; -- restore_sticky = 1; -+ funcsave->restore_sticky = 1; - installemulation(emulation, opts); - if (sticky->n_on_opts) { - OptIndex *onptr; -@@ -5558,7 +5574,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - /* All emulations start with pattern disables clear */ - clearpatterndisables(); - } else -- restore_sticky = 0; -+ funcsave->restore_sticky = 0; - - if (flags & (PM_TAGGED|PM_TAGGED_LOCAL)) - opts[XTRACE] = 1; -@@ -5576,11 +5592,11 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - else - opts[WARNNESTEDVAR] = 0; - } -- ooflags = oflags; -+ funcsave->oflags = oflags; - /* - * oflags is static, because we compare it on the next recursive -- * call. Hence also we maintain ooflags for restoring the previous -- * value of oflags after the call. -+ * call. Hence also we maintain a saved version for restoring -+ * the previous value of oflags after the call. - */ - oflags = flags; - opts[PRINTEXITVALUE] = 0; -@@ -5591,7 +5607,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - pparams = x = (char **) zshcalloc(((sizeof *x) * - (1 + countlinknodes(doshargs)))); - if (isset(FUNCTIONARGZERO)) { -- oargv0 = argzero; -+ funcsave->argv0 = argzero; - argzero = ztrdup(getdata(node)); - } - /* first node contains name regardless of option */ -@@ -5601,7 +5617,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - } else { - pparams = (char **) zshcalloc(sizeof *pparams); - if (isset(FUNCTIONARGZERO)) { -- oargv0 = argzero; -+ funcsave->argv0 = argzero; - argzero = ztrdup(argzero); - } - } -@@ -5611,21 +5627,21 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - lastval = 1; - goto undoshfunc; - } -- fstack.name = dupstring(name); -+ funcsave->fstack.name = dupstring(name); - /* - * The caller is whatever is immediately before on the stack, - * unless we're at the top, in which case it's the script - * or interactive shell name. - */ -- fstack.caller = funcstack ? funcstack->name : -- dupstring(oargv0 ? oargv0 : argzero); -- fstack.lineno = lineno; -- fstack.prev = funcstack; -- fstack.tp = FS_FUNC; -- funcstack = &fstack; -+ funcsave->fstack.caller = funcstack ? funcstack->name : -+ dupstring(funcsave->argv0 ? funcsave->argv0 : argzero); -+ funcsave->fstack.lineno = lineno; -+ funcsave->fstack.prev = funcstack; -+ funcsave->fstack.tp = FS_FUNC; -+ funcstack = &funcsave->fstack; - -- fstack.flineno = shfunc->lineno; -- fstack.filename = getshfuncfile(shfunc); -+ funcsave->fstack.flineno = shfunc->lineno; -+ funcsave->fstack.filename = getshfuncfile(shfunc); - - prog = shfunc->funcdef; - if (prog->flags & EF_RUN) { -@@ -5633,7 +5649,7 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - - prog->flags &= ~EF_RUN; - -- runshfunc(prog, NULL, fstack.name); -+ runshfunc(prog, NULL, funcsave->fstack.name); - - if (!(shf = (Shfunc) shfunctab->getnode(shfunctab, - (name = fname)))) { -@@ -5646,52 +5662,52 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - } - prog = shf->funcdef; - } -- runshfunc(prog, wrappers, fstack.name); -+ runshfunc(prog, wrappers, funcsave->fstack.name); - doneshfunc: -- funcstack = fstack.prev; -+ funcstack = funcsave->fstack.prev; - undoshfunc: - --funcdepth; - if (retflag) { - retflag = 0; -- breaks = obreaks; -+ breaks = funcsave->breaks; - } - freearray(pparams); -- if (oargv0) { -+ if (funcsave->argv0) { - zsfree(argzero); -- argzero = oargv0; -+ argzero = funcsave->argv0; - } - pparams = pptab; - if (!isset(POSIXBUILTINS)) { -- zoptind = oldzoptind; -- optcind = oldoptcind; -+ zoptind = funcsave->zoptind; -+ optcind = funcsave->optcind; - } -- scriptname = oldscriptname; -- oflags = ooflags; -+ scriptname = funcsave->scriptname; -+ oflags = funcsave->oflags; - - endpatternscope(); /* before restoring old LOCALPATTERNS */ - -- if (restore_sticky) { -+ if (funcsave->restore_sticky) { - /* - * If we switched to an emulation environment just for - * this function, we interpret the option and emulation - * switch as being a firewall between environments. - */ -- memcpy(opts, saveopts, sizeof(opts)); -- emulation = saveemulation; -- sticky = save_sticky; -+ memcpy(opts, funcsave->opts, sizeof(opts)); -+ emulation = funcsave->emulation; -+ sticky = funcsave->sticky; - } else if (isset(LOCALOPTIONS)) { - /* restore all shell options except PRIVILEGED and RESTRICTED */ -- saveopts[PRIVILEGED] = opts[PRIVILEGED]; -- saveopts[RESTRICTED] = opts[RESTRICTED]; -- memcpy(opts, saveopts, sizeof(opts)); -- emulation = saveemulation; -+ funcsave->opts[PRIVILEGED] = opts[PRIVILEGED]; -+ funcsave->opts[RESTRICTED] = opts[RESTRICTED]; -+ memcpy(opts, funcsave->opts, sizeof(opts)); -+ emulation = funcsave->emulation; - } else { - /* just restore a couple. */ -- opts[XTRACE] = saveopts[XTRACE]; -- opts[PRINTEXITVALUE] = saveopts[PRINTEXITVALUE]; -- opts[LOCALOPTIONS] = saveopts[LOCALOPTIONS]; -- opts[LOCALLOOPS] = saveopts[LOCALLOOPS]; -- opts[WARNNESTEDVAR] = saveopts[WARNNESTEDVAR]; -+ opts[XTRACE] = funcsave->opts[XTRACE]; -+ opts[PRINTEXITVALUE] = funcsave->opts[PRINTEXITVALUE]; -+ opts[LOCALOPTIONS] = funcsave->opts[LOCALOPTIONS]; -+ opts[LOCALLOOPS] = funcsave->opts[LOCALLOOPS]; -+ opts[WARNNESTEDVAR] = funcsave->opts[WARNNESTEDVAR]; - } - - if (opts[LOCALLOOPS]) { -@@ -5699,9 +5715,9 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - zwarn("`continue' active at end of function scope"); - if (breaks) - zwarn("`break' active at end of function scope"); -- breaks = obreaks; -- contflag = ocontflag; -- loops = oloops; -+ breaks = funcsave->breaks; -+ contflag = funcsave->contflag; -+ loops = funcsave->loops; - } - - endtrapscope(); -@@ -5709,11 +5725,11 @@ doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) - if (trap_state == TRAP_STATE_PRIMED) - trap_return++; - ret = lastval; -- noerrexit = savnoerrexit; -+ noerrexit = funcsave->noerrexit; - if (noreturnval) { -- lastval = oldlastval; -- numpipestats = oldnumpipestats; -- memcpy(pipestats, oldpipestats, sizeof(int)*numpipestats); -+ lastval = funcsave->lastval; -+ numpipestats = funcsave->numpipestats; -+ memcpy(pipestats, funcsave->pipestats, sizeof(int)*numpipestats); - } - } OLDHEAPS; - -diff --git a/Src/parse.c b/Src/parse.c -index 2705252..d94ee99 100644 ---- a/Src/parse.c -+++ b/Src/parse.c -@@ -2737,7 +2737,8 @@ freeeprog(Eprog p) - DPUTS(p->nref < 0 && !(p->flags & EF_HEAP), "Real EPROG has nref < 0"); - DPUTS(p->nref < -1, "Uninitialised EPROG nref"); - #ifdef MAX_FUNCTION_DEPTH -- DPUTS(p->nref > MAX_FUNCTION_DEPTH + 10, "Overlarge EPROG nref"); -+ DPUTS(zsh_funcnest >=0 && p->nref > zsh_funcnest + 10, -+ "Overlarge EPROG nref"); - #endif - if (p->nref > 0 && !--p->nref) { - for (i = p->npats, pp = p->pats; i--; pp++) --- -2.13.6 - diff --git a/0004-zsh-5.4.2-CVE-2018-7548.patch b/0004-zsh-5.4.2-CVE-2018-7548.patch deleted file mode 100644 index 944b888..0000000 --- a/0004-zsh-5.4.2-CVE-2018-7548.patch +++ /dev/null @@ -1,28 +0,0 @@ -From fc22af40437f4de42f7505ca93361391eab788e3 Mon Sep 17 00:00:00 2001 -From: Joey Pabalinas -Date: Tue, 23 Jan 2018 22:28:08 -0800 -Subject: [PATCH 1/2] 42313: avoid null-pointer deref when using ${(PA)...} on - an empty array result - -Upstream-commit: 110b13e1090bc31ac1352b28adc2d02b6d25a102 -Signed-off-by: Kamil Dudka ---- - Src/subst.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Src/subst.c b/Src/subst.c -index 5b1bf89..94b0207 100644 ---- a/Src/subst.c -+++ b/Src/subst.c -@@ -2340,7 +2340,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, - val = aval[0]; - isarr = 0; - } -- s = dyncat(val, s); -+ s = val ? dyncat(val, s) : dupstring(s); - /* Now behave po-faced as if it was always like that... */ - subexp = 0; - /* --- -2.14.3 - diff --git a/0005-zsh-5.4.2-CVE-2018-7549.patch b/0005-zsh-5.4.2-CVE-2018-7549.patch deleted file mode 100644 index 6dfafe8..0000000 --- a/0005-zsh-5.4.2-CVE-2018-7549.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 016b8889a6c30279f6ee362e34262c204ef834c2 Mon Sep 17 00:00:00 2001 -From: Stephane Chazelas -Date: Fri, 22 Dec 2017 22:17:09 +0000 -Subject: [PATCH 2/2] Avoid crash copying empty hash table. - -Visible with typeset -p. - -Upstream-commit: c2cc8b0fbefc9868fa83537f5b6d90fc1ec438dd -Signed-off-by: Kamil Dudka ---- - Src/params.c | 11 +++++++---- - 1 file changed, 7 insertions(+), 4 deletions(-) - -diff --git a/Src/params.c b/Src/params.c -index 9c7833f..d9da7f6 100644 ---- a/Src/params.c -+++ b/Src/params.c -@@ -549,10 +549,13 @@ scancopyparams(HashNode hn, UNUSED(int flags)) - HashTable - copyparamtable(HashTable ht, char *name) - { -- HashTable nht = newparamtable(ht->hsize, name); -- outtable = nht; -- scanhashtable(ht, 0, 0, 0, scancopyparams, 0); -- outtable = NULL; -+ HashTable nht = 0; -+ if (ht) { -+ nht = newparamtable(ht->hsize, name); -+ outtable = nht; -+ scanhashtable(ht, 0, 0, 0, scancopyparams, 0); -+ outtable = NULL; -+ } - return nht; - } - --- -2.14.3 - diff --git a/sources b/sources index 8a7d03f..512833d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.4.2.tar.gz) = 5eaa2ff3dc8052dfb50d2be19bfeed1856b00f7c2dc698129c95c2373a516ee61dba5b42ded390ac20b171abe352b1875f177a4dda8fdc15a4f2a05bb7a024e2 +SHA512 (zsh-5.5.tar.xz) = 37316f6b9d539b0eec0e6ae2b5af5257bce07889787204d1f6f978a05d5b40eb2c9e5edf4259beb8edf0869f77bc0dff88ad051d8f030838f4778e54a53d02d9 diff --git a/zsh-5.4.2.tar.gz.asc b/zsh-5.4.2.tar.gz.asc deleted file mode 100644 index 06b0b10..0000000 --- a/zsh-5.4.2.tar.gz.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1 - -iQEcBAABCAAGBQJZoyoaAAoJEKcdmp1L2yezt7AIAJ9D+qiWPJZiXCzi7kBU7hoZ -1+3Nr2QXcXBp2ENDktKFY9zygXQ8m65JqpRHUAYSyKeXsIjCaDLPWHG6HNGN+csg -TxAflLapm/d+53ESNLMju5CeNHkV1pdbEE5LmgmPUpOzHwmV092IYVLsLC5d8CEC -c6hMb2cl8/lWv9S/3WYAAa0gKnmcRLGkyyA4iPoH1BsDGuxQfBfU+Vdh+h1wrq/A -+P81UqvutjM0limDyFGngkJoesuVabRettxR0wA24QBh9mIJxPZLL86QISiVD7a1 -SPkzH88E4vjVtTXEau9TxIHLpukJPIoUNPcfeg+hUdfJ6hkLZdsWxtPRvaXgIEw= -=yDM8 ------END PGP SIGNATURE----- diff --git a/zsh-5.5.tar.xz.asc b/zsh-5.5.tar.xz.asc new file mode 100644 index 0000000..1ecb09d --- /dev/null +++ b/zsh-5.5.tar.xz.asc @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQEcBAABCAAGBQJaykAjAAoJEKcdmp1L2yezO5oH+gIdqcX2SRKZRIp7UmF+fies +wdDDWj60e2ejRxsEGLm9HS1if1FyRy44S0/0uG6Pzzwfvu/LhufzONm+AOVCY9xm +/hRvPx/ECDfCMSsbsnUfHgQutqUOWTIRyRNwURvW7uZTCDXPLPrmiF8cVVgSKsnV +5Y/Pe4io6rDINs+IAXH5wSoC9G1ko032cs4sgCY8npQB93Ui9VlsxekFDg5IRm2/ +gw9va84zJp1Jo5D/51MXi7juZUCQ1Y8vnXh7QnOakFUUbIHwh/UX6OjJA+PqPXUt +XCQ3lVJKD5iD3D9PLxRV8CMjcGMGGF1Sa7bKHpwjeebDS/mtwQLQkVelSJj7OgQ= +=sR7Y +-----END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index aa4a9d5..ee70449 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,11 +1,10 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.4.2 -Release: 7%{?dist} +Version: 5.5 +Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ -# FIXME: use .xz once available -Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.gz +Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.xz Source1: zlogin.rhs Source2: zlogout.rhs Source3: zprofile.rhs @@ -13,15 +12,6 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc -# make the call depth limit configurable by $FUNCNEST (#1441092) -Patch1: 0001-zsh-5.4.2-funcnest.patch - -# avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) -Patch4: 0004-zsh-5.4.2-CVE-2018-7548.patch - -# avoid crash when copying empty hash table (CVE-2018-7549) -Patch5: 0005-zsh-5.4.2-CVE-2018-7549.patch - BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -177,6 +167,12 @@ fi %doc Doc/*.html %changelog +* Mon Apr 09 2018 Kamil Dudka - 5.5-1 +- update to latest upstream release, which fixes the following vulnerabilities: + CVE-2018-1100 - stack-based buffer overflow in utils.c:checkmailpath() + CVE-2018-1083 - stack-based buffer overflow in compctl.c:gen_matches_files() + CVE-2018-1071 - stack-based buffer overflow in exec.c:hashcmd() + * Tue Mar 06 2018 Kamil Dudka - 5.4.2-7 - avoid crash when copying empty hash table (CVE-2018-7549) - avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) diff --git a/zshprompt.pl b/zshprompt.pl deleted file mode 100644 index b9d5f0f..0000000 --- a/zshprompt.pl +++ /dev/null @@ -1,235 +0,0 @@ -#!/usr/bin/perl -w - -#requires Gtk-Perl - -use Gtk; -use strict; - -set_locale Gtk; -init Gtk; - -my $window = new Gtk::Window("toplevel"); -$window->signal_connect( "delete_event", \&CloseAppWindow ); -my $table = new Gtk::Table( 20, 6, 0 ); -$window->border_width( 5 ); -#$window->add( $button ); - - -my $prompt = new Gtk::Entry( 128); -my $log = new Gtk::Text(); -$log->set_usize(40,60); -$log->show(); -$prompt->show(); -#$prompt->set_editable (1); -$prompt->set_text(""); -$table->attach( $prompt,0,4,0,4,[ 'expand', 'shrink', 'fill' ], - 'shrink', - 0, 0 ); - -$table->set_row_spacings( 5 ); -$table->set_col_spacings( 5 ); - -my $currDir = new Gtk::Button( "Current Directory" ); -$currDir->show(); -$table->attach_defaults( $currDir,0,1,4,6 ); - -my $errorCode = new Gtk::Button( "Last Return Code" ); -$errorCode->show(); -$table->attach_defaults( $errorCode,1,2,4,6 ); - -my $currTime = new Gtk::Button( "Time" ); -$currTime->show(); -$table->attach_defaults( $currTime,2,3,4,6 ); - -my $hist = new Gtk::Button( "History Number" ); -$hist->show(); -$table->attach_defaults( $hist,3,4,4,6 ); - -my $host = new Gtk::Button( "Hostname" ); -$host->show(); -$table->attach_defaults( $host,0,1,6,8 ); - - - -my $backgroundBlue = new Gtk::Button( "Blue Background" ); -$backgroundBlue->show(); -$table->attach_defaults( $backgroundBlue,0,1,8,10 ); - -my $backgroundRed = new Gtk::Button( "Red Background" ); -$backgroundRed->show(); -$table->attach_defaults( $backgroundRed,1,2,8,10 ); - -my $backgroundGreen = new Gtk::Button( "Green Background" ); -$backgroundGreen->show(); -$table->attach_defaults( $backgroundGreen,2,3,8,10 ); - -my $backgroundYellow = new Gtk::Button( "Yellow Background" ); -$backgroundYellow->show(); -$table->attach_defaults( $backgroundYellow,3,4,8,10 ); - -my $backgroundBlack = new Gtk::Button( "Black Background" ); -$backgroundBlack->show(); -$table->attach_defaults( $backgroundBlack,5,6,8,10 ); - -my $backgroundWhite = new Gtk::Button( "White Background" ); -$backgroundWhite->show(); -$table->attach_defaults( $backgroundWhite,6,7,8,10 ); - -my $backgroundPink = new Gtk::Button( "Pink Background" ); -$backgroundPink->show(); -$table->attach_defaults( $backgroundPink,7,8,8,10 ); - - - - - -my $textBlue = new Gtk::Button( "Blue Text" ); -$textBlue->show(); -$table->attach_defaults( $textBlue,0,1,10,12 ); - -my $textRed = new Gtk::Button( "Red Text" ); -$textRed->show(); -$table->attach_defaults( $textRed,1,2,10,12 ); - -my $textGreen = new Gtk::Button( "Green Text" ); -$textGreen->show(); -$table->attach_defaults( $textGreen,2,3,10,12 ); - -my $textYellow = new Gtk::Button( "Yellow Text" ); -$textYellow->show(); -$table->attach_defaults( $textYellow,3,4,10,12 ); - -my $textBlack = new Gtk::Button( "Black Text" ); -$textBlack->show(); -$table->attach_defaults( $textBlack,5,6,10,12 ); - -my $textWhite = new Gtk::Button( "White Text" ); -$textWhite->show(); -$table->attach_defaults( $textWhite,6,7,10,12 ); - -my $textPink = new Gtk::Button( "Pink Text" ); -$textPink->show(); -$table->attach_defaults( $textPink,7,8,10,12 ); - - -my $textDefault = new Gtk::Button( "Default Text" ); -$textDefault->show(); -$table->attach_defaults( $textDefault,0,1,12,14 ); - -my $backgroundDefault = new Gtk::Button( "Default Background" ); -$backgroundDefault->show(); -$table->attach_defaults( $backgroundDefault,1,2,12,14 ); - - - -my $set = new Gtk::Button( "Save Settings" ); -$set->show(); -$table->attach_defaults( $set,0,1,16,18 ); - -my $xterm = new Gtk::Button( "Test saved settings" ); -$xterm->show(); -$table->attach_defaults( $xterm,1,2,16,18 ); - -$table->attach_defaults( $log,0,6,18,20 ); - - -$currDir->signal_connect( "clicked", \&insertButtonText, "%1/" ); -$errorCode->signal_connect( "clicked", \&insertButtonText, "%?" ); -$currTime->signal_connect( "clicked", \&insertButtonText, "%T" ); -$hist->signal_connect( "clicked", \&insertButtonText, "%!" ); -$host->signal_connect( "clicked", \&insertButtonText, "%m" ); - -$backgroundBlue->signal_connect( "clicked", \&insertButtonText, "%{\$bg[blue]%}" ); -$backgroundRed->signal_connect( "clicked", \&insertButtonText, "%{\$bg[red]%}" ); -$backgroundGreen->signal_connect( "clicked", \&insertButtonText, "%{\$bg[green]%}" ); -$backgroundYellow->signal_connect( "clicked", \&insertButtonText, "%{\$bg[yellow]%}" ); -$backgroundBlack->signal_connect( "clicked", \&insertButtonText, "%{\$bg[black]%}" ); -$backgroundWhite->signal_connect( "clicked", \&insertButtonText, "%{\$bg[white]%}" ); -$backgroundPink->signal_connect( "clicked", \&insertButtonText, "%{\$bg[magenta]%}" ); -$backgroundDefault->signal_connect( "clicked", \&insertButtonText, "%{\$bg[default]%}" ); - - - - -$textBlue->signal_connect( "clicked", \&insertButtonText, "%{\$fg[blue]%}" ); -$textRed->signal_connect( "clicked", \&insertButtonText, "%{\$fg[red]%}" ); -$textGreen->signal_connect( "clicked", \&insertButtonText, "%{\$fg[green]%}" ); -$textYellow->signal_connect( "clicked", \&insertButtonText, "%{\$fg[yellow]%}" ); -$textBlack->signal_connect( "clicked", \&insertButtonText, "%{\$fg[black]%}" ); -$textWhite->signal_connect( "clicked", \&insertButtonText, "%{\$fg[white]%}" ); -$textPink->signal_connect( "clicked", \&insertButtonText, "%{\$fg[magenta]%}" ); -$textDefault->signal_connect( "clicked", \&insertButtonText, "%{\$fg[default]%}" ); - - - - - -$set->signal_connect( "clicked", \&pushEnv ); -$xterm->signal_connect( "clicked", \&xterm ); - -sub xterm -{ -my $string="xterm -e zsh -li&"; -#$string.=$prompt->get_text(); - -#$string.="' zsh -li\"& "; - -system($string); -# $prompt->append_text( $string ); -$log->insert( "", "white", "black", "executing:\n $string\n"); -} - - -sub pushEnv -{ -chdir("~"); -use Env qw(PS1); -my $pNotSet=0; -open(PROMPT, "+<", ".prompt") or $pNotSet=1; - - -if($pNotSet) -{ - #$prompt->insert( "", "white", "black", "prompt is not set"); - open(ZSHRC, '>>','.zshrc') or die "cannot open zshrc"; - print ZSHRC ". ~/.prompt\n"; - close (ZSHRC); -} -close (PROMPT); -open(PROMPT, ">", ".prompt"); -print PROMPT "export PS1=\"",$prompt->get_text(),"\"\n"; - -#$prompt->insert( "", "white", "black", $PS1); - -close(PROMPT); -close(ZSHRC); -$prompt->grab_focus(); - -} -$prompt->can_default(1); -$prompt->grab_default(); -$table->show(); -$window->add( $table ); - - - - -$window->show(); -$prompt->grab_focus(); -main Gtk; - -exit( 0 ); - -sub CloseAppWindow -{ - Gtk->exit( 0 ); - return 0; -} - - -sub insertButtonText -{ - my ($widget, $txt) = @_; - $prompt->append_text( $txt ); -$prompt->grab_focus(); -} From 3f5fc8cf1a84f0752e72edeeac542dc4168eaaed Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 17 Apr 2018 09:39:57 +0200 Subject: [PATCH 12/74] update to latest upstream release: 5.5.1 --- sources | 2 +- zsh-5.5.1.tar.xz.asc | 11 +++++++++++ zsh-5.5.tar.xz.asc | 11 ----------- zsh.spec | 7 +++++-- 4 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 zsh-5.5.1.tar.xz.asc delete mode 100644 zsh-5.5.tar.xz.asc diff --git a/sources b/sources index 512833d..97eb4a1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.5.tar.xz) = 37316f6b9d539b0eec0e6ae2b5af5257bce07889787204d1f6f978a05d5b40eb2c9e5edf4259beb8edf0869f77bc0dff88ad051d8f030838f4778e54a53d02d9 +SHA512 (zsh-5.5.1.tar.xz) = 37156ff682f8ec337526c8f93a0a2031000bb0b4b2a59e04158aae3f0fb667f4d9898d6f2bae8abe3dd2839f760f2e335484e016564a4a59097273a1f64da0c2 diff --git a/zsh-5.5.1.tar.xz.asc b/zsh-5.5.1.tar.xz.asc new file mode 100644 index 0000000..c4f8955 --- /dev/null +++ b/zsh-5.5.1.tar.xz.asc @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQEcBAABCAAGBQJa1Op5AAoJEKcdmp1L2yezMOoH/3d9WE9GurXK9ZLF/IF3RZjj +G82A1FIylBIO+JCbZLHLqX359HNC42/6p/DuzrgtfTJpSXLKGyNeiuKDhLWD75B9 +mpVfOeNXXWyyxgT0NW9L2mPYOUfwn4GyYO/+CC7z68fCLoXDGjTDIkPZOEIPHhvg +/QWD/0qCRcBr1OaDKowtRS4+Dvj5AH0YRzWYuqPYMPcDfZ20IVZ2HPKROir9coGu +PyI5ToAswA6OFwCsq4WGgwUno2JiaOoFDR0imkNetvkqz7RXgwghu8r+a6GPPWOf +eydUuUmvlj0COoeAJmJ8KL2u6GnVgUmTCswo3VNOpUE9USxcP0oB44+SyeZ6KDk= +=uo1d +-----END PGP SIGNATURE----- diff --git a/zsh-5.5.tar.xz.asc b/zsh-5.5.tar.xz.asc deleted file mode 100644 index 1ecb09d..0000000 --- a/zsh-5.5.tar.xz.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1 - -iQEcBAABCAAGBQJaykAjAAoJEKcdmp1L2yezO5oH+gIdqcX2SRKZRIp7UmF+fies -wdDDWj60e2ejRxsEGLm9HS1if1FyRy44S0/0uG6Pzzwfvu/LhufzONm+AOVCY9xm -/hRvPx/ECDfCMSsbsnUfHgQutqUOWTIRyRNwURvW7uZTCDXPLPrmiF8cVVgSKsnV -5Y/Pe4io6rDINs+IAXH5wSoC9G1ko032cs4sgCY8npQB93Ui9VlsxekFDg5IRm2/ -gw9va84zJp1Jo5D/51MXi7juZUCQ1Y8vnXh7QnOakFUUbIHwh/UX6OjJA+PqPXUt -XCQ3lVJKD5iD3D9PLxRV8CMjcGMGGF1Sa7bKHpwjeebDS/mtwQLQkVelSJj7OgQ= -=sR7Y ------END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index ee70449..7bfe46a 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,10 +1,10 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.5 +Version: 5.5.1 Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ -Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.xz +Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz Source1: zlogin.rhs Source2: zlogout.rhs Source3: zprofile.rhs @@ -167,6 +167,9 @@ fi %doc Doc/*.html %changelog +* Tue Apr 17 2018 Kamil Dudka - 5.5.1-1 +- update to latest upstream release + * Mon Apr 09 2018 Kamil Dudka - 5.5-1 - update to latest upstream release, which fixes the following vulnerabilities: CVE-2018-1100 - stack-based buffer overflow in utils.c:checkmailpath() From 8491e662f7eb4a2b8b861aa71cb75cc63efcac13 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Wed, 18 Apr 2018 15:03:02 +0200 Subject: [PATCH 13/74] Resolves: CVE-2018-1071 - fix stack-based buffer overflow in exec.c:hashcmd() --- 0006-zsh-5.4.2-CVE-2018-1071.patch | 46 ++++++++++++++++++++++++++++++ zsh.spec | 8 +++++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 0006-zsh-5.4.2-CVE-2018-1071.patch diff --git a/0006-zsh-5.4.2-CVE-2018-1071.patch b/0006-zsh-5.4.2-CVE-2018-1071.patch new file mode 100644 index 0000000..e0d8df2 --- /dev/null +++ b/0006-zsh-5.4.2-CVE-2018-1071.patch @@ -0,0 +1,46 @@ +From 3f930a5b3c4e3d34724db6a985393f6a8408703d Mon Sep 17 00:00:00 2001 +From: Oliver Kiddle +Date: Sat, 24 Mar 2018 15:02:41 +0100 +Subject: [PATCH] 42518, CVE-2018-1071: check bounds when copying path in hashcmd() + +Upstream-commit: 679b71ec4d852037fe5f73d35bf557b0f406c8d4 +Signed-off-by: Kamil Dudka +--- + Src/exec.c | 2 +- + Src/utils.c | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Src/exec.c b/Src/exec.c +index f339dd6..1e82575 100644 +--- a/Src/exec.c ++++ b/Src/exec.c +@@ -917,7 +917,7 @@ hashcmd(char *arg0, char **pp) + for (; *pp; pp++) + if (**pp == '/') { + s = buf; +- strucpy(&s, *pp); ++ struncpy(&s, *pp, PATH_MAX); + *s++ = '/'; + if ((s - buf) + strlen(arg0) >= PATH_MAX) + continue; +diff --git a/Src/utils.c b/Src/utils.c +index 5055d69..271f55f 100644 +--- a/Src/utils.c ++++ b/Src/utils.c +@@ -2283,10 +2283,10 @@ struncpy(char **s, char *t, int n) + { + char *u = *s; + +- while (n--) +- *u++ = *t++; ++ while (n-- && (*u++ = *t++)); + *s = u; +- *u = '\0'; ++ if (n > 0) /* just one null-byte will do, unlike strncpy(3) */ ++ *u = '\0'; + } + + /* Return the number of elements in an array of pointers. * +-- +2.14.3 + diff --git a/zsh.spec b/zsh.spec index 48ed3b6..0833cbb 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.4.1 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.xz @@ -18,6 +18,9 @@ Patch4: 0004-zsh-5.4.2-CVE-2018-7548.patch # avoid crash when copying empty hash table (CVE-2018-7549) Patch5: 0005-zsh-5.4.2-CVE-2018-7549.patch +# fix stack-based buffer overflow in exec.c:hashcmd() (CVE-2018-1071) +Patch6: 0006-zsh-5.4.2-CVE-2018-1071.patch + BuildRequires: coreutils BuildRequires: gawk BuildRequires: gdbm-devel @@ -174,6 +177,9 @@ fi %doc Doc/*.html %changelog +* Wed Apr 18 2018 Kamil Dudka - 5.4.1-3 +- fix stack-based buffer overflow in exec.c:hashcmd() (CVE-2018-1071) + * Tue Mar 06 2018 Kamil Dudka - 5.4.1-2 - avoid crash when copying empty hash table (CVE-2018-7549) - avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) From 2d3efa555ae8ce92d05d503bd65a05a3d4a5a64d Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Wed, 18 Apr 2018 15:09:17 +0200 Subject: [PATCH 14/74] Resolves: CVE-2018-1083 - fix stack-based buffer overflow in gen_matches_files() --- 0007-zsh-5.4.2-CVE-2018-1083.patch | 46 ++++++++++++++++++++++++++++++ zsh.spec | 4 +++ 2 files changed, 50 insertions(+) create mode 100644 0007-zsh-5.4.2-CVE-2018-1083.patch diff --git a/0007-zsh-5.4.2-CVE-2018-1083.patch b/0007-zsh-5.4.2-CVE-2018-1083.patch new file mode 100644 index 0000000..322d093 --- /dev/null +++ b/0007-zsh-5.4.2-CVE-2018-1083.patch @@ -0,0 +1,46 @@ +From ca7c69f009bf0e13b2c7cbb02310f7c322ee12a0 Mon Sep 17 00:00:00 2001 +From: Oliver Kiddle +Date: Sat, 24 Mar 2018 15:04:39 +0100 +Subject: [PATCH] 42519, CVE-2018-1083: check bounds on PATH_MAX-sized + buffer used for file completion candidates + +Upstream-commit: 259ac472eac291c8c103c7a0d8a4eaf3c2942ed7 +Signed-off-by: Kamil Dudka +--- + Src/Zle/compctl.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c +index 5414b8f..29649ac 100644 +--- a/Src/Zle/compctl.c ++++ b/Src/Zle/compctl.c +@@ -2176,6 +2176,8 @@ gen_matches_files(int dirs, int execs, int all) + if (prpre && *prpre) { + pathpref = dupstring(prpre); + unmetafy(pathpref, &pathpreflen); ++ if (pathpreflen > PATH_MAX) ++ return; + /* system needs NULL termination, not provided by unmetafy */ + pathpref[pathpreflen] = '\0'; + } else { +@@ -2218,6 +2220,8 @@ gen_matches_files(int dirs, int execs, int all) + * the path buffer by appending the filename. */ + ums = dupstring(n); + unmetafy(ums, ¨en); ++ if (umlen + pathpreflen + 1 > PATH_MAX) ++ continue; + memcpy(q, ums, umlen); + q[umlen] = '\0'; + /* And do the stat. */ +@@ -2232,6 +2236,8 @@ gen_matches_files(int dirs, int execs, int all) + /* We have to test for a path suffix. */ + int o = strlen(p), tt; + ++ if (o + strlen(psuf) > PATH_MAX) ++ continue; + /* Append it to the path buffer. */ + strcpy(p + o, psuf); + +-- +2.14.3 + diff --git a/zsh.spec b/zsh.spec index 0833cbb..ea6645d 100644 --- a/zsh.spec +++ b/zsh.spec @@ -21,6 +21,9 @@ Patch5: 0005-zsh-5.4.2-CVE-2018-7549.patch # fix stack-based buffer overflow in exec.c:hashcmd() (CVE-2018-1071) Patch6: 0006-zsh-5.4.2-CVE-2018-1071.patch +# fix stack-based buffer overflow in gen_matches_files() (CVE-2018-1083) +Patch7: 0007-zsh-5.4.2-CVE-2018-1083.patch + BuildRequires: coreutils BuildRequires: gawk BuildRequires: gdbm-devel @@ -178,6 +181,7 @@ fi %changelog * Wed Apr 18 2018 Kamil Dudka - 5.4.1-3 +- fix stack-based buffer overflow in gen_matches_files() (CVE-2018-1083) - fix stack-based buffer overflow in exec.c:hashcmd() (CVE-2018-1071) * Tue Mar 06 2018 Kamil Dudka - 5.4.1-2 From c10f6af0953d3762ab30edbdc51e343834cd2c93 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Wed, 18 Apr 2018 15:13:20 +0200 Subject: [PATCH 15/74] Resolves: CVE-2018-1100 - fix stack-based buffer overflow in utils.c:checkmailpath() --- 0008-zsh-5.4.2-CVE-2018-1100.patch | 41 ++++++++++++++++++++++++++++++ zsh.spec | 4 +++ 2 files changed, 45 insertions(+) create mode 100644 0008-zsh-5.4.2-CVE-2018-1100.patch diff --git a/0008-zsh-5.4.2-CVE-2018-1100.patch b/0008-zsh-5.4.2-CVE-2018-1100.patch new file mode 100644 index 0000000..c835034 --- /dev/null +++ b/0008-zsh-5.4.2-CVE-2018-1100.patch @@ -0,0 +1,41 @@ +From 33be20229d5be359c04b56e5548dd2c17b3aa0b5 Mon Sep 17 00:00:00 2001 +From: Oliver Kiddle +Date: Sat, 7 Apr 2018 18:28:38 +0200 +Subject: [PATCH] 42607, CVE-2018-1100: check bounds on buffer in mail checking + +Upstream-commit: 31f72205630687c1cef89347863aab355296a27f +Signed-off-by: Kamil Dudka +--- + Src/utils.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/Src/utils.c b/Src/utils.c +index 271f55f..fa1b5ed 100644 +--- a/Src/utils.c ++++ b/Src/utils.c +@@ -1653,7 +1653,7 @@ checkmailpath(char **s) + LinkList l; + DIR *lock = opendir(unmeta(*s)); + char buf[PATH_MAX * 2 + 1], **arr, **ap; +- int ct = 1; ++ int buflen, ct = 1; + + if (lock) { + char *fn; +@@ -1662,9 +1662,11 @@ checkmailpath(char **s) + l = newlinklist(); + while ((fn = zreaddir(lock, 1)) && !errflag) { + if (u) +- sprintf(buf, "%s/%s?%s", *s, fn, u); ++ buflen = snprintf(buf, sizeof(buf), "%s/%s?%s", *s, fn, u); + else +- sprintf(buf, "%s/%s", *s, fn); ++ buflen = snprintf(buf, sizeof(buf), "%s/%s", *s, fn); ++ if (buflen < 0 || buflen >= (int)sizeof(buf)) ++ continue; + addlinknode(l, dupstring(buf)); + ct++; + } +-- +2.14.3 + diff --git a/zsh.spec b/zsh.spec index ea6645d..710f4b7 100644 --- a/zsh.spec +++ b/zsh.spec @@ -24,6 +24,9 @@ Patch6: 0006-zsh-5.4.2-CVE-2018-1071.patch # fix stack-based buffer overflow in gen_matches_files() (CVE-2018-1083) Patch7: 0007-zsh-5.4.2-CVE-2018-1083.patch +# fix stack-based buffer overflow in utils.c:checkmailpath() (CVE-2018-1100) +Patch8: 0008-zsh-5.4.2-CVE-2018-1100.patch + BuildRequires: coreutils BuildRequires: gawk BuildRequires: gdbm-devel @@ -181,6 +184,7 @@ fi %changelog * Wed Apr 18 2018 Kamil Dudka - 5.4.1-3 +- fix stack-based buffer overflow in utils.c:checkmailpath() (CVE-2018-1100) - fix stack-based buffer overflow in gen_matches_files() (CVE-2018-1083) - fix stack-based buffer overflow in exec.c:hashcmd() (CVE-2018-1071) From c32c6350393ab84d09e61a54cc4b6d74232a3bd6 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 09:53:20 +0000 Subject: [PATCH 16/74] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 7bfe46a..2d13c7e 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.5.1 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -167,6 +167,9 @@ fi %doc Doc/*.html %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 5.5.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Tue Apr 17 2018 Kamil Dudka - 5.5.1-1 - update to latest upstream release From 80f10cc846f8a15e7eb134b5e56648c6806edea9 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 4 Sep 2018 16:04:45 +0200 Subject: [PATCH 17/74] update to latest upstream release: 5.6 Resolves: CVE-2018-0502 Resolves: CVE-2018-13259 --- sources | 2 +- zsh-5.5.1.tar.xz.asc | 11 ----------- zsh-5.6.tar.xz.asc | 16 ++++++++++++++++ zsh.spec | 7 +++++-- 4 files changed, 22 insertions(+), 14 deletions(-) delete mode 100644 zsh-5.5.1.tar.xz.asc create mode 100644 zsh-5.6.tar.xz.asc diff --git a/sources b/sources index 97eb4a1..e562bd1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.5.1.tar.xz) = 37156ff682f8ec337526c8f93a0a2031000bb0b4b2a59e04158aae3f0fb667f4d9898d6f2bae8abe3dd2839f760f2e335484e016564a4a59097273a1f64da0c2 +SHA512 (zsh-5.6.tar.xz) = 791cbeff45a5ef86608341147724f8b301a50eae1500f94eaaef1074c14c516c32d3f5628b8b16dbe42b7ad812c1a221240c1d4c5cd240144a00976c196f0735 diff --git a/zsh-5.5.1.tar.xz.asc b/zsh-5.5.1.tar.xz.asc deleted file mode 100644 index c4f8955..0000000 --- a/zsh-5.5.1.tar.xz.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1 - -iQEcBAABCAAGBQJa1Op5AAoJEKcdmp1L2yezMOoH/3d9WE9GurXK9ZLF/IF3RZjj -G82A1FIylBIO+JCbZLHLqX359HNC42/6p/DuzrgtfTJpSXLKGyNeiuKDhLWD75B9 -mpVfOeNXXWyyxgT0NW9L2mPYOUfwn4GyYO/+CC7z68fCLoXDGjTDIkPZOEIPHhvg -/QWD/0qCRcBr1OaDKowtRS4+Dvj5AH0YRzWYuqPYMPcDfZ20IVZ2HPKROir9coGu -PyI5ToAswA6OFwCsq4WGgwUno2JiaOoFDR0imkNetvkqz7RXgwghu8r+a6GPPWOf -eydUuUmvlj0COoeAJmJ8KL2u6GnVgUmTCswo3VNOpUE9USxcP0oB44+SyeZ6KDk= -=uo1d ------END PGP SIGNATURE----- diff --git a/zsh-5.6.tar.xz.asc b/zsh-5.6.tar.xz.asc new file mode 100644 index 0000000..19699dc --- /dev/null +++ b/zsh-5.6.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIrBAABCAAdFiEEbrYLY3zlrL8kSaLa2yfpl0Ka8gwFAluNUFAACgkQ2yfpl0Ka +8gzc/A/Aics9Pcj1h38Gt9ktf9PlVSSVpbixUN8rF8WqV6HetsJAHIHgME8l8wSd +7uX51STBvvC9EMdhm8SSGJjqgto1BB/57/V4fCJ6TZWBbLUJcTJprpZTZTftgO13 +B6et/SKvB6LDNo/t4LXWgfTPwx4/5rp7703wVF9r9+BwjVFEDetjzgxjN+vewaOM +L0WfLZcODXTXxLtXIlEmVbyLNZnJ+i3Pb7E/van4q4LpOmkwVhxOvcpshQ8JuOuE +DSwOhk2kTadBiDBv860ykAbYZAtyEylj60klzQt9gkgRspFWiiTvAxeoeJYU6IoR +U2ArSzAs1frHLgRx4FhrIQ6UlVMmtV25qQdUVCmSqBOlFXeb0TNKFZZb37oLkFbX +TsRMLXc51mFYVS6KhJXJPYfsSFGeJ0o9dw1bPh/KukcjWNqYuFU0pBrIy+IeVU5K +gWKeic/a8y0EQaQ6EU0tdjfTi7XXZGMAuDdFqm5TEHpjobchwFhJcj3lPZSaNPyN +xUKpkrRvv6spWkomowPdvOXXlspaVfwpYTVabn3yKEe7BH6fUGiAHgibJjElGYFs +oILH+ZO2kz6tRw5KH/fg6EjxhcjJox0wIVdFoL3I0gVa4QkUbXKE9sWKzWm35pXY ++QDwiUzKRH7frYDruoa5zZv2yut5pQvLGItdEc6J +=1CeE +-----END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index 2d13c7e..3122a27 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.5.1 -Release: 2%{?dist} +Version: 5.6 +Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -167,6 +167,9 @@ fi %doc Doc/*.html %changelog +* Tue Sep 04 2018 Kamil Dudka - 5.6-1 +- update to latest upstream release (fixes CVE-2018-0502 and CVE-2018-13259) + * Sat Jul 14 2018 Fedora Release Engineering - 5.5.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 2b3a2bb6907e9945b64e30892593ab3cce56eb71 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 4 Sep 2018 16:48:44 +0200 Subject: [PATCH 18/74] Resolves: CVE-2018-0502 CVE-2018-13259 - fix two security issues in shebang line parsing --- ...h-5.5.1-CVE-2018-0502-CVE-2018-13259.patch | 134 ++++++++++++++++++ zsh.spec | 8 +- 2 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 0001-zsh-5.5.1-CVE-2018-0502-CVE-2018-13259.patch diff --git a/0001-zsh-5.5.1-CVE-2018-0502-CVE-2018-13259.patch b/0001-zsh-5.5.1-CVE-2018-0502-CVE-2018-13259.patch new file mode 100644 index 0000000..c2f588e --- /dev/null +++ b/0001-zsh-5.5.1-CVE-2018-0502-CVE-2018-13259.patch @@ -0,0 +1,134 @@ +From ddb6c5b4c0ab9c6a7404112d367f0c7cc400ceec Mon Sep 17 00:00:00 2001 +From: Anthony Sottile +Date: Mon, 3 Sep 2018 14:39:25 +0000 +Subject: [PATCH] CVE-2018-0502, CVE-2018-13259: Fix two security issues in + shebang line parsing. + +See NEWS for more information. + +Patch by Anthony Sottile and Buck Evan. + +Upstream-commit: 1c4c7b6a4d17294df028322b70c53803a402233d +Signed-off-by: Kamil Dudka +--- + Src/exec.c | 36 ++++++++++++++++++++---------------- + Test/A05execution.ztst | 22 ++++++++++++++++++++++ + 3 files changed, 43 insertions(+), 17 deletions(-) + +diff --git a/Src/exec.c b/Src/exec.c +index 216057a..0908a1a 100644 +--- a/Src/exec.c ++++ b/Src/exec.c +@@ -453,7 +453,7 @@ execcursh(Estate state, int do_exec) + + /* execve after handling $_ and #! */ + +-#define POUNDBANGLIMIT 64 ++#define POUNDBANGLIMIT 128 + + /**/ + static int +@@ -494,18 +494,20 @@ zexecve(char *pth, char **argv, char **newenvp) + if ((fd = open(pth, O_RDONLY|O_NOCTTY)) >= 0) { + argv0 = *argv; + *argv = pth; +- execvebuf[0] = '\0'; ++ memset(execvebuf, '\0', POUNDBANGLIMIT + 1); + ct = read(fd, execvebuf, POUNDBANGLIMIT); + close(fd); + if (ct >= 0) { +- if (execvebuf[0] == '#') { +- if (execvebuf[1] == '!') { +- for (t0 = 0; t0 != ct; t0++) +- if (execvebuf[t0] == '\n') +- break; ++ if (ct >= 2 && execvebuf[0] == '#' && execvebuf[1] == '!') { ++ for (t0 = 0; t0 != ct; t0++) ++ if (execvebuf[t0] == '\n') ++ break; ++ if (t0 == ct) ++ zerr("%s: bad interpreter: %s: %e", pth, ++ execvebuf + 2, eno); ++ else { + while (inblank(execvebuf[t0])) + execvebuf[t0--] = '\0'; +- execvebuf[POUNDBANGLIMIT] = '\0'; + for (ptr = execvebuf + 2; *ptr && *ptr == ' '; ptr++); + for (ptr2 = ptr; *ptr && *ptr != ' '; ptr++); + if (eno == ENOENT) { +@@ -514,10 +516,16 @@ zexecve(char *pth, char **argv, char **newenvp) + *ptr = '\0'; + if (*ptr2 != '/' && + (pprog = pathprog(ptr2, NULL))) { +- argv[-2] = ptr2; +- argv[-1] = ptr + 1; +- winch_unblock(); +- execve(pprog, argv - 2, newenvp); ++ if (ptr == execvebuf + t0 + 1) { ++ argv[-1] = ptr2; ++ winch_unblock(); ++ execve(pprog, argv - 1, newenvp); ++ } else { ++ argv[-2] = ptr2; ++ argv[-1] = ptr + 1; ++ winch_unblock(); ++ execve(pprog, argv - 2, newenvp); ++ } + } + zerr("%s: bad interpreter: %s: %e", pth, ptr2, + eno); +@@ -532,10 +540,6 @@ zexecve(char *pth, char **argv, char **newenvp) + winch_unblock(); + execve(ptr2, argv - 1, newenvp); + } +- } else if (eno == ENOEXEC) { +- argv[-1] = "sh"; +- winch_unblock(); +- execve("/bin/sh", argv - 1, newenvp); + } + } else if (eno == ENOEXEC) { + for (t0 = 0; t0 != ct; t0++) +diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst +index 0804691..fb39d05 100644 +--- a/Test/A05execution.ztst ++++ b/Test/A05execution.ztst +@@ -12,7 +12,14 @@ + + print '#!/bin/sh\necho This is dir2' >dir2/tstcmd + ++ print -n '#!sh\necho This is slashless' >tstcmd-slashless ++ print -n '#!echo foo\necho This is arg' >tstcmd-arg ++ print '#!xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxnyyy' >tstcmd-interp-too-long ++ print '#!/bin/sh\necho should not execute; exit 1' >xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxn ++ + chmod 755 tstcmd dir1/tstcmd dir2/tstcmd ++ chmod 755 tstcmd-slashless tstcmd-arg tstcmd-interp-too-long ++ chmod 755 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxn + + %test + ./tstcmd +@@ -33,6 +40,21 @@ + 0:path (2) + >This is top + ++ PATH=/bin:${ZTST_testdir}/command.tmp/ tstcmd-slashless ++0:path (3) ++>This is slashless ++ ++ PATH=/bin:${ZTST_testdir}/command.tmp tstcmd-arg ++0:path (4) ++*>foo */command.tmp/tstcmd-arg ++ ++ path=(/bin ${ZTST_testdir}/command.tmp/) ++ tstcmd-interp-too-long 2>&1; echo "status $?" ++ path=($storepath) ++0:path (5) ++*>*tstcmd-interp-too-long: bad interpreter: x*xn: no such file or directory ++>status 127 ++ + functst() { print $# arguments:; print -l $*; } + functst "Eines Morgens" "als Gregor Samsa" + functst "" +-- +2.17.1 + diff --git a/zsh.spec b/zsh.spec index 710f4b7..2488cc0 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.4.1 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.xz @@ -12,6 +12,9 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc +# fix two security issues in shebang line parsing (CVE-2018-0502 CVE-2018-13259) +Patch1: 0001-zsh-5.5.1-CVE-2018-0502-CVE-2018-13259.patch + # avoid NULL dereference when using ${(PA)...} on an empty array (CVE-2018-7548) Patch4: 0004-zsh-5.4.2-CVE-2018-7548.patch @@ -183,6 +186,9 @@ fi %doc Doc/*.html %changelog +* Tue Sep 04 2018 Kamil Dudka - 5.4.1-4 +- fix two security issues in shebang line parsing (CVE-2018-0502 CVE-2018-13259) + * Wed Apr 18 2018 Kamil Dudka - 5.4.1-3 - fix stack-based buffer overflow in utils.c:checkmailpath() (CVE-2018-1100) - fix stack-based buffer overflow in gen_matches_files() (CVE-2018-1083) From cf912229b13ed4a73566147e850f11849e18054c Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 10 Sep 2018 10:27:32 +0200 Subject: [PATCH 19/74] update to latest upstream release: 5.6.1 --- sources | 2 +- zsh-5.6.1.tar.xz.asc | 16 ++++++++++++++++ zsh-5.6.tar.xz.asc | 16 ---------------- zsh.spec | 5 ++++- 4 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 zsh-5.6.1.tar.xz.asc delete mode 100644 zsh-5.6.tar.xz.asc diff --git a/sources b/sources index e562bd1..3020e91 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.6.tar.xz) = 791cbeff45a5ef86608341147724f8b301a50eae1500f94eaaef1074c14c516c32d3f5628b8b16dbe42b7ad812c1a221240c1d4c5cd240144a00976c196f0735 +SHA512 (zsh-5.6.1.tar.xz) = 45a60b864482a276277d8443f6faf41a2f63e11ab89a4ec0276c897971f34a874393f79c118af915b8f325a1b0265a457a1a82e8d33530f7fb797ece9c2adb7b diff --git a/zsh-5.6.1.tar.xz.asc b/zsh-5.6.1.tar.xz.asc new file mode 100644 index 0000000..e290158 --- /dev/null +++ b/zsh-5.6.1.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIrBAABCAAdFiEEbrYLY3zlrL8kSaLa2yfpl0Ka8gwFAluUCuwACgkQ2yfpl0Ka +8gy5oQ+/bpIICRFLndgxnDYuW+xjtIsXW2nzuKkDTI7taPJ3zvanitho40MpCha4 +TMes8/ZPia3rSW1sFFot9k8LFrvb74/mfnDh5OQTVWe33HFrdwOrPcNaXx7gDOho +7HZ52jVF88Z3eGe0tZXazsFyXs7MF1lojLonT2Q4EX0Nj/AIK7wOiYopaIrrUfGi +nLPMg3u13KpgLpuo8EVz+k90E1cInEI69QO5T+ZVaLA55lH/uHijgV7NpA6tuDQj +ckdmXY+HB1FDD3C2HOxUMEn4FYL1Z5G7SxjWJg7ecptfCkWNL2N6qsO8WAYPEftY +2KxoPblnZQjPpXTuK/oZVySDJ5NW9A32Ae4lNISaPrlG51WEqP8d6nAWoPZ64bDr +X1/MWqZDYcbv82fK0K11Em6/PZWHm2EvYnf1neVj4Ys6bUvj/ZE9mkRXoZzBdWhZ +cNtitTGLixj66eCguVGLe4velPTn2qXI4qHK84C+4AtLkrEvp5tzG6/YSfmcqDnq +SyaZ+/402p7ImymCpmCM3Bp8pesFL5qryShIgKitRTvrV6vWzQ5doNMEaQiud+v5 +3I2M/8UDT81iY7RwtrsiQP59+dLqQL0Ri4EKmPVVEOv7q5UKpFut5tF5nZlNbV4e +NB8GDKg8TkgE5RZDZgCnAzYVK4jdoT1Q2ca9BEoU +=ZoLC +-----END PGP SIGNATURE----- diff --git a/zsh-5.6.tar.xz.asc b/zsh-5.6.tar.xz.asc deleted file mode 100644 index 19699dc..0000000 --- a/zsh-5.6.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIrBAABCAAdFiEEbrYLY3zlrL8kSaLa2yfpl0Ka8gwFAluNUFAACgkQ2yfpl0Ka -8gzc/A/Aics9Pcj1h38Gt9ktf9PlVSSVpbixUN8rF8WqV6HetsJAHIHgME8l8wSd -7uX51STBvvC9EMdhm8SSGJjqgto1BB/57/V4fCJ6TZWBbLUJcTJprpZTZTftgO13 -B6et/SKvB6LDNo/t4LXWgfTPwx4/5rp7703wVF9r9+BwjVFEDetjzgxjN+vewaOM -L0WfLZcODXTXxLtXIlEmVbyLNZnJ+i3Pb7E/van4q4LpOmkwVhxOvcpshQ8JuOuE -DSwOhk2kTadBiDBv860ykAbYZAtyEylj60klzQt9gkgRspFWiiTvAxeoeJYU6IoR -U2ArSzAs1frHLgRx4FhrIQ6UlVMmtV25qQdUVCmSqBOlFXeb0TNKFZZb37oLkFbX -TsRMLXc51mFYVS6KhJXJPYfsSFGeJ0o9dw1bPh/KukcjWNqYuFU0pBrIy+IeVU5K -gWKeic/a8y0EQaQ6EU0tdjfTi7XXZGMAuDdFqm5TEHpjobchwFhJcj3lPZSaNPyN -xUKpkrRvv6spWkomowPdvOXXlspaVfwpYTVabn3yKEe7BH6fUGiAHgibJjElGYFs -oILH+ZO2kz6tRw5KH/fg6EjxhcjJox0wIVdFoL3I0gVa4QkUbXKE9sWKzWm35pXY -+QDwiUzKRH7frYDruoa5zZv2yut5pQvLGItdEc6J -=1CeE ------END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index 3122a27..14cdf53 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,6 +1,6 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.6 +Version: 5.6.1 Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ @@ -167,6 +167,9 @@ fi %doc Doc/*.html %changelog +* Mon Sep 10 2018 Kamil Dudka - 5.6.1-1 +- update to latest upstream release + * Tue Sep 04 2018 Kamil Dudka - 5.6-1 - update to latest upstream release (fixes CVE-2018-0502 and CVE-2018-13259) From b1f219f712d17006b7fb63d90acf47ff9422d6a7 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 14 Sep 2018 16:34:35 +0200 Subject: [PATCH 20/74] update to latest upstream release: 5.6.2 --- sources | 2 +- zsh-5.6.1.tar.xz.asc | 16 ---------------- zsh-5.6.2.tar.xz.asc | 16 ++++++++++++++++ zsh.spec | 5 ++++- 4 files changed, 21 insertions(+), 18 deletions(-) delete mode 100644 zsh-5.6.1.tar.xz.asc create mode 100644 zsh-5.6.2.tar.xz.asc diff --git a/sources b/sources index 3020e91..498d609 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.6.1.tar.xz) = 45a60b864482a276277d8443f6faf41a2f63e11ab89a4ec0276c897971f34a874393f79c118af915b8f325a1b0265a457a1a82e8d33530f7fb797ece9c2adb7b +SHA512 (zsh-5.6.2.tar.xz) = f0a49e41b55eb478692ab5471d7c9828956b7e96bc82944202b0ef1c49a889b21a0e7682aa5f59fd0054ebfd866c2244c8a622e7aa46c13038af5c226c48a3a2 diff --git a/zsh-5.6.1.tar.xz.asc b/zsh-5.6.1.tar.xz.asc deleted file mode 100644 index e290158..0000000 --- a/zsh-5.6.1.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIrBAABCAAdFiEEbrYLY3zlrL8kSaLa2yfpl0Ka8gwFAluUCuwACgkQ2yfpl0Ka -8gy5oQ+/bpIICRFLndgxnDYuW+xjtIsXW2nzuKkDTI7taPJ3zvanitho40MpCha4 -TMes8/ZPia3rSW1sFFot9k8LFrvb74/mfnDh5OQTVWe33HFrdwOrPcNaXx7gDOho -7HZ52jVF88Z3eGe0tZXazsFyXs7MF1lojLonT2Q4EX0Nj/AIK7wOiYopaIrrUfGi -nLPMg3u13KpgLpuo8EVz+k90E1cInEI69QO5T+ZVaLA55lH/uHijgV7NpA6tuDQj -ckdmXY+HB1FDD3C2HOxUMEn4FYL1Z5G7SxjWJg7ecptfCkWNL2N6qsO8WAYPEftY -2KxoPblnZQjPpXTuK/oZVySDJ5NW9A32Ae4lNISaPrlG51WEqP8d6nAWoPZ64bDr -X1/MWqZDYcbv82fK0K11Em6/PZWHm2EvYnf1neVj4Ys6bUvj/ZE9mkRXoZzBdWhZ -cNtitTGLixj66eCguVGLe4velPTn2qXI4qHK84C+4AtLkrEvp5tzG6/YSfmcqDnq -SyaZ+/402p7ImymCpmCM3Bp8pesFL5qryShIgKitRTvrV6vWzQ5doNMEaQiud+v5 -3I2M/8UDT81iY7RwtrsiQP59+dLqQL0Ri4EKmPVVEOv7q5UKpFut5tF5nZlNbV4e -NB8GDKg8TkgE5RZDZgCnAzYVK4jdoT1Q2ca9BEoU -=ZoLC ------END PGP SIGNATURE----- diff --git a/zsh-5.6.2.tar.xz.asc b/zsh-5.6.2.tar.xz.asc new file mode 100644 index 0000000..dabd0df --- /dev/null +++ b/zsh-5.6.2.tar.xz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIrBAABCAAdFiEEbrYLY3zlrL8kSaLa2yfpl0Ka8gwFAlubsHoACgkQ2yfpl0Ka +8gxmjQ+/eMvCUVT+tGWkf1OlOT7RNaQmynYMkNNDd/9d+C2IHGLbUgrwaIcxCARC +LY+ijW917+mRTR+JT5BfKXFuoRnH/0Unhv8jP3UhKo2vVoQfibawIYluPtsoTTV/ +8pwEJG74Xuh9TDohwQekrOI295k7KblAa5hnPGoWCuWicBETg4+glfR3zO6+b5ed +5Qh4Nw+Pr3lmYM3MOHu7/ChDaaCinT5y2IIYZqilZriReDwlXJo+Iv1v1TxI3jbk +9OYhsbnqdIz0r5nj5BlkVPgai4f8ecd1wS78olVUNHFA8I/jql+9VVgLP3AE33Zz +UKrXsuqb9G9YL4Bm2mmNfy31gqsH4HcbNNVx8jpJJRzWOj6DvVpFkyfKUuupQIe4 +fxqKJv66pNte1s9eQb8upXSvPzbxJhe1X14Yq5pzRjzh5BRW/dRctaa9PGnZbHKR +GGS6j8DIIoe4yNVeTVZQLiH4BnoHjktNdbE4TluvUG8w+im/Qv4nTytaVz5L8sIp +J0mX6zpYTnXpYampZQGTMxeHDaVPnP/oKGpwwjuhJwfxlQLYUCd8lprcynf8sX+2 +6C3tdjN/6xO7VzDuITW/57yxa8IF8Ek2DF4GNOLVJfmTBuV2FHii2xZGCd24e5DQ +RA5K8mqZPuCdzZ0+x3kN5Cwr0aLRqEjGzHhbUjd7 +=fd25 +-----END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index 14cdf53..b01961a 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,6 +1,6 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.6.1 +Version: 5.6.2 Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ @@ -167,6 +167,9 @@ fi %doc Doc/*.html %changelog +* Fri Sep 14 2018 Kamil Dudka - 5.6.2-1 +- update to latest upstream release + * Mon Sep 10 2018 Kamil Dudka - 5.6.1-1 - update to latest upstream release From 9bba558cc887c7ecd955959b08861de8e5a17aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pl=C3=ADchal?= Date: Wed, 12 Sep 2018 09:30:44 +0200 Subject: [PATCH 21/74] Enable CI tests using the Standard Test Interface Adding initial set of basic functionality tests for mksh according to the Standard Test Interface [1]. See Quick Start Guide [2] for brief introduction about how to run these tests and the Fedora CI portal [3] for more detailed info and links. [1] https://fedoraproject.org/wiki/CI/Standard_Test_Interface [2] https://fedoraproject.org/wiki/CI/Quick_Start_Guide [3] https://fedoraproject.org/wiki/CI --- tests/tests.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/tests.yml diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..3d505a4 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,17 @@ +--- + +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + repositories: + - repo: "https://src.fedoraproject.org/tests/shell.git" + dest: "shell" + fmf_filter: "tier: 1, 2" + environment: + PACKAGES: zsh + SH_BIN: zsh + required_packages: + - expect # login requires expect + - which # smoke requires which From d431dce30ffa85878c34628b5bcd226aa31a7c81 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 12 Nov 2018 14:54:50 +0100 Subject: [PATCH 22/74] fix programming mistakes detected by static analysis --- 0002-zsh-5.5.1-static-analysis.patch | 266 +++++++++++++++++++++++++++ zsh.spec | 8 +- 2 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 0002-zsh-5.5.1-static-analysis.patch diff --git a/0002-zsh-5.5.1-static-analysis.patch b/0002-zsh-5.5.1-static-analysis.patch new file mode 100644 index 0000000..4bec6e1 --- /dev/null +++ b/0002-zsh-5.5.1-static-analysis.patch @@ -0,0 +1,266 @@ +From bc943b78268ad633f79756639d4295f7b61dbedd Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Wed, 7 Nov 2018 14:04:52 +0100 +Subject: [PATCH 1/5] 43791: File descriptor could be closed twice in clone + +Upstream-commit: a8cc017c74a916b690dc074c299faf4bd24b5af4 +Signed-off-by: Kamil Dudka + +Error: USE_AFTER_FREE (CWE-825): +zsh-5.5.1/Src/Modules/clone.c:71: closed_arg: "close(int)" closes "ttyfd". +zsh-5.5.1/Src/Modules/clone.c:99: double_close: Calling "close(int)" closes handle "ttyfd" which has already been closed. + 97| setsparam("TTY", ztrdup(ttystrname)); + 98| } + 99|-> close(ttyfd); +100| if (pid < 0) { +101| zerrnam(nam, "fork failed: %e", errno); +--- + Src/Modules/clone.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Src/Modules/clone.c b/Src/Modules/clone.c +index 9304292..dfd8e8a 100644 +--- a/Src/Modules/clone.c ++++ b/Src/Modules/clone.c +@@ -96,7 +96,8 @@ bin_clone(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) + init_io(NULL); + setsparam("TTY", ztrdup(ttystrname)); + } +- close(ttyfd); ++ else ++ close(ttyfd); + if (pid < 0) { + zerrnam(nam, "fork failed: %e", errno); + return 1; +-- +2.17.2 + + +From 6096988f02635ed336a056e3670b63070400e6bc Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Wed, 7 Nov 2018 14:04:53 +0100 +Subject: [PATCH 2/5] 43793: computil could overrun buffer + +Upstream-commit: 031afe420725e328e9d7742be69ef0bd81c62b9a +Signed-off-by: Kamil Dudka + +Error: BUFFER_SIZE (CWE-120): +zsh-5.5.1/Src/Zle/computil.c:564: overlapping_buffer: The source buffer "str->str + 2" potentially overlaps with the destination buffer "str->str", which results in undefined behavior for "strcpy". +zsh-5.5.1/Src/Zle/computil.c:564: remediation: Replace "strcpy(dest, src)" with "memmove(dest, src, strlen(src)+1)". +562| str->str = ztrdup(str->str); +563| if (hide[1] && str->str[0] == '-' && str->str[1] == '-') +564|-> strcpy(str->str, str->str + 2); +565| else if (str->str[0] == '-' || str->str[0] == '+') +566| strcpy(str->str, str->str + 1); + +Error: BUFFER_SIZE (CWE-120): +zsh-5.5.1/Src/Zle/computil.c:566: overlapping_buffer: The source buffer "str->str + 1" potentially overlaps with the destination buffer "str->str", which results in undefined behavior for "strcpy". +zsh-5.5.1/Src/Zle/computil.c:566: remediation: Replace "strcpy(dest, src)" with "memmove(dest, src, strlen(src)+1)". +564| strcpy(str->str, str->str + 2); +565| else if (str->str[0] == '-' || str->str[0] == '+') +566|-> strcpy(str->str, str->str + 1); +567| } +568| } +--- + Src/Zle/computil.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c +index 5526e0a..cb1c010 100644 +--- a/Src/Zle/computil.c ++++ b/Src/Zle/computil.c +@@ -561,9 +561,9 @@ cd_init(char *nam, char *hide, char *mlen, char *sep, + if (str->str == str->match) + str->str = ztrdup(str->str); + if (hide[1] && str->str[0] == '-' && str->str[1] == '-') +- strcpy(str->str, str->str + 2); ++ memmove(str->str, str->str + 2, strlen(str->str) - 1); + else if (str->str[0] == '-' || str->str[0] == '+') +- strcpy(str->str, str->str + 1); ++ memmove(str->str, str->str + 1, strlen(str->str)); + } + } + for (ap = args; *args && +-- +2.17.2 + + +From 29445bdf10714bd41d2124d3c31cc16c1f682854 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Wed, 7 Nov 2018 14:04:54 +0100 +Subject: [PATCH 3/5] 43723: file descriptor could leak on fork error + +Upstream-commit: d1095bdf744c190c7e8ff126ba02caea8f63880d +Signed-off-by: Kamil Dudka + +Error: RESOURCE_LEAK (CWE-772): +zsh-5.5.1/Src/exec.c:4680: open_fn: Returning handle opened by "open". +zsh-5.5.1/Src/exec.c:4680: var_assign: Assigning: "fd" = handle returned from "open(nam, 449, 384)". +zsh-5.5.1/Src/exec.c:4810: leaked_handle: Handle variable "fd" going out of scope leaks the handle. +4808| /* fork or open error */ +4809| child_unblock(); +4810|-> return nam; +4811| } else if (pid) { +4812| int os; +--- + Src/exec.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Src/exec.c b/Src/exec.c +index 0908a1a..8045db2 100644 +--- a/Src/exec.c ++++ b/Src/exec.c +@@ -4722,7 +4722,8 @@ getoutputfile(char *cmd, char **eptr) + } + + if ((cmdoutpid = pid = zfork(NULL)) == -1) { +- /* fork or open error */ ++ /* fork error */ ++ close(fd); + child_unblock(); + return nam; + } else if (pid) { +-- +2.17.2 + + +From afb4192a75066f86ce7051a72c0feb7b80c0cdd8 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Wed, 7 Nov 2018 14:04:55 +0100 +Subject: [PATCH 4/5] 43789: possible use after free clearing up math func from + module + +Upstream-commit: e27175c7c8cdfeb4e28d4ff21eb51aa003d70a03 +Signed-off-by: Kamil Dudka + +Error: USE_AFTER_FREE (CWE-825): +zsh-5.5.1/Src/module.c:1390: freed_arg: "deletemathfunc" frees "f". +zsh-5.5.1/Src/module.c:1352:6: freed_arg: "zfree" frees parameter "f". +zsh-5.5.1/Src/mem.c:1888:5: freed_arg: "free" frees parameter "p". +zsh-5.5.1/Src/module.c:1394: deref_after_free: Dereferencing freed pointer "f". +1392| ret = 1; +1393| } else { +1394|-> f->flags &= ~MFF_ADDED; +1395| } +1396| } +--- + Src/module.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/Src/module.c b/Src/module.c +index 4ae7831..33d75eb 100644 +--- a/Src/module.c ++++ b/Src/module.c +@@ -1390,8 +1390,6 @@ setmathfuncs(char const *nam, MathFunc f, int size, int *e) + if (deletemathfunc(f)) { + zwarnnam(nam, "math function `%s' already deleted", f->name); + ret = 1; +- } else { +- f->flags &= ~MFF_ADDED; + } + } + f++; +-- +2.17.2 + + +From 4553645c00d9a2e81a79e2014b106f6590500287 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Wed, 7 Nov 2018 14:04:56 +0100 +Subject: [PATCH 5/5] 43790: failed mailstat could leak memory + +Upstream-commit: d50e204b0c4c10164a711bf640500e46987de9c3 +Signed-off-by: Kamil Dudka + +Error: RESOURCE_LEAK (CWE-772): +zsh-5.5.1/Src/utils.c:7406: alloc_fn: Storage is returned from allocation function "appstr". +zsh-5.5.1/Src/string.c:200:5: alloc_fn: Storage is returned from allocation function "realloc". +zsh-5.5.1/Src/string.c:200:5: identity_transfer: Passing "realloc(base, strlen(base) + strlen(append) + 1UL)" as argument 1 to function "strcat", which returns that argument. +zsh-5.5.1/Src/string.c:200:5: return_alloc_fn: Directly returning storage allocated by "strcat". +zsh-5.5.1/Src/utils.c:7406: var_assign: Assigning: "dir" = storage returned from "appstr(ztrdup(path), "/cur")". +zsh-5.5.1/Src/utils.c:7407: noescape: Resource "dir" is not freed or pointed-to in "stat". +zsh-5.5.1/Src/utils.c:7407: leaked_storage: Variable "dir" going out of scope leaks the storage it points to. +7405| /* See if cur/ is present */ +7406| dir = appstr(ztrdup(path), "/cur"); +7407|-> if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; +7408| st_ret.st_atime = st_tmp.st_atime; +7409| + +Error: RESOURCE_LEAK (CWE-772): +zsh-5.5.1/Src/utils.c:7412: alloc_fn: Storage is returned from allocation function "appstr". +zsh-5.5.1/Src/string.c:200:5: alloc_fn: Storage is returned from allocation function "realloc". +zsh-5.5.1/Src/string.c:200:5: identity_transfer: Passing "realloc(base, strlen(base) + strlen(append) + 1UL)" as argument 1 to function "strcat", which returns that argument. +zsh-5.5.1/Src/string.c:200:5: return_alloc_fn: Directly returning storage allocated by "strcat". +zsh-5.5.1/Src/utils.c:7412: var_assign: Assigning: "dir" = storage returned from "appstr(dir, "/tmp")". +zsh-5.5.1/Src/utils.c:7413: noescape: Resource "dir" is not freed or pointed-to in "stat". +zsh-5.5.1/Src/utils.c:7413: leaked_storage: Variable "dir" going out of scope leaks the storage it points to. +7411| dir[plen] = 0; +7412| dir = appstr(dir, "/tmp"); +7413|-> if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; +7414| st_ret.st_mtime = st_tmp.st_mtime; +7415| + +Error: RESOURCE_LEAK (CWE-772): +zsh-5.5.1/Src/utils.c:7418: alloc_fn: Storage is returned from allocation function "appstr". +zsh-5.5.1/Src/string.c:200:5: alloc_fn: Storage is returned from allocation function "realloc". +zsh-5.5.1/Src/string.c:200:5: identity_transfer: Passing "realloc(base, strlen(base) + strlen(append) + 1UL)" as argument 1 to function "strcat", which returns that argument. +zsh-5.5.1/Src/string.c:200:5: return_alloc_fn: Directly returning storage allocated by "strcat". +zsh-5.5.1/Src/utils.c:7418: var_assign: Assigning: "dir" = storage returned from "appstr(dir, "/new")". +zsh-5.5.1/Src/utils.c:7419: noescape: Resource "dir" is not freed or pointed-to in "stat". +zsh-5.5.1/Src/utils.c:7419: leaked_storage: Variable "dir" going out of scope leaks the storage it points to. +7417| dir[plen] = 0; +7418| dir = appstr(dir, "/new"); +7419|-> if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; +7420| st_ret.st_mtime = st_tmp.st_mtime; +7421| +--- + Src/utils.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/Src/utils.c b/Src/utils.c +index b418517..492babc 100644 +--- a/Src/utils.c ++++ b/Src/utils.c +@@ -7404,19 +7404,28 @@ mailstat(char *path, struct stat *st) + + /* See if cur/ is present */ + dir = appstr(ztrdup(path), "/cur"); +- if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; ++ if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) { ++ zsfree(dir); ++ return 0; ++ } + st_ret.st_atime = st_tmp.st_atime; + + /* See if tmp/ is present */ + dir[plen] = 0; + dir = appstr(dir, "/tmp"); +- if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; ++ if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) { ++ zsfree(dir); ++ return 0; ++ } + st_ret.st_mtime = st_tmp.st_mtime; + + /* And new/ */ + dir[plen] = 0; + dir = appstr(dir, "/new"); +- if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; ++ if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) { ++ zsfree(dir); ++ return 0; ++ } + st_ret.st_mtime = st_tmp.st_mtime; + + #if THERE_IS_EXACTLY_ONE_MAILDIR_IN_MAILPATH +@@ -7428,6 +7437,7 @@ mailstat(char *path, struct stat *st) + st_tmp.st_atime == st_new_last.st_atime && + st_tmp.st_mtime == st_new_last.st_mtime) { + *st = st_ret_last; ++ zsfree(dir); + return 0; + } + st_new_last = st_tmp; +-- +2.17.2 + diff --git a/zsh.spec b/zsh.spec index b01961a..c9c07e7 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.6.2 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -12,6 +12,9 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc +# fix programming mistakes detected by static analysis +Patch2: 0002-zsh-5.5.1-static-analysis.patch + BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -167,6 +170,9 @@ fi %doc Doc/*.html %changelog +* Mon Nov 12 2018 Kamil Dudka - 5.6.2-2 +- fix programming mistakes detected by static analysis + * Fri Sep 14 2018 Kamil Dudka - 5.6.2-1 - update to latest upstream release From bcabc2d83600220b56210463f66113f83ad2cab5 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 30 Nov 2018 16:36:32 +0100 Subject: [PATCH 23/74] Resolves: #1654989 - return non-zero exit status on nested parse error --- 0003-zsh-5.5.1-parse-error-exit-status.patch | 28 ++++++++++++++++++++ zsh.spec | 8 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0003-zsh-5.5.1-parse-error-exit-status.patch diff --git a/0003-zsh-5.5.1-parse-error-exit-status.patch b/0003-zsh-5.5.1-parse-error-exit-status.patch new file mode 100644 index 0000000..6605665 --- /dev/null +++ b/0003-zsh-5.5.1-parse-error-exit-status.patch @@ -0,0 +1,28 @@ +From 878ebe3c74cee4b9702c9672b87ee56f057e1f02 Mon Sep 17 00:00:00 2001 +From: Peter Stephenson +Date: Thu, 29 Nov 2018 17:54:02 +0000 +Subject: [PATCH] 43854: Set tok to LEXERR on generic parse error. + +Needed by main loop which detects an error this way. + +Upstream-commit: ef20425381e83ebd5a10c2ab270a347018371162 +Signed-off-by: Kamil Dudka +--- + Src/lex.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Src/lex.c b/Src/lex.c +index 44ad880..c29aaba 100644 +--- a/Src/lex.c ++++ b/Src/lex.c +@@ -1613,6 +1613,7 @@ parsestr(char **s) + zerr("parse error near `%c'", err); + else + zerr("parse error"); ++ tok = LEXERR; + } + } + return err; +-- +2.17.2 + diff --git a/zsh.spec b/zsh.spec index c9c07e7..163ba40 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.6.2 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -15,6 +15,9 @@ Source6: dotzshrc # fix programming mistakes detected by static analysis Patch2: 0002-zsh-5.5.1-static-analysis.patch +# return non-zero exit status on nested parse error (#1654989) +Patch3: 0003-zsh-5.5.1-parse-error-exit-status.patch + BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -170,6 +173,9 @@ fi %doc Doc/*.html %changelog +* Fri Nov 30 2018 Kamil Dudka - 5.6.2-3 +- return non-zero exit status on nested parse error (#1654989) + * Mon Nov 12 2018 Kamil Dudka - 5.6.2-2 - fix programming mistakes detected by static analysis From 0049d9b1ed7030d01aefdb49400b608d11b007cd Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sun, 27 Jan 2019 19:40:40 +0100 Subject: [PATCH 24/74] Remove obsolete scriptlets References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets Signed-off-by: Igor Gnatenko --- zsh.spec | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/zsh.spec b/zsh.spec index 163ba40..1942d1d 100644 --- a/zsh.spec +++ b/zsh.spec @@ -135,22 +135,6 @@ if [ "$1" = 1 ]; then fi fi -if [ -f %{_infodir}/zsh.info.gz ]; then -# This is needed so that --excludedocs works. -/sbin/install-info %{_infodir}/zsh.info.gz %{_infodir}/dir \ - --entry="* zsh: (zsh). An enhanced bourne shell." -fi - - -%preun -if [ "$1" = 0 ] ; then - if [ -f %{_infodir}/zsh.info.gz ]; then - # This is needed so that --excludedocs works. - /sbin/install-info --delete %{_infodir}/zsh.info.gz %{_infodir}/dir \ - --entry="* zsh: (zsh). An enhanced bourne shell." - fi -fi - %postun if [ "$1" = 0 ] && [ -f %{_sysconfdir}/shells ] ; then sed -i '\!^%{_bindir}/%{name}$!d' %{_sysconfdir}/shells From a4fbf297b314cd588f6afdbff6a191866bdb54da Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Mon, 28 Jan 2019 12:35:45 -0600 Subject: [PATCH 25/74] Ignore mockbuild results dir and source rpms. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 5bca285..0a91fd3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /zsh-5.*.*.tar.bz2 /zsh-5.*.tar.xz /zsh-5.4.2.tar.gz +/*.src.rpm +results_*/ From 5fd703981fa412ae123e7df41d401a9b5b8ac4b6 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Mon, 28 Jan 2019 12:36:15 -0600 Subject: [PATCH 26/74] Update to 5.7. Remove upstreamed patches. Add build dep on glibc-langpack-ja to avoid skipping a test. --- 0002-zsh-5.5.1-static-analysis.patch | 266 ------------------- 0003-zsh-5.5.1-parse-error-exit-status.patch | 28 -- sources | 2 +- zsh.spec | 14 +- 4 files changed, 7 insertions(+), 303 deletions(-) delete mode 100644 0002-zsh-5.5.1-static-analysis.patch delete mode 100644 0003-zsh-5.5.1-parse-error-exit-status.patch diff --git a/0002-zsh-5.5.1-static-analysis.patch b/0002-zsh-5.5.1-static-analysis.patch deleted file mode 100644 index 4bec6e1..0000000 --- a/0002-zsh-5.5.1-static-analysis.patch +++ /dev/null @@ -1,266 +0,0 @@ -From bc943b78268ad633f79756639d4295f7b61dbedd Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Wed, 7 Nov 2018 14:04:52 +0100 -Subject: [PATCH 1/5] 43791: File descriptor could be closed twice in clone - -Upstream-commit: a8cc017c74a916b690dc074c299faf4bd24b5af4 -Signed-off-by: Kamil Dudka - -Error: USE_AFTER_FREE (CWE-825): -zsh-5.5.1/Src/Modules/clone.c:71: closed_arg: "close(int)" closes "ttyfd". -zsh-5.5.1/Src/Modules/clone.c:99: double_close: Calling "close(int)" closes handle "ttyfd" which has already been closed. - 97| setsparam("TTY", ztrdup(ttystrname)); - 98| } - 99|-> close(ttyfd); -100| if (pid < 0) { -101| zerrnam(nam, "fork failed: %e", errno); ---- - Src/Modules/clone.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/Src/Modules/clone.c b/Src/Modules/clone.c -index 9304292..dfd8e8a 100644 ---- a/Src/Modules/clone.c -+++ b/Src/Modules/clone.c -@@ -96,7 +96,8 @@ bin_clone(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) - init_io(NULL); - setsparam("TTY", ztrdup(ttystrname)); - } -- close(ttyfd); -+ else -+ close(ttyfd); - if (pid < 0) { - zerrnam(nam, "fork failed: %e", errno); - return 1; --- -2.17.2 - - -From 6096988f02635ed336a056e3670b63070400e6bc Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Wed, 7 Nov 2018 14:04:53 +0100 -Subject: [PATCH 2/5] 43793: computil could overrun buffer - -Upstream-commit: 031afe420725e328e9d7742be69ef0bd81c62b9a -Signed-off-by: Kamil Dudka - -Error: BUFFER_SIZE (CWE-120): -zsh-5.5.1/Src/Zle/computil.c:564: overlapping_buffer: The source buffer "str->str + 2" potentially overlaps with the destination buffer "str->str", which results in undefined behavior for "strcpy". -zsh-5.5.1/Src/Zle/computil.c:564: remediation: Replace "strcpy(dest, src)" with "memmove(dest, src, strlen(src)+1)". -562| str->str = ztrdup(str->str); -563| if (hide[1] && str->str[0] == '-' && str->str[1] == '-') -564|-> strcpy(str->str, str->str + 2); -565| else if (str->str[0] == '-' || str->str[0] == '+') -566| strcpy(str->str, str->str + 1); - -Error: BUFFER_SIZE (CWE-120): -zsh-5.5.1/Src/Zle/computil.c:566: overlapping_buffer: The source buffer "str->str + 1" potentially overlaps with the destination buffer "str->str", which results in undefined behavior for "strcpy". -zsh-5.5.1/Src/Zle/computil.c:566: remediation: Replace "strcpy(dest, src)" with "memmove(dest, src, strlen(src)+1)". -564| strcpy(str->str, str->str + 2); -565| else if (str->str[0] == '-' || str->str[0] == '+') -566|-> strcpy(str->str, str->str + 1); -567| } -568| } ---- - Src/Zle/computil.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c -index 5526e0a..cb1c010 100644 ---- a/Src/Zle/computil.c -+++ b/Src/Zle/computil.c -@@ -561,9 +561,9 @@ cd_init(char *nam, char *hide, char *mlen, char *sep, - if (str->str == str->match) - str->str = ztrdup(str->str); - if (hide[1] && str->str[0] == '-' && str->str[1] == '-') -- strcpy(str->str, str->str + 2); -+ memmove(str->str, str->str + 2, strlen(str->str) - 1); - else if (str->str[0] == '-' || str->str[0] == '+') -- strcpy(str->str, str->str + 1); -+ memmove(str->str, str->str + 1, strlen(str->str)); - } - } - for (ap = args; *args && --- -2.17.2 - - -From 29445bdf10714bd41d2124d3c31cc16c1f682854 Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Wed, 7 Nov 2018 14:04:54 +0100 -Subject: [PATCH 3/5] 43723: file descriptor could leak on fork error - -Upstream-commit: d1095bdf744c190c7e8ff126ba02caea8f63880d -Signed-off-by: Kamil Dudka - -Error: RESOURCE_LEAK (CWE-772): -zsh-5.5.1/Src/exec.c:4680: open_fn: Returning handle opened by "open". -zsh-5.5.1/Src/exec.c:4680: var_assign: Assigning: "fd" = handle returned from "open(nam, 449, 384)". -zsh-5.5.1/Src/exec.c:4810: leaked_handle: Handle variable "fd" going out of scope leaks the handle. -4808| /* fork or open error */ -4809| child_unblock(); -4810|-> return nam; -4811| } else if (pid) { -4812| int os; ---- - Src/exec.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/Src/exec.c b/Src/exec.c -index 0908a1a..8045db2 100644 ---- a/Src/exec.c -+++ b/Src/exec.c -@@ -4722,7 +4722,8 @@ getoutputfile(char *cmd, char **eptr) - } - - if ((cmdoutpid = pid = zfork(NULL)) == -1) { -- /* fork or open error */ -+ /* fork error */ -+ close(fd); - child_unblock(); - return nam; - } else if (pid) { --- -2.17.2 - - -From afb4192a75066f86ce7051a72c0feb7b80c0cdd8 Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Wed, 7 Nov 2018 14:04:55 +0100 -Subject: [PATCH 4/5] 43789: possible use after free clearing up math func from - module - -Upstream-commit: e27175c7c8cdfeb4e28d4ff21eb51aa003d70a03 -Signed-off-by: Kamil Dudka - -Error: USE_AFTER_FREE (CWE-825): -zsh-5.5.1/Src/module.c:1390: freed_arg: "deletemathfunc" frees "f". -zsh-5.5.1/Src/module.c:1352:6: freed_arg: "zfree" frees parameter "f". -zsh-5.5.1/Src/mem.c:1888:5: freed_arg: "free" frees parameter "p". -zsh-5.5.1/Src/module.c:1394: deref_after_free: Dereferencing freed pointer "f". -1392| ret = 1; -1393| } else { -1394|-> f->flags &= ~MFF_ADDED; -1395| } -1396| } ---- - Src/module.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/Src/module.c b/Src/module.c -index 4ae7831..33d75eb 100644 ---- a/Src/module.c -+++ b/Src/module.c -@@ -1390,8 +1390,6 @@ setmathfuncs(char const *nam, MathFunc f, int size, int *e) - if (deletemathfunc(f)) { - zwarnnam(nam, "math function `%s' already deleted", f->name); - ret = 1; -- } else { -- f->flags &= ~MFF_ADDED; - } - } - f++; --- -2.17.2 - - -From 4553645c00d9a2e81a79e2014b106f6590500287 Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Wed, 7 Nov 2018 14:04:56 +0100 -Subject: [PATCH 5/5] 43790: failed mailstat could leak memory - -Upstream-commit: d50e204b0c4c10164a711bf640500e46987de9c3 -Signed-off-by: Kamil Dudka - -Error: RESOURCE_LEAK (CWE-772): -zsh-5.5.1/Src/utils.c:7406: alloc_fn: Storage is returned from allocation function "appstr". -zsh-5.5.1/Src/string.c:200:5: alloc_fn: Storage is returned from allocation function "realloc". -zsh-5.5.1/Src/string.c:200:5: identity_transfer: Passing "realloc(base, strlen(base) + strlen(append) + 1UL)" as argument 1 to function "strcat", which returns that argument. -zsh-5.5.1/Src/string.c:200:5: return_alloc_fn: Directly returning storage allocated by "strcat". -zsh-5.5.1/Src/utils.c:7406: var_assign: Assigning: "dir" = storage returned from "appstr(ztrdup(path), "/cur")". -zsh-5.5.1/Src/utils.c:7407: noescape: Resource "dir" is not freed or pointed-to in "stat". -zsh-5.5.1/Src/utils.c:7407: leaked_storage: Variable "dir" going out of scope leaks the storage it points to. -7405| /* See if cur/ is present */ -7406| dir = appstr(ztrdup(path), "/cur"); -7407|-> if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; -7408| st_ret.st_atime = st_tmp.st_atime; -7409| - -Error: RESOURCE_LEAK (CWE-772): -zsh-5.5.1/Src/utils.c:7412: alloc_fn: Storage is returned from allocation function "appstr". -zsh-5.5.1/Src/string.c:200:5: alloc_fn: Storage is returned from allocation function "realloc". -zsh-5.5.1/Src/string.c:200:5: identity_transfer: Passing "realloc(base, strlen(base) + strlen(append) + 1UL)" as argument 1 to function "strcat", which returns that argument. -zsh-5.5.1/Src/string.c:200:5: return_alloc_fn: Directly returning storage allocated by "strcat". -zsh-5.5.1/Src/utils.c:7412: var_assign: Assigning: "dir" = storage returned from "appstr(dir, "/tmp")". -zsh-5.5.1/Src/utils.c:7413: noescape: Resource "dir" is not freed or pointed-to in "stat". -zsh-5.5.1/Src/utils.c:7413: leaked_storage: Variable "dir" going out of scope leaks the storage it points to. -7411| dir[plen] = 0; -7412| dir = appstr(dir, "/tmp"); -7413|-> if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; -7414| st_ret.st_mtime = st_tmp.st_mtime; -7415| - -Error: RESOURCE_LEAK (CWE-772): -zsh-5.5.1/Src/utils.c:7418: alloc_fn: Storage is returned from allocation function "appstr". -zsh-5.5.1/Src/string.c:200:5: alloc_fn: Storage is returned from allocation function "realloc". -zsh-5.5.1/Src/string.c:200:5: identity_transfer: Passing "realloc(base, strlen(base) + strlen(append) + 1UL)" as argument 1 to function "strcat", which returns that argument. -zsh-5.5.1/Src/string.c:200:5: return_alloc_fn: Directly returning storage allocated by "strcat". -zsh-5.5.1/Src/utils.c:7418: var_assign: Assigning: "dir" = storage returned from "appstr(dir, "/new")". -zsh-5.5.1/Src/utils.c:7419: noescape: Resource "dir" is not freed or pointed-to in "stat". -zsh-5.5.1/Src/utils.c:7419: leaked_storage: Variable "dir" going out of scope leaks the storage it points to. -7417| dir[plen] = 0; -7418| dir = appstr(dir, "/new"); -7419|-> if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; -7420| st_ret.st_mtime = st_tmp.st_mtime; -7421| ---- - Src/utils.c | 16 +++++++++++++--- - 1 file changed, 13 insertions(+), 3 deletions(-) - -diff --git a/Src/utils.c b/Src/utils.c -index b418517..492babc 100644 ---- a/Src/utils.c -+++ b/Src/utils.c -@@ -7404,19 +7404,28 @@ mailstat(char *path, struct stat *st) - - /* See if cur/ is present */ - dir = appstr(ztrdup(path), "/cur"); -- if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; -+ if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) { -+ zsfree(dir); -+ return 0; -+ } - st_ret.st_atime = st_tmp.st_atime; - - /* See if tmp/ is present */ - dir[plen] = 0; - dir = appstr(dir, "/tmp"); -- if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; -+ if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) { -+ zsfree(dir); -+ return 0; -+ } - st_ret.st_mtime = st_tmp.st_mtime; - - /* And new/ */ - dir[plen] = 0; - dir = appstr(dir, "/new"); -- if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) return 0; -+ if (stat(dir, &st_tmp) || !S_ISDIR(st_tmp.st_mode)) { -+ zsfree(dir); -+ return 0; -+ } - st_ret.st_mtime = st_tmp.st_mtime; - - #if THERE_IS_EXACTLY_ONE_MAILDIR_IN_MAILPATH -@@ -7428,6 +7437,7 @@ mailstat(char *path, struct stat *st) - st_tmp.st_atime == st_new_last.st_atime && - st_tmp.st_mtime == st_new_last.st_mtime) { - *st = st_ret_last; -+ zsfree(dir); - return 0; - } - st_new_last = st_tmp; --- -2.17.2 - diff --git a/0003-zsh-5.5.1-parse-error-exit-status.patch b/0003-zsh-5.5.1-parse-error-exit-status.patch deleted file mode 100644 index 6605665..0000000 --- a/0003-zsh-5.5.1-parse-error-exit-status.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 878ebe3c74cee4b9702c9672b87ee56f057e1f02 Mon Sep 17 00:00:00 2001 -From: Peter Stephenson -Date: Thu, 29 Nov 2018 17:54:02 +0000 -Subject: [PATCH] 43854: Set tok to LEXERR on generic parse error. - -Needed by main loop which detects an error this way. - -Upstream-commit: ef20425381e83ebd5a10c2ab270a347018371162 -Signed-off-by: Kamil Dudka ---- - Src/lex.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Src/lex.c b/Src/lex.c -index 44ad880..c29aaba 100644 ---- a/Src/lex.c -+++ b/Src/lex.c -@@ -1613,6 +1613,7 @@ parsestr(char **s) - zerr("parse error near `%c'", err); - else - zerr("parse error"); -+ tok = LEXERR; - } - } - return err; --- -2.17.2 - diff --git a/sources b/sources index 498d609..596735a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.6.2.tar.xz) = f0a49e41b55eb478692ab5471d7c9828956b7e96bc82944202b0ef1c49a889b21a0e7682aa5f59fd0054ebfd866c2244c8a622e7aa46c13038af5c226c48a3a2 +SHA512 (zsh-5.7.tar.xz) = cfef5604d6ff30aeb081ed2a2660c861027c0a90169231cdb6b19093ffa6d63946be7b1fde527769e60e5b14bb6853b590bf4a207b63d6ec66fffd30d9a94958 diff --git a/zsh.spec b/zsh.spec index 1942d1d..865db2d 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.6.2 -Release: 3%{?dist} +Version: 5.7 +Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -12,17 +12,12 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc -# fix programming mistakes detected by static analysis -Patch2: 0002-zsh-5.5.1-static-analysis.patch - -# return non-zero exit status on nested parse error (#1654989) -Patch3: 0003-zsh-5.5.1-parse-error-exit-status.patch - BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk BuildRequires: gcc BuildRequires: gdbm-devel +BuildRequires: glibc-langpack-ja BuildRequires: libcap-devel BuildRequires: ncurses-devel BuildRequires: pcre-devel @@ -157,6 +152,9 @@ fi %doc Doc/*.html %changelog +* Mon Jan 28 2019 Jason L Tibbitts III - 5.7-1 +- Update to latest upstream release. + * Fri Nov 30 2018 Kamil Dudka - 5.6.2-3 - return non-zero exit status on nested parse error (#1654989) From 5c5d46e9bbc5fe966e7a8b02c42419e9ff8e73db Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 3 Feb 2019 13:14:59 +0000 Subject: [PATCH 27/74] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 865db2d..ef4c7b3 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.7 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -152,6 +152,9 @@ fi %doc Doc/*.html %changelog +* Sun Feb 03 2019 Fedora Release Engineering - 5.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Mon Jan 28 2019 Jason L Tibbitts III - 5.7-1 - Update to latest upstream release. From 46ee1203c3608540255cf293f7f9f2afcf71088f Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 4 Feb 2019 08:03:19 +0100 Subject: [PATCH 28/74] update to latest upstream release: 5.7.1 --- sources | 2 +- zsh-5.6.2.tar.xz.asc | 16 ---------------- zsh-5.7.1.tar.xz.asc | 11 +++++++++++ zsh.spec | 7 +++++-- 4 files changed, 17 insertions(+), 19 deletions(-) delete mode 100644 zsh-5.6.2.tar.xz.asc create mode 100644 zsh-5.7.1.tar.xz.asc diff --git a/sources b/sources index 596735a..14a66e3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.7.tar.xz) = cfef5604d6ff30aeb081ed2a2660c861027c0a90169231cdb6b19093ffa6d63946be7b1fde527769e60e5b14bb6853b590bf4a207b63d6ec66fffd30d9a94958 +SHA512 (zsh-5.7.1.tar.xz) = a6aa88e1955a80229a4784a128866e325f79a8b5f73c922ab480048411036f1835cbb31daa30ab38bd16ab2a50040eda8f4f1f64704b21b6acc3051b1dbf18d0 diff --git a/zsh-5.6.2.tar.xz.asc b/zsh-5.6.2.tar.xz.asc deleted file mode 100644 index dabd0df..0000000 --- a/zsh-5.6.2.tar.xz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIrBAABCAAdFiEEbrYLY3zlrL8kSaLa2yfpl0Ka8gwFAlubsHoACgkQ2yfpl0Ka -8gxmjQ+/eMvCUVT+tGWkf1OlOT7RNaQmynYMkNNDd/9d+C2IHGLbUgrwaIcxCARC -LY+ijW917+mRTR+JT5BfKXFuoRnH/0Unhv8jP3UhKo2vVoQfibawIYluPtsoTTV/ -8pwEJG74Xuh9TDohwQekrOI295k7KblAa5hnPGoWCuWicBETg4+glfR3zO6+b5ed -5Qh4Nw+Pr3lmYM3MOHu7/ChDaaCinT5y2IIYZqilZriReDwlXJo+Iv1v1TxI3jbk -9OYhsbnqdIz0r5nj5BlkVPgai4f8ecd1wS78olVUNHFA8I/jql+9VVgLP3AE33Zz -UKrXsuqb9G9YL4Bm2mmNfy31gqsH4HcbNNVx8jpJJRzWOj6DvVpFkyfKUuupQIe4 -fxqKJv66pNte1s9eQb8upXSvPzbxJhe1X14Yq5pzRjzh5BRW/dRctaa9PGnZbHKR -GGS6j8DIIoe4yNVeTVZQLiH4BnoHjktNdbE4TluvUG8w+im/Qv4nTytaVz5L8sIp -J0mX6zpYTnXpYampZQGTMxeHDaVPnP/oKGpwwjuhJwfxlQLYUCd8lprcynf8sX+2 -6C3tdjN/6xO7VzDuITW/57yxa8IF8Ek2DF4GNOLVJfmTBuV2FHii2xZGCd24e5DQ -RA5K8mqZPuCdzZ0+x3kN5Cwr0aLRqEjGzHhbUjd7 -=fd25 ------END PGP SIGNATURE----- diff --git a/zsh-5.7.1.tar.xz.asc b/zsh-5.7.1.tar.xz.asc new file mode 100644 index 0000000..bfb4510 --- /dev/null +++ b/zsh-5.7.1.tar.xz.asc @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- + +iQEzBAABCAAdFiEEfKfsqvBiFrkPiUFGrPgUbK6Mu8QFAlxXSocACgkQrPgUbK6M +u8SXPgf/Vw+pYfQXAlGy59MsmArJvU+72zP/Q8Cu9gSuLbNZetwR8Zkubibi1rpO +zCFn0Ps9lR565k9ue+wPUtBhZjEPJVjNALdJK5YaKvh6Dir3/nhoVoS4kobJCHad +k8X6ThID8zOwZ3E49n+2AiNxwKkSej6cUKzZ2CSGaZ077GgnY4M8y6ACSdwEp7w8 +f5W9gUMqxawx0PCfsxkoJNdNrWq0V2WAgVql3qqVqSvLzAijFXUqtDEauwHecDkw +5NqWZVHLqJHWHyYImjo/RQnVcGHLCYLSOiHH9duo1VnLsXUNPC9+8yjTRkEte8UA +38bf8N8gmpaI/sG1Z2v12VXqCV3eqA== +=g3Uh +-----END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index ef4c7b3..e32c532 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.7 -Release: 2%{?dist} +Version: 5.7.1 +Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -152,6 +152,9 @@ fi %doc Doc/*.html %changelog +* Mon Feb 04 2019 Kamil Dudka - 5.7.1-1 +- update to latest upstream release + * Sun Feb 03 2019 Fedora Release Engineering - 5.7-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild From 6ff894c80f799db101ba066b5522cbba5ed24b3c Mon Sep 17 00:00:00 2001 From: Tim Landscheidt Date: Fri, 8 Mar 2019 01:52:44 +0000 Subject: [PATCH 29/74] Remove obsolete requirements for %post/%preun scriptlets --- zsh.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zsh.spec b/zsh.spec index e32c532..b26c8a1 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.7.1 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -24,8 +24,7 @@ BuildRequires: pcre-devel BuildRequires: sed BuildRequires: texi2html BuildRequires: texinfo -Requires(post): info grep -Requires(preun): info +Requires(post): grep Requires(postun): coreutils grep # the hostname package is not available on RHEL-6 @@ -152,6 +151,9 @@ fi %doc Doc/*.html %changelog +* Fri Mar 8 2019 Tim Landscheidt - 5.7.1-2 +- Remove obsolete requirements for %%post/%%preun scriptlets + * Mon Feb 04 2019 Kamil Dudka - 5.7.1-1 - update to latest upstream release From 711462cd2d03bf57a1a8d082e927ad097f86698a Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 12 Mar 2019 09:56:05 +0100 Subject: [PATCH 30/74] Resolves: #1687574 - avoid build failure in case we have working ypcat --- zsh.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index b26c8a1..8aa1eb5 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.7.1 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -73,6 +73,9 @@ sed -e 's|^\.NOTPARALLEL|#.NOTPARALLEL|' -i 'Config/defs.mk.in' # make loading of module's dependencies work again (#1277996) export LIBLDFLAGS='-z lazy' +# avoid build failure in case we have working ypcat (#1687574) +export zsh_cv_sys_nis='no' + %configure \ --enable-etcdir=%{_sysconfdir} \ --with-tcsetpgrp \ @@ -151,6 +154,9 @@ fi %doc Doc/*.html %changelog +* Tue Mar 12 2019 Kamil Dudka - 5.7.1-3 +- avoid build failure in case we have working ypcat (#1687574) + * Fri Mar 8 2019 Tim Landscheidt - 5.7.1-2 - Remove obsolete requirements for %%post/%%preun scriptlets From 143732d6082f5cdf036f780f6e0de87f5adab5a3 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 26 Jul 2019 17:02:14 +0200 Subject: [PATCH 31/74] Resolves: #1722703 - make failed searches of history in Zle robust --- 0001-zsh-5.7.1-zle-history-avoid-crash.patch | 92 ++++++++++++++++++++ zsh.spec | 8 +- 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 0001-zsh-5.7.1-zle-history-avoid-crash.patch diff --git a/0001-zsh-5.7.1-zle-history-avoid-crash.patch b/0001-zsh-5.7.1-zle-history-avoid-crash.patch new file mode 100644 index 0000000..23932c3 --- /dev/null +++ b/0001-zsh-5.7.1-zle-history-avoid-crash.patch @@ -0,0 +1,92 @@ +From 15c190164c375cfe1772ebec92b544ca26a60e28 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Tue, 23 Jul 2019 14:45:48 +0200 +Subject: [PATCH 1/2] 44566: make sure Zle doesn't crash if history entry not + found + +Upstream-commit: f9cd2187875b6f2ebdb9b9a787fac20b2aaf745b +Signed-off-by: Kamil Dudka +--- + Src/Zle/zle_utils.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c +index c6df3d8..633f593 100644 +--- a/Src/Zle/zle_utils.c ++++ b/Src/Zle/zle_utils.c +@@ -1607,7 +1607,12 @@ static int + unapplychange(struct change *ch) + { + if(ch->hist != histline) { +- zle_setline(quietgethist(ch->hist)); ++ Histent he = quietgethist(ch->hist); ++ if(!he) { ++ dputs(ERRMSG("quietgethist(ch->hist) returned NULL")); ++ return 1; ++ } ++ zle_setline(he); + zlecs = ch->new_cs; + return 0; + } +@@ -1647,7 +1652,12 @@ static int + applychange(struct change *ch) + { + if(ch->hist != histline) { +- zle_setline(quietgethist(ch->hist)); ++ Histent he = quietgethist(ch->hist); ++ if(!he) { ++ dputs(ERRMSG("quietgethist(ch->hist) returned NULL")); ++ return 1; ++ } ++ zle_setline(he); + zlecs = ch->old_cs; + return 0; + } +-- +2.20.1 + + +From 10dedc96ce0de43372add239f8256e259ca1e04a Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Fri, 26 Jul 2019 17:24:59 +0200 +Subject: [PATCH 2/2] 44582: Fix foregoing commit to use DPUTS() better + +Upstream-commit: d6a9e222ec6b006c09d6f84beae6ef488a19b214 +Signed-off-by: Kamil Dudka +--- + Src/Zle/zle_utils.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c +index 633f593..29dba08 100644 +--- a/Src/Zle/zle_utils.c ++++ b/Src/Zle/zle_utils.c +@@ -1608,10 +1608,9 @@ unapplychange(struct change *ch) + { + if(ch->hist != histline) { + Histent he = quietgethist(ch->hist); +- if(!he) { +- dputs(ERRMSG("quietgethist(ch->hist) returned NULL")); ++ DPUTS(he == NULL, "quietgethist(ch->hist) returned NULL"); ++ if(he == NULL) + return 1; +- } + zle_setline(he); + zlecs = ch->new_cs; + return 0; +@@ -1653,10 +1652,9 @@ applychange(struct change *ch) + { + if(ch->hist != histline) { + Histent he = quietgethist(ch->hist); +- if(!he) { +- dputs(ERRMSG("quietgethist(ch->hist) returned NULL")); ++ DPUTS(he == NULL, "quietgethist(ch->hist) returned NULL"); ++ if(he == NULL) + return 1; +- } + zle_setline(he); + zlecs = ch->old_cs; + return 0; +-- +2.20.1 + diff --git a/zsh.spec b/zsh.spec index 8aa1eb5..0d77f70 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.7.1 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -12,6 +12,9 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc +# make failed searches of history in Zle robust (#1722703) +Patch1: 0001-zsh-5.7.1-zle-history-avoid-crash.patch + BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -154,6 +157,9 @@ fi %doc Doc/*.html %changelog +* Fri Jul 26 2019 Kamil Dudka - 5.7.1-4 +- make failed searches of history in Zle robust (#1722703) + * Tue Mar 12 2019 Kamil Dudka - 5.7.1-3 - avoid build failure in case we have working ypcat (#1687574) From 3eea62750be80c9934d9680acc10748b12cff4c7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 31 Jan 2020 05:23:40 +0000 Subject: [PATCH 32/74] - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 0d77f70..e52f259 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.7.1 -Release: 4%{?dist} +Release: 5%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -157,6 +157,9 @@ fi %doc Doc/*.html %changelog +* Fri Jan 31 2020 Fedora Release Engineering - 5.7.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + * Fri Jul 26 2019 Kamil Dudka - 5.7.1-4 - make failed searches of history in Zle robust (#1722703) From 8dbf2fe7bfed3bc8bbf44982e76d5f0680e7bc46 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 24 Feb 2020 13:31:18 +0100 Subject: [PATCH 33/74] update to latest upstream release: 5.8.0 --- 0001-zsh-5.7.1-zle-history-avoid-crash.patch | 92 -------------------- sources | 2 +- zsh-5.7.1.tar.xz.asc | 11 --- zsh-5.8.tar.xz.asc | 11 +++ zsh.spec | 10 +-- 5 files changed, 17 insertions(+), 109 deletions(-) delete mode 100644 0001-zsh-5.7.1-zle-history-avoid-crash.patch delete mode 100644 zsh-5.7.1.tar.xz.asc create mode 100644 zsh-5.8.tar.xz.asc diff --git a/0001-zsh-5.7.1-zle-history-avoid-crash.patch b/0001-zsh-5.7.1-zle-history-avoid-crash.patch deleted file mode 100644 index 23932c3..0000000 --- a/0001-zsh-5.7.1-zle-history-avoid-crash.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 15c190164c375cfe1772ebec92b544ca26a60e28 Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Tue, 23 Jul 2019 14:45:48 +0200 -Subject: [PATCH 1/2] 44566: make sure Zle doesn't crash if history entry not - found - -Upstream-commit: f9cd2187875b6f2ebdb9b9a787fac20b2aaf745b -Signed-off-by: Kamil Dudka ---- - Src/Zle/zle_utils.c | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c -index c6df3d8..633f593 100644 ---- a/Src/Zle/zle_utils.c -+++ b/Src/Zle/zle_utils.c -@@ -1607,7 +1607,12 @@ static int - unapplychange(struct change *ch) - { - if(ch->hist != histline) { -- zle_setline(quietgethist(ch->hist)); -+ Histent he = quietgethist(ch->hist); -+ if(!he) { -+ dputs(ERRMSG("quietgethist(ch->hist) returned NULL")); -+ return 1; -+ } -+ zle_setline(he); - zlecs = ch->new_cs; - return 0; - } -@@ -1647,7 +1652,12 @@ static int - applychange(struct change *ch) - { - if(ch->hist != histline) { -- zle_setline(quietgethist(ch->hist)); -+ Histent he = quietgethist(ch->hist); -+ if(!he) { -+ dputs(ERRMSG("quietgethist(ch->hist) returned NULL")); -+ return 1; -+ } -+ zle_setline(he); - zlecs = ch->old_cs; - return 0; - } --- -2.20.1 - - -From 10dedc96ce0de43372add239f8256e259ca1e04a Mon Sep 17 00:00:00 2001 -From: Kamil Dudka -Date: Fri, 26 Jul 2019 17:24:59 +0200 -Subject: [PATCH 2/2] 44582: Fix foregoing commit to use DPUTS() better - -Upstream-commit: d6a9e222ec6b006c09d6f84beae6ef488a19b214 -Signed-off-by: Kamil Dudka ---- - Src/Zle/zle_utils.c | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c -index 633f593..29dba08 100644 ---- a/Src/Zle/zle_utils.c -+++ b/Src/Zle/zle_utils.c -@@ -1608,10 +1608,9 @@ unapplychange(struct change *ch) - { - if(ch->hist != histline) { - Histent he = quietgethist(ch->hist); -- if(!he) { -- dputs(ERRMSG("quietgethist(ch->hist) returned NULL")); -+ DPUTS(he == NULL, "quietgethist(ch->hist) returned NULL"); -+ if(he == NULL) - return 1; -- } - zle_setline(he); - zlecs = ch->new_cs; - return 0; -@@ -1653,10 +1652,9 @@ applychange(struct change *ch) - { - if(ch->hist != histline) { - Histent he = quietgethist(ch->hist); -- if(!he) { -- dputs(ERRMSG("quietgethist(ch->hist) returned NULL")); -+ DPUTS(he == NULL, "quietgethist(ch->hist) returned NULL"); -+ if(he == NULL) - return 1; -- } - zle_setline(he); - zlecs = ch->old_cs; - return 0; --- -2.20.1 - diff --git a/sources b/sources index 14a66e3..0ede01c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.7.1.tar.xz) = a6aa88e1955a80229a4784a128866e325f79a8b5f73c922ab480048411036f1835cbb31daa30ab38bd16ab2a50040eda8f4f1f64704b21b6acc3051b1dbf18d0 +SHA512 (zsh-5.8.tar.xz) = 96198ecef498b7d7945fecebbe6bf14065fa8c5d81a7662164579eba8206b79575812d292adea1864bc7487ac0818ba900e25f9ab3802449340de80417c2c533 diff --git a/zsh-5.7.1.tar.xz.asc b/zsh-5.7.1.tar.xz.asc deleted file mode 100644 index bfb4510..0000000 --- a/zsh-5.7.1.tar.xz.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQEzBAABCAAdFiEEfKfsqvBiFrkPiUFGrPgUbK6Mu8QFAlxXSocACgkQrPgUbK6M -u8SXPgf/Vw+pYfQXAlGy59MsmArJvU+72zP/Q8Cu9gSuLbNZetwR8Zkubibi1rpO -zCFn0Ps9lR565k9ue+wPUtBhZjEPJVjNALdJK5YaKvh6Dir3/nhoVoS4kobJCHad -k8X6ThID8zOwZ3E49n+2AiNxwKkSej6cUKzZ2CSGaZ077GgnY4M8y6ACSdwEp7w8 -f5W9gUMqxawx0PCfsxkoJNdNrWq0V2WAgVql3qqVqSvLzAijFXUqtDEauwHecDkw -5NqWZVHLqJHWHyYImjo/RQnVcGHLCYLSOiHH9duo1VnLsXUNPC9+8yjTRkEte8UA -38bf8N8gmpaI/sG1Z2v12VXqCV3eqA== -=g3Uh ------END PGP SIGNATURE----- diff --git a/zsh-5.8.tar.xz.asc b/zsh-5.8.tar.xz.asc new file mode 100644 index 0000000..8eb13ec --- /dev/null +++ b/zsh-5.8.tar.xz.asc @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- + +iQEzBAABCAAdFiEEfKfsqvBiFrkPiUFGrPgUbK6Mu8QFAl5HHTEACgkQrPgUbK6M +u8Ttmwf/U1HoG30yYZ4m3yxFZ8QGI0WwnV7/IAQ4rMBWo+31yijLrwnl8+WILVfi +gRzskwTrVmLjklT4hnv3aSyO1KtQMDImCYw01JbK801JCnCRRRTKVTC69S1TQ9FI +mp+GB+QemYAdDRZwIlZcuVmhL7MJS0IWZiwqzlvqyKGG4MCrzqPqKO3s/JgMisUG +KLHZJWoUWidYfmuwkPRKXN+dcnZUF4B/jJbNwLRGhvySzpT6pAwI2SBWak+vUbs/ +UKal6pOHYv1zalMrh5as2/hAo4Rjpsgn0zRGiFsn5Ys9srB6XKhXifUP6d1g3cRj +lH9B3QGrd1oh7u8IOjU29F8+DeeU+g== +=+BhZ +-----END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index e52f259..6897f66 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.7.1 -Release: 5%{?dist} +Version: 5.8 +Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -12,9 +12,6 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc -# make failed searches of history in Zle robust (#1722703) -Patch1: 0001-zsh-5.7.1-zle-history-avoid-crash.patch - BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -157,6 +154,9 @@ fi %doc Doc/*.html %changelog +* Mon Feb 24 2020 Kamil Dudka - 5.8-1 +- update to latest upstream release + * Fri Jan 31 2020 Fedora Release Engineering - 5.7.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild From f8371def5f920cf095fe49026c2b93c5c24f42e4 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 14 Jul 2020 15:12:58 +0000 Subject: [PATCH 34/74] Use make macros https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro --- zsh.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zsh.spec b/zsh.spec index 6897f66..f9256db 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.8 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -86,7 +86,7 @@ export zsh_cv_sys_nis='no' make -C Src headers make -C Src -f Makemod zsh{path,xmod}s.h version.h -make %{?_smp_mflags} all html +%make_build all html %check # Run the testsuite @@ -154,6 +154,10 @@ fi %doc Doc/*.html %changelog +* Tue Jul 14 2020 Tom Stellard - 5.8-2 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + * Mon Feb 24 2020 Kamil Dudka - 5.8-1 - update to latest upstream release From a734556f332d344616d8d48c25ea56ae6e197376 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 29 Jul 2020 15:27:18 +0000 Subject: [PATCH 35/74] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index f9256db..1c04649 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.8 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -154,6 +154,9 @@ fi %doc Doc/*.html %changelog +* Wed Jul 29 2020 Fedora Release Engineering - 5.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Tue Jul 14 2020 Tom Stellard - 5.8-2 - Use make macros - https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro From 2510705678572b7cf9e631bf04da4dd554e0d06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0pl=C3=ADchal?= Date: Mon, 26 Oct 2020 13:27:32 +0100 Subject: [PATCH 36/74] Enable relevant tests from the shared shell repo This pull request enables tests in the Fedora CI using `tmt` which also allows to easily execute and debug tests from your laptop: Run tests directly on your localhost: sudo dnf install -y tmt tmt run --all provision --how local Run tests in a virtual machine: sudo dnf install -y tmt-provision-virtual tmt run Check the documentation to learn more about the tool: https://docs.fedoraproject.org/en-US/ci/tmt/ --- .fmf/version | 1 + plans/shell.fmf | 14 ++++++++++++++ tests/tests.yml | 17 ----------------- 3 files changed, 15 insertions(+), 17 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/shell.fmf delete mode 100644 tests/tests.yml diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/shell.fmf b/plans/shell.fmf new file mode 100644 index 0000000..bcc3572 --- /dev/null +++ b/plans/shell.fmf @@ -0,0 +1,14 @@ +summary: + Run relevant tests from the shell tests repository +discover: + how: fmf + url: https://src.fedoraproject.org/tests/shell + filter: component:zsh +prepare: + how: install + package: zsh +execute: + how: tmt +environment: + PACKAGES: zsh + SH_BIN: zsh diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 3d505a4..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- - -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - repositories: - - repo: "https://src.fedoraproject.org/tests/shell.git" - dest: "shell" - fmf_filter: "tier: 1, 2" - environment: - PACKAGES: zsh - SH_BIN: zsh - required_packages: - - expect # login requires expect - - which # smoke requires which From b6b9c6607bc32d4dac0d4d1a398e3b6a8d5fd0a2 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 9 Jan 2021 01:56:03 +0000 Subject: [PATCH 37/74] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- zsh.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/zsh.spec b/zsh.spec index 1c04649..3463ca2 100644 --- a/zsh.spec +++ b/zsh.spec @@ -12,6 +12,7 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc +BuildRequires: make BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk From 157285ba33652d8950418eb70c4acb21aa1f946b Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Sat, 9 Jan 2021 14:04:49 +0100 Subject: [PATCH 38/74] zsh.spec: keep BR list alphabetically sorted --- zsh.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 3463ca2..348ea3f 100644 --- a/zsh.spec +++ b/zsh.spec @@ -12,7 +12,6 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc -BuildRequires: make BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -20,6 +19,7 @@ BuildRequires: gcc BuildRequires: gdbm-devel BuildRequires: glibc-langpack-ja BuildRequires: libcap-devel +BuildRequires: make BuildRequires: ncurses-devel BuildRequires: pcre-devel BuildRequires: sed From 8d4d20225079cb93ca7686bec86e8cbb0793c8c1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 28 Jan 2021 00:45:53 +0000 Subject: [PATCH 39/74] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 348ea3f..3dc6f89 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.8 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -155,6 +155,9 @@ fi %doc Doc/*.html %changelog +* Thu Jan 28 2021 Fedora Release Engineering - 5.8-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Wed Jul 29 2020 Fedora Release Engineering - 5.8-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild From 9f49b18e48f82ad39c4b0dd82c32ea9963d0ab6a Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Thu, 25 Mar 2021 16:51:00 +0100 Subject: [PATCH 40/74] complete file arguments after rpmbuild -r/-b/-t --- 0001-zsh-5.8-comp-rpm.patch | 27 +++++++++++++++++++++++++++ zsh.spec | 8 +++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0001-zsh-5.8-comp-rpm.patch diff --git a/0001-zsh-5.8-comp-rpm.patch b/0001-zsh-5.8-comp-rpm.patch new file mode 100644 index 0000000..3a91f0b --- /dev/null +++ b/0001-zsh-5.8-comp-rpm.patch @@ -0,0 +1,27 @@ +From d8ec07a4779f4675139c650979eb87dd6d7a5d92 Mon Sep 17 00:00:00 2001 +From: Daniel Shahaf +Date: Tue, 18 Aug 2020 13:30:04 +0000 +Subject: [PATCH] 47323: _rpmbuild: Complete file arguments after -r/-b/-t. + +Upstream-commit: e14e899ab96c4171544a244ddc39991512ec41c8 +Signed-off-by: Kamil Dudka +--- + Completion/Redhat/Command/_rpm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm +index e346924..db7c114 100644 +--- a/Completion/Redhat/Command/_rpm ++++ b/Completion/Redhat/Command/_rpm +@@ -282,7 +282,7 @@ _rpm () { + build_r) tmp=( '*:source package:_files -g "*.(#i)src.rpm(-.)"' ) ;| + build_t) tmp=( '*:tar file:_files -g "*.(#i)tar(.*|)(-.)"' ) ;| + build_?) +- _arguments -s -C $buildopts $commonopts $pathopts \ ++ _arguments -s -C $buildopts $commonopts $pathopts "${tmp[@]}" \ + ;; + checksig) + _arguments -s -C \!-K \ +-- +2.26.3 + diff --git a/zsh.spec b/zsh.spec index 3dc6f89..4be225d 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.8 -Release: 4%{?dist} +Release: 5%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -12,6 +12,9 @@ Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc +# complete file arguments after rpmbuild -r/-b/-t +Patch1: 0001-zsh-5.8-comp-rpm.patch + BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -155,6 +158,9 @@ fi %doc Doc/*.html %changelog +* Thu Mar 25 2021 Kamil Dudka - 5.8-5 +- complete file arguments after rpmbuild -r/-b/-t + * Thu Jan 28 2021 Fedora Release Engineering - 5.8-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 210b8657cd8c145bc90b45503cf9e8560bc6fa21 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 23 Jul 2021 22:22:40 +0000 Subject: [PATCH 41/74] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 4be225d..ba8dd75 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.8 -Release: 5%{?dist} +Release: 6%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -158,6 +158,9 @@ fi %doc Doc/*.html %changelog +* Fri Jul 23 2021 Fedora Release Engineering - 5.8-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Thu Mar 25 2021 Kamil Dudka - 5.8-5 - complete file arguments after rpmbuild -r/-b/-t From 20551698318de1610f5763425b63713204281ebd Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 25 Nov 2021 19:09:23 +0100 Subject: [PATCH 42/74] Overwrite PROMPT only if it's set to the built-in default https://bugzilla.redhat.com/show_bug.cgi?id=2026749 --- zsh.spec | 5 ++++- zshrc.rhs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/zsh.spec b/zsh.spec index ba8dd75..c03537f 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.8 -Release: 6%{?dist} +Release: 7%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -158,6 +158,9 @@ fi %doc Doc/*.html %changelog +* Thu Nov 25 2021 Debarshi Ray - 5.8-7 +- Overwrite PROMPT only if it's set to the built-in default (#2026749) + * Fri Jul 23 2021 Fedora Release Engineering - 5.8-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/zshrc.rhs b/zshrc.rhs index 5b3b92a..82dc213 100644 --- a/zshrc.rhs +++ b/zshrc.rhs @@ -8,7 +8,7 @@ #setenv() { export $1=$2 } # csh compatibility # Set prompts -PROMPT='[%n@%m]%~%# ' # default prompt +[[ "$PROMPT" = "%m%# " ]] && PROMPT='[%n@%m]%~%# ' # default prompt #RPROMPT=' %~' # prompt for right side of screen # bindkey -v # vi key bindings From 717b27b08b1e4d40d203120bc14cf27572b922da Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 4 Jan 2022 08:45:46 +0100 Subject: [PATCH 43/74] avoid unnecessary failure of the test-suite ... in case ${RPS1} is set --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index c03537f..61f7942 100644 --- a/zsh.spec +++ b/zsh.spec @@ -93,7 +93,10 @@ make -C Src -f Makemod zsh{path,xmod}s.h version.h %make_build all html %check -# Run the testsuite +# avoid unnecessary failure of the test-suite in case ${RPS1} is set +unset RPS1 + +# run the test-suite make check %install From 5ac50934d36b1b4e11aa2c1fa183f4e975c79760 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 4 Jan 2022 08:31:45 +0100 Subject: [PATCH 44/74] Resolves: #1900809 - prepend ~/.local/bin and ~/bin to $PATH ... for newly created users --- dotzprofile | 12 ++++++++++++ zprofile.rhs | 3 --- zsh.spec | 7 ++++++- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 dotzprofile diff --git a/dotzprofile b/dotzprofile new file mode 100644 index 0000000..9203f7e --- /dev/null +++ b/dotzprofile @@ -0,0 +1,12 @@ +# this file is installed as ~/.zprofile for newly created users + +# prepend ~/.local/bin and ~/bin to $PATH unless it is already there +if ! [[ "$PATH" =~ "$HOME/bin" ]] +then + PATH="$HOME/bin:$PATH" +fi +if ! [[ "$PATH" =~ "$HOME/.local/bin:" ]] +then + PATH="$HOME/.local/bin:$PATH" +fi +export PATH diff --git a/zprofile.rhs b/zprofile.rhs index 03d316f..5e21475 100644 --- a/zprofile.rhs +++ b/zprofile.rhs @@ -2,9 +2,6 @@ # /etc/zprofile and ~/.zprofile are run for login shells # -PATH="$PATH:$HOME/bin" -export PATH - _src_etc_profile() { # Make /etc/profile happier, and have possible ~/.zshenv options like diff --git a/zsh.spec b/zsh.spec index 61f7942..f2abe5b 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.8 -Release: 7%{?dist} +Release: 8%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -11,6 +11,7 @@ Source3: zprofile.rhs Source4: zshrc.rhs Source5: zshenv.rhs Source6: dotzshrc +Source7: dotzprofile # complete file arguments after rpmbuild -r/-b/-t Patch1: 0001-zsh-5.8-comp-rpm.patch @@ -117,6 +118,7 @@ done mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/skel install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zshrc +install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zprofile # This is just here to shut up rpmlint, and is very annoying. # Note that we can't chmod everything as then rpmlint will complain about @@ -161,6 +163,9 @@ fi %doc Doc/*.html %changelog +* Tue Jan 04 2022 Kamil Dudka - 5.8-8 +- prepend ~/.local/bin and ~/bin to $PATH for newly created users (#1900809) + * Thu Nov 25 2021 Debarshi Ray - 5.8-7 - Overwrite PROMPT only if it's set to the built-in default (#2026749) From e583fe831509d0b7541fa8228ad3c66e85ff2a0a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jan 2022 05:56:26 +0000 Subject: [PATCH 45/74] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index f2abe5b..8b37277 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.8 -Release: 8%{?dist} +Release: 9%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -163,6 +163,9 @@ fi %doc Doc/*.html %changelog +* Sat Jan 22 2022 Fedora Release Engineering - 5.8-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Tue Jan 04 2022 Kamil Dudka - 5.8-8 - prepend ~/.local/bin and ~/bin to $PATH for newly created users (#1900809) From 528a6dccc976a2747bf8eebfc613cbfb7ca94515 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Sun, 13 Feb 2022 12:58:53 +0100 Subject: [PATCH 46/74] Resolves: CVE-2021-45444 - update to latest upstream release: 5.8.1 --- sources | 2 +- zsh-5.8.1.tar.xz.asc | 11 +++++++++++ zsh-5.8.tar.xz.asc | 11 ----------- zsh.spec | 7 +++++-- 4 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 zsh-5.8.1.tar.xz.asc delete mode 100644 zsh-5.8.tar.xz.asc diff --git a/sources b/sources index 0ede01c..3a2f734 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (zsh-5.8.tar.xz) = 96198ecef498b7d7945fecebbe6bf14065fa8c5d81a7662164579eba8206b79575812d292adea1864bc7487ac0818ba900e25f9ab3802449340de80417c2c533 +SHA512 (zsh-5.8.1.tar.xz) = f54a5a47ed15d134902613f6169c985680afc45a67538505e11b66b348fcb367145e9b8ae2d9eac185e07ef5f97254b85df01ba97294002a8c036fd02ed5e76d diff --git a/zsh-5.8.1.tar.xz.asc b/zsh-5.8.1.tar.xz.asc new file mode 100644 index 0000000..ef4fd0c --- /dev/null +++ b/zsh-5.8.1.tar.xz.asc @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- + +iQEzBAABCAAdFiEEfKfsqvBiFrkPiUFGrPgUbK6Mu8QFAmIHy2YACgkQrPgUbK6M +u8RlaAgAxhHK9+kn+yzsS2/eED+VjLjCNcyPqdVdBl+bS4xeN5v2Ga0D36TfYJ4J +3n6INHTeR8gpocFyY5RRxZcDeGPtsPV4JQlmAJMa43piLP1LZvbgKAVeooWWeIKk +JMzXXAKWhZQ2+IG+OXlLNaHSLy6YBJ//Kj3lUkI7NHLSjOhce9ER1QwrHyeHmsKV +RmjeKlu4gwCPtXGgRmRihnIYJNI38db9Hc2vjunasGaM30l+8ymeVBjH395EDXL7 +bfn8Vb0rN6TQY5q+4kVkG9J6m7kfgozcbCuiygsDG7zPdbI6Iwgzx+WmMoKWFfX6 +y5MZIeVwkWUscDcghU8uUhQ2mu3pmw== +=2cR1 +-----END PGP SIGNATURE----- diff --git a/zsh-5.8.tar.xz.asc b/zsh-5.8.tar.xz.asc deleted file mode 100644 index 8eb13ec..0000000 --- a/zsh-5.8.tar.xz.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQEzBAABCAAdFiEEfKfsqvBiFrkPiUFGrPgUbK6Mu8QFAl5HHTEACgkQrPgUbK6M -u8Ttmwf/U1HoG30yYZ4m3yxFZ8QGI0WwnV7/IAQ4rMBWo+31yijLrwnl8+WILVfi -gRzskwTrVmLjklT4hnv3aSyO1KtQMDImCYw01JbK801JCnCRRRTKVTC69S1TQ9FI -mp+GB+QemYAdDRZwIlZcuVmhL7MJS0IWZiwqzlvqyKGG4MCrzqPqKO3s/JgMisUG -KLHZJWoUWidYfmuwkPRKXN+dcnZUF4B/jJbNwLRGhvySzpT6pAwI2SBWak+vUbs/ -UKal6pOHYv1zalMrh5as2/hAo4Rjpsgn0zRGiFsn5Ys9srB6XKhXifUP6d1g3cRj -lH9B3QGrd1oh7u8IOjU29F8+DeeU+g== -=+BhZ ------END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index 8b37277..c25318e 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.8 -Release: 9%{?dist} +Version: 5.8.1 +Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -163,6 +163,9 @@ fi %doc Doc/*.html %changelog +* Sun Feb 13 2022 Kamil Dudka - 5.8.1-1 +- update to latest upstream release + * Sat Jan 22 2022 Fedora Release Engineering - 5.8-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 9fde3e3713f1a5cd994b13accc4b6cfa6922d388 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Sun, 13 Feb 2022 13:06:43 +0100 Subject: [PATCH 47/74] mention CVE-2021-45444 in the last change log entry --- zsh.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index c25318e..2eccf07 100644 --- a/zsh.spec +++ b/zsh.spec @@ -164,7 +164,7 @@ fi %changelog * Sun Feb 13 2022 Kamil Dudka - 5.8.1-1 -- update to latest upstream release +- update to latest upstream release (fixes CVE-2021-45444) * Sat Jan 22 2022 Fedora Release Engineering - 5.8-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 18fc23fb63d70c2e3be79f4358dc84b70803842c Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Sun, 15 May 2022 09:15:57 +0200 Subject: [PATCH 48/74] update to latest upstream release: 5.9 --- .gitignore | 5 +---- 0001-zsh-5.8-comp-rpm.patch | 27 --------------------------- sources | 3 ++- zsh-5.8.1.tar.xz.asc | 11 ----------- zsh.spec | 10 +++++----- 5 files changed, 8 insertions(+), 48 deletions(-) delete mode 100644 0001-zsh-5.8-comp-rpm.patch delete mode 100644 zsh-5.8.1.tar.xz.asc diff --git a/.gitignore b/.gitignore index 0a91fd3..55ad85c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -/zsh-5.*.*.tar.bz2 /zsh-5.*.tar.xz -/zsh-5.4.2.tar.gz -/*.src.rpm -results_*/ +/zsh-5.*.tar.xz.asc diff --git a/0001-zsh-5.8-comp-rpm.patch b/0001-zsh-5.8-comp-rpm.patch deleted file mode 100644 index 3a91f0b..0000000 --- a/0001-zsh-5.8-comp-rpm.patch +++ /dev/null @@ -1,27 +0,0 @@ -From d8ec07a4779f4675139c650979eb87dd6d7a5d92 Mon Sep 17 00:00:00 2001 -From: Daniel Shahaf -Date: Tue, 18 Aug 2020 13:30:04 +0000 -Subject: [PATCH] 47323: _rpmbuild: Complete file arguments after -r/-b/-t. - -Upstream-commit: e14e899ab96c4171544a244ddc39991512ec41c8 -Signed-off-by: Kamil Dudka ---- - Completion/Redhat/Command/_rpm | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm -index e346924..db7c114 100644 ---- a/Completion/Redhat/Command/_rpm -+++ b/Completion/Redhat/Command/_rpm -@@ -282,7 +282,7 @@ _rpm () { - build_r) tmp=( '*:source package:_files -g "*.(#i)src.rpm(-.)"' ) ;| - build_t) tmp=( '*:tar file:_files -g "*.(#i)tar(.*|)(-.)"' ) ;| - build_?) -- _arguments -s -C $buildopts $commonopts $pathopts \ -+ _arguments -s -C $buildopts $commonopts $pathopts "${tmp[@]}" \ - ;; - checksig) - _arguments -s -C \!-K \ --- -2.26.3 - diff --git a/sources b/sources index 3a2f734..747480c 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (zsh-5.8.1.tar.xz) = f54a5a47ed15d134902613f6169c985680afc45a67538505e11b66b348fcb367145e9b8ae2d9eac185e07ef5f97254b85df01ba97294002a8c036fd02ed5e76d +SHA512 (zsh-5.9.tar.xz) = d9138b7f379ad942a5f46819d2dd52d31f3a1129f2a0d1b53d4c5cd43c318b60396da6d37c57c477b8e958fb750209aca0ae93f8c9dd42ac958de006a0ff067e +SHA512 (zsh-5.9.tar.xz.asc) = b6a72f8dfd2ed9c25e4afa5b3d13b23c1bf0bceacfce3ad0fadf24a9df91382914f7322ef4ed8bfb4b68818fb18fe3973d22154a6cc638b46f02e30bafd93fcb diff --git a/zsh-5.8.1.tar.xz.asc b/zsh-5.8.1.tar.xz.asc deleted file mode 100644 index ef4fd0c..0000000 --- a/zsh-5.8.1.tar.xz.asc +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQEzBAABCAAdFiEEfKfsqvBiFrkPiUFGrPgUbK6Mu8QFAmIHy2YACgkQrPgUbK6M -u8RlaAgAxhHK9+kn+yzsS2/eED+VjLjCNcyPqdVdBl+bS4xeN5v2Ga0D36TfYJ4J -3n6INHTeR8gpocFyY5RRxZcDeGPtsPV4JQlmAJMa43piLP1LZvbgKAVeooWWeIKk -JMzXXAKWhZQ2+IG+OXlLNaHSLy6YBJ//Kj3lUkI7NHLSjOhce9ER1QwrHyeHmsKV -RmjeKlu4gwCPtXGgRmRihnIYJNI38db9Hc2vjunasGaM30l+8ymeVBjH395EDXL7 -bfn8Vb0rN6TQY5q+4kVkG9J6m7kfgozcbCuiygsDG7zPdbI6Iwgzx+WmMoKWFfX6 -y5MZIeVwkWUscDcghU8uUhQ2mu3pmw== -=2cR1 ------END PGP SIGNATURE----- diff --git a/zsh.spec b/zsh.spec index 2eccf07..d0594d8 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,6 +1,6 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.8.1 +Version: 5.9 Release: 1%{?dist} License: MIT URL: http://zsh.sourceforge.net/ @@ -13,9 +13,6 @@ Source5: zshenv.rhs Source6: dotzshrc Source7: dotzprofile -# complete file arguments after rpmbuild -r/-b/-t -Patch1: 0001-zsh-5.8-comp-rpm.patch - BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -123,7 +120,7 @@ install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zprofile # This is just here to shut up rpmlint, and is very annoying. # Note that we can't chmod everything as then rpmlint will complain about # those without a she-bang line. -for i in checkmail harden run-help zcalc zkbd; do +for i in checkmail harden run-help test-repo-git-rebase-{apply,merge} zcalc zkbd; do sed -i -e 's!/usr/local/bin/zsh!%{_bindir}/zsh!' \ $RPM_BUILD_ROOT%{_datadir}/zsh/%{version}/functions/$i chmod +x $RPM_BUILD_ROOT%{_datadir}/zsh/%{version}/functions/$i @@ -163,6 +160,9 @@ fi %doc Doc/*.html %changelog +* Sun May 15 2022 Kamil Dudka - 5.9-1 +- update to latest upstream release + * Sun Feb 13 2022 Kamil Dudka - 5.8.1-1 - update to latest upstream release (fixes CVE-2021-45444) From 8e68c402488650536cff12fa6d22eee347a32032 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 23 Jul 2022 14:00:26 +0000 Subject: [PATCH 49/74] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index d0594d8..c677f46 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -160,6 +160,9 @@ fi %doc Doc/*.html %changelog +* Sat Jul 23 2022 Fedora Release Engineering - 5.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Sun May 15 2022 Kamil Dudka - 5.9-1 - update to latest upstream release From 4b91eb160f82a0a1eb3f4955e4ce7ef0e79eeb82 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 9 Jan 2023 10:35:10 +0100 Subject: [PATCH 50/74] do not use egrep in tests to make them pass again --- 0001-zsh-5.9-do-not-use-egrep-in-tests.patch | 178 +++++++++++++++++++ zsh.spec | 8 +- 2 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 0001-zsh-5.9-do-not-use-egrep-in-tests.patch diff --git a/0001-zsh-5.9-do-not-use-egrep-in-tests.patch b/0001-zsh-5.9-do-not-use-egrep-in-tests.patch new file mode 100644 index 0000000..4d5a1cf --- /dev/null +++ b/0001-zsh-5.9-do-not-use-egrep-in-tests.patch @@ -0,0 +1,178 @@ +From 6935aa4b515fe9b782507820c77ab681136470bc Mon Sep 17 00:00:00 2001 +From: Jun-ichi Takimoto +Date: Thu, 15 Sep 2022 18:56:20 +0900 +Subject: [PATCH] 50629: do not use egrep in tests + +Upstream-commit: 4fc5dc0292acd77f17281f451774ba2ca4203026 +Signed-off-by: Kamil Dudka +--- + Test/D07multibyte.ztst | 16 ++-------------- + Test/E01options.ztst | 2 +- + Test/V07pcre.ztst | 16 ++-------------- + Test/X02zlevi.ztst | 11 +---------- + Test/X03zlebindkey.ztst | 11 +---------- + Test/Y01completion.ztst | 11 +---------- + Test/ztst.zsh | 15 +++++++++++++++ + 7 files changed, 23 insertions(+), 59 deletions(-) + +diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst +index e2e9a25..6909346 100644 +--- a/Test/D07multibyte.ztst ++++ b/Test/D07multibyte.ztst +@@ -1,19 +1,7 @@ + %prep + +-# Find a UTF-8 locale. +- setopt multibyte +-# Don't let LC_* override our choice of locale. +- unset -m LC_\* +- mb_ok= +- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) +- for LANG in $langs; do +- if [[ é = ? ]]; then +- mb_ok=1 +- break; +- fi +- done +- if [[ -z $mb_ok ]]; then ++ LANG=$(ZTST_find_UTF8) ++ if [[ -z $LANG ]]; then + ZTST_unimplemented="no UTF-8 locale or multibyte mode is not implemented" + else + print -u $ZTST_fd Testing multibyte with locale $LANG +diff --git a/Test/E01options.ztst b/Test/E01options.ztst +index 2acbfd3..d38fbed 100644 +--- a/Test/E01options.ztst ++++ b/Test/E01options.ztst +@@ -651,7 +651,7 @@ + >noktarg1 + >0 1 + +- showopt() { setopt | egrep 'localoptions|ksharrays'; } ++ showopt() { echo ${(FM)${(@f)"$(setopt)"}:#(localoptions|ksharrays)*} } + f1() { setopt localoptions ksharrays; showopt } + f2() { setopt ksharrays; showopt } + setopt kshoptionprint +diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst +index c9c844d..ca13419 100644 +--- a/Test/V07pcre.ztst ++++ b/Test/V07pcre.ztst +@@ -6,20 +6,8 @@ + return 0 + fi + setopt rematch_pcre +-# Find a UTF-8 locale. +- setopt multibyte +-# Don't let LC_* override our choice of locale. +- unset -m LC_\* +- mb_ok= +- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) +- for LANG in $langs; do +- if [[ é = ? ]]; then +- mb_ok=1 +- break; +- fi +- done +- if [[ -z $mb_ok ]]; then ++ LANG=$(ZTST_find_UTF8) ++ if [[ -z $LANG ]]; then + ZTST_unimplemented="no UTF-8 locale or multibyte mode is not implemented" + else + print -u $ZTST_fd Testing PCRE multibyte with locale $LANG +diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst +index 8146d67..203c13c 100644 +--- a/Test/X02zlevi.ztst ++++ b/Test/X02zlevi.ztst +@@ -1,16 +1,7 @@ + # Tests of the vi mode of ZLE + + %prep +- unset -m LC_\* +- ZSH_TEST_LANG= +- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) +- for LANG in $langs; do +- if [[ é = ? ]]; then +- ZSH_TEST_LANG=$LANG +- break; +- fi +- done ++ ZSH_TEST_LANG=$(ZTST_find_UTF8) + if ( zmodload zsh/zpty 2>/dev/null ); then + . $ZTST_srcdir/comptest + comptestinit -v -z $ZTST_testdir/../Src/zsh +diff --git a/Test/X03zlebindkey.ztst b/Test/X03zlebindkey.ztst +index 43692a8..5277332 100644 +--- a/Test/X03zlebindkey.ztst ++++ b/Test/X03zlebindkey.ztst +@@ -3,16 +3,7 @@ + # into bindings. The latter is particularly tricky with multibyte sequences. + + %prep +- unset -m LC_\* +- ZSH_TEST_LANG= +- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) +- for LANG in $langs; do +- if [[ é = ? ]]; then +- ZSH_TEST_LANG=$LANG +- break; +- fi +- done ++ ZSH_TEST_LANG=$(ZTST_find_UTF8) + if ( zmodload zsh/zpty 2>/dev/null ); then + . $ZTST_srcdir/comptest + comptestinit -z $ZTST_testdir/../Src/zsh +diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst +index 6af0efc..f976f9f 100644 +--- a/Test/Y01completion.ztst ++++ b/Test/Y01completion.ztst +@@ -1,16 +1,7 @@ + # Tests for completion system. + + %prep +- unset -m LC_\* +- ZSH_TEST_LANG= +- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 +- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) +- for LANG in $langs; do +- if [[ é = ? ]]; then +- ZSH_TEST_LANG=$LANG +- break; +- fi +- done ++ ZSH_TEST_LANG=$(ZTST_find_UTF8) + if ( zmodload zsh/zpty 2>/dev/null ); then + . $ZTST_srcdir/comptest + mkdir comp.tmp +diff --git a/Test/ztst.zsh b/Test/ztst.zsh +index aca275c..d95b726 100755 +--- a/Test/ztst.zsh ++++ b/Test/ztst.zsh +@@ -37,6 +37,21 @@ emulate -R zsh + # LANG must be passed to child zsh. + export LANG + ++# find UTF-8 locale ++ZTST_find_UTF8 () { ++ setopt multibyte ++ # Don't let LC_* override our choice of locale. ++ unset -m LC_\* ++ local langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 ++ ${(M)$(locale -a 2>/dev/null):#*.(utf8|UTF-8)}) ++ for LANG in $langs; do ++ if [[ é = ? ]]; then ++ echo $LANG ++ return ++ fi ++ done ++} ++ + # Don't propagate variables that are set by default in the shell. + typeset +x WORDCHARS + +-- +2.39.0 + diff --git a/zsh.spec b/zsh.spec index c677f46..e6d591b 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -13,6 +13,9 @@ Source5: zshenv.rhs Source6: dotzshrc Source7: dotzprofile +# do not use egrep in tests to make them pass again +Patch1: 0001-zsh-5.9-do-not-use-egrep-in-tests.patch + BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -160,6 +163,9 @@ fi %doc Doc/*.html %changelog +* Mon Jan 09 2023 Kamil Dudka - 5.9-3 +- do not use egrep in tests to make them pass again + * Sat Jul 23 2022 Fedora Release Engineering - 5.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 527f2cfb8126226100f39bf68b70ff15c1a4007e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Fri, 13 Jan 2023 09:37:42 +0100 Subject: [PATCH 51/74] use 'int main()' in test C-codes in configure This is based on upstream commit ab4d62eb975a4c4c51dd35822665050e2ddc6918 with the changed to the ChangeLog file removed. --- 0002-zsh-Use-int-main-in-test-c-codes.patch | 541 ++++++++++++++++++++ zsh.spec | 7 +- 2 files changed, 547 insertions(+), 1 deletion(-) create mode 100644 0002-zsh-Use-int-main-in-test-c-codes.patch diff --git a/0002-zsh-Use-int-main-in-test-c-codes.patch b/0002-zsh-Use-int-main-in-test-c-codes.patch new file mode 100644 index 0000000..3585cc4 --- /dev/null +++ b/0002-zsh-Use-int-main-in-test-c-codes.patch @@ -0,0 +1,541 @@ +commit ab4d62eb975a4c4c51dd35822665050e2ddc6918 +Author: Nicholas Vinson +Date: Wed Sep 21 09:22:11 2022 +0900 + + 50641: use 'int main()' in test C-codes in configure + +diff --git a/aczsh.m4 b/aczsh.m4 +index 1209ac614..b31236020 100644 +--- a/aczsh.m4 ++++ b/aczsh.m4 +@@ -44,6 +44,7 @@ AC_DEFUN(zsh_64_BIT_TYPE, + #include + #endif + ++int + main() + { + $1 foo = 0; +@@ -118,7 +119,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS + AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) && + AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +-#include + #ifdef HPUX10DYNAMIC + #include + #define RTLD_LAZY BIND_DEFERRED +@@ -146,29 +146,30 @@ char *zsh_gl_sym_addr ; + #define RTLD_GLOBAL 0 + #endif + ++int + main() + { + void *handle1, *handle2; + void *(*zsh_getaddr1)(), *(*zsh_getaddr2)(); + void *sym1, *sym2; + handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle1) exit(1); ++ if(!handle1) return(1); + handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle2) exit(1); ++ if(!handle2) return(1); + zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); + zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2"); + sym1 = zsh_getaddr1(); + sym2 = zsh_getaddr2(); +- if(!sym1 || !sym2) exit(1); +- if(sym1 != sym2) exit(1); ++ if(!sym1 || !sym2) return(1); ++ if(sym1 != sym2) return(1); + dlclose(handle1); + handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle1) exit(1); ++ if(!handle1) return(1); + zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); + sym1 = zsh_getaddr1(); +- if(!sym1) exit(1); +- if(sym1 != sym2) exit(1); +- exit(0); ++ if(!sym1) return(1); ++ if(sym1 != sym2) return(1); ++ return(0); + } + ]])],[zsh_cv_shared_$1=yes], + [zsh_cv_shared_$1=no], +@@ -200,7 +201,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS + AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) && + AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +-#include + #ifdef HPUX10DYNAMIC + #include + #define RTLD_LAZY BIND_DEFERRED +@@ -228,19 +228,19 @@ char *zsh_gl_sym_addr ; + #define RTLD_GLOBAL 0 + #endif + +- ++int + main() + { + void *handle1, *handle2; + int (*fred1)(), (*fred2)(); + handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle1) exit(1); ++ if(!handle1) return(1); + handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle2) exit(1); ++ if(!handle2) return(1); + fred1 = (int (*)()) dlsym(handle1, "${us}fred"); + fred2 = (int (*)()) dlsym(handle2, "${us}fred"); +- if(!fred1 || !fred2) exit(1); +- exit((*fred1)() != 42 || (*fred2)() != 69); ++ if(!fred1 || !fred2) return(1); ++ return((*fred1)() != 42 || (*fred2)() != 69); + } + ]])],[zsh_cv_sys_dynamic_clash_ok=yes], + [zsh_cv_sys_dynamic_clash_ok=no], +@@ -276,7 +276,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS + AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) && + AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +-#include + #ifdef HPUX10DYNAMIC + #include + #define RTLD_LAZY BIND_DEFERRED +@@ -304,17 +303,18 @@ char *zsh_gl_sym_addr ; + #define RTLD_GLOBAL 0 + #endif + ++int + main() + { + void *handle; + int (*barneysym)(); + handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle) exit(1); ++ if(!handle) return(1); + handle = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle) exit(1); ++ if(!handle) return(1); + barneysym = (int (*)()) dlsym(handle, "${us}barney"); +- if(!barneysym) exit(1); +- exit((*barneysym)() != 69); ++ if(!barneysym) return(1); ++ return((*barneysym)() != 69); + } + ]])],[zsh_cv_sys_dynamic_rtld_global=yes], + [zsh_cv_sys_dynamic_rtld_global=no], +@@ -346,7 +346,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS + save_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +-#include + #ifdef HPUX10DYNAMIC + #include + #define RTLD_LAZY BIND_DEFERRED +@@ -374,15 +373,16 @@ char *zsh_gl_sym_addr ; + #define RTLD_GLOBAL 0 + #endif + ++int + main() + { + void *handle; + int (*barneysym)(); + handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle) exit(1); ++ if(!handle) return(1); + barneysym = (int (*)()) dlsym(handle, "${us}barney"); +- if(!barneysym) exit(1); +- exit((*barneysym)() != 69); ++ if(!barneysym) return(1); ++ return((*barneysym)() != 69); + } + + int fred () { return 42; } +@@ -420,7 +420,6 @@ elif + save_ldflags=$LDFLAGS + LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -s" + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +-#include + #ifdef HPUX10DYNAMIC + #include + #define RTLD_LAZY BIND_DEFERRED +@@ -448,15 +447,16 @@ char *zsh_gl_sym_addr ; + #define RTLD_GLOBAL 0 + #endif + ++int + main() + { + void *handle; + int (*barneysym)(); + handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle) exit(1); ++ if(!handle) return(1); + barneysym = (int (*)()) dlsym(handle, "${us}barney"); +- if(!barneysym) exit(1); +- exit((*barneysym)() != 69); ++ if(!barneysym) return(1); ++ return((*barneysym)() != 69); + } + + int fred () { return 42; } +@@ -488,7 +488,6 @@ echo 'int fred () { return 42; }' > conftest1.c + if AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&AS_MESSAGE_LOG_FD) && + AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS -s conftest1.o $LIBS 1>&AS_MESSAGE_LOG_FD); then + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +-#include + #ifdef HPUX10DYNAMIC + #include + #define RTLD_LAZY BIND_DEFERRED +@@ -516,15 +515,16 @@ char *zsh_gl_sym_addr ; + #define RTLD_GLOBAL 0 + #endif + ++int + main() + { + void *handle; + int (*fredsym)(); + handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); +- if(!handle) exit(1); ++ if(!handle) return(1); + fredsym = (int (*)()) dlsym(handle, "${us}fred"); +- if(!fredsym) exit(1); +- exit((*fredsym)() != 42); ++ if(!fredsym) return(1); ++ return((*fredsym)() != 42); + } + ]])],[zsh_cv_sys_dynamic_strip_lib=yes], + [zsh_cv_sys_dynamic_strip_lib=no], +diff --git a/configure.ac b/configure.ac +index 890ef8dd2..074141d38 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -585,7 +585,7 @@ fi + dnl Checking if compiler correctly cast signed to unsigned. + AC_CACHE_CHECK(if signed to unsigned casting is broken, + zsh_cv_c_broken_signed_to_unsigned_casting, +-[AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])]) ++[AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])]) + AH_TEMPLATE([BROKEN_SIGNED_TO_UNSIGNED_CASTING], + [Define to 1 if compiler incorrectly cast signed to unsigned.]) + if test x$zsh_cv_c_broken_signed_to_unsigned_casting = xyes; then +@@ -1046,7 +1046,7 @@ else + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + +-main() { return sizeof(off_t) < 8; } ++int main() { return sizeof(off_t) < 8; } + ]])],[zsh_cv_off_t_is_64_bit=yes],[zsh_cv_off_t_is_64_bit=no],[zsh_cv_off_t_is_64_bit=no])]) + if test x$zsh_cv_off_t_is_64_bit = xyes; then + AC_DEFINE(OFF_T_IS_64_BIT) +@@ -1056,7 +1056,7 @@ main() { return sizeof(off_t) < 8; } + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + +-main() { return sizeof(ino_t) < 8; } ++int main() { return sizeof(ino_t) < 8; } + ]])],[zsh_cv_ino_t_is_64_bit=yes],[zsh_cv_ino_t_is_64_bit=no],[zsh_cv_ino_t_is_64_bit=no])]) + if test x$zsh_cv_ino_t_is_64_bit = xyes; then + AC_DEFINE(INO_T_IS_64_BIT) +@@ -1369,7 +1369,7 @@ zsh_cv_func_realpath_accepts_null, + #include + #include + ],[ +-exit(!realpath("/", (char*)0)); ++return(!realpath("/", (char*)0)); + ])], + [zsh_cv_func_realpath_accepts_null=yes], + [zsh_cv_func_realpath_accepts_null=no], +@@ -1393,10 +1393,9 @@ AC_CACHE_CHECK(if tgetent accepts NULL, + zsh_cv_func_tgetent_accepts_null, + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include +-#include + int tgetent(char *, char *); + char *tgetstr(char *, char **); +-main() ++int main() + { + char buf[4096]; + int r1 = tgetent(buf, "vt100"); +@@ -1407,7 +1406,7 @@ main() + tgetstr("cl", &u); + creat("conftest.tgetent", 0640); + } +- exit((r1 != r2) || r2 == -1); ++ return((r1 != r2) || r2 == -1); + } + ]])],[if test -f conftest.tgetent; then + zsh_cv_func_tgetent_accepts_null=yes +@@ -1421,10 +1420,9 @@ AC_CACHE_CHECK(if tgetent returns 0 on success, + zsh_cv_func_tgetent_zero_success, + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include +-#include + int tgetent(char *, char*); + char *tgetstr(char *, char **); +-main() ++int main() + { + char buf[4096]; + int r1 = tgetent(buf, "!@#$%^&*"); +@@ -1435,7 +1433,7 @@ main() + tgetstr("cl", &u); + creat("conftest.tgetent0", 0640); + } +- exit(r1 == r2); ++ return(r1 == r2); + } + ]])],[if test -f conftest.tgetent0; then + zsh_cv_func_tgetent_zero_success=yes +@@ -1869,8 +1867,7 @@ zsh_cv_rlim_t_is_longer, + #include + #endif + #include +-#include +-main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])]) ++int main(){struct rlimit r;return(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])]) + if test x$zsh_cv_rlim_t_is_longer = xyes; then + AC_CACHE_CHECK(if rlim_t is a quad, + zsh_cv_rlim_t_is_quad_t, +@@ -1880,13 +1877,12 @@ if test x$zsh_cv_rlim_t_is_longer = xyes; then + #endif + #include + #include +-#include +-main() { ++int main() { + struct rlimit r; + char buf[20]; + r.rlim_cur = 0; + sprintf(buf, "%qd", r.rlim_cur); +- exit(strcmp(buf, "0")); ++ return(strcmp(buf, "0")); + }]])],[zsh_cv_rlim_t_is_quad_t=yes],[zsh_cv_rlim_t_is_quad_t=no],[zsh_cv_rlim_t_is_quad_t=no])]) + if test x$zsh_cv_rlim_t_is_quad_t = xyes; then + AC_DEFINE(RLIM_T_IS_QUAD_T) +@@ -1903,8 +1899,7 @@ else + #include + #endif + #include +-#include +- main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])]) ++ int main(){struct rlimit r;r.rlim_cur=-1;return(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])]) + if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then + AC_DEFINE(RLIM_T_IS_UNSIGNED) + DEFAULT_RLIM_T="unsigned $DEFAULT_RLIM_T" +@@ -2187,9 +2182,8 @@ zsh_cv_sys_fifo, + #include + #include + #include +-#include + #include +-main() ++int main() + { + char c; + int fd; +@@ -2200,18 +2194,18 @@ main() + #else + if(mknod("/tmp/fifo$$", 0010600, 0) < 0) + #endif +- exit(1); ++ return(1); + pid = fork(); + if(pid < 0) +- exit(1); ++ return(1); + if(pid) { + fd = open("/tmp/fifo$$", O_RDONLY); +- exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x'); ++ return(fd < 0 || read(fd, &c, 1) != 1 || c != 'x'); + } + fd = open("/tmp/fifo$$", O_WRONLY); + ret = (fd < 0 || write(fd, "x", 1) < 1); + unlink("/tmp/fifo$$"); +- exit(ret); ++ return(ret); + } + ]])],[zsh_cv_sys_fifo=yes],[zsh_cv_sys_fifo=no],[zsh_cv_sys_fifo=yes]) + ]) +@@ -2289,8 +2283,7 @@ zsh_cv_sys_link, + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include +-#include +-main() ++int main() + { + int ret; + char *tmpfile, *newfile; +@@ -2299,11 +2292,11 @@ main() + unlink(tmpfile); + unlink(newfile); + if(creat(tmpfile, 0644) < 0) +- exit(1); ++ return(1); + ret = link(tmpfile, newfile); + unlink(tmpfile); + unlink(newfile); +- exit(ret<0); ++ return(ret<0); + } + ]])],[zsh_cv_sys_link=yes],[zsh_cv_sys_link=no],[zsh_cv_sys_link=yes])]) + AH_TEMPLATE([HAVE_LINK], +@@ -2322,12 +2315,11 @@ zsh_cv_sys_killesrch, + #include + #include + #include +-#include +-main() ++int main() + { + int pid = (getpid() + 10000) & 0xffffff; + while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1; +- exit(errno!=ESRCH); ++ return(errno!=ESRCH); + } + ]])],[zsh_cv_sys_killesrch=yes],[zsh_cv_sys_killesrch=no],[zsh_cv_sys_killesrch=yes])]) + AH_TEMPLATE([BROKEN_KILL_ESRCH], +@@ -2348,12 +2340,11 @@ if test x$signals_style = xPOSIX_SIGNALS; then + [AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include + #include +-#include + int child=0; + void handler(sig) + int sig; + {if(sig==SIGCHLD) child=1;} +-main() { ++int main() { + struct sigaction act; + sigset_t set; + int pid, ret; +@@ -2368,7 +2359,7 @@ main() { + if(pid>0) { + sigemptyset(&set); + ret=sigsuspend(&set); +- exit(child==0); ++ return(child==0); + } + } + ]])],[zsh_cv_sys_sigsuspend=yes],[zsh_cv_sys_sigsuspend=no],[zsh_cv_sys_sigsuspend=yes])]) +@@ -2400,15 +2391,14 @@ case "x$zsh_working_tcsetpgrp" in + #include + #include + #include +-#include +-main() { ++int main() { + int fd; + int ret; + fd=open("/dev/tty", O_RDWR); +- if (fd < 0) exit(2); ++ if (fd < 0) return(2); + ret=tcsetpgrp(fd, tcgetpgrp(fd)); +- if (ret < 0) exit(1); +- exit(0); ++ if (ret < 0) return(1); ++ return(0); + } + ]])],[zsh_cv_sys_tcsetpgrp=yes],[ + case $? in +@@ -2448,7 +2438,7 @@ if test x$ac_cv_func_getpwnam = xyes; then + #include + #include + #include +-main() { ++int main() { + struct passwd *pw1, *pw2; + char buf[1024], name[1024]; + sprintf(buf, "%d:%d", getpid(), rand()); +@@ -2456,7 +2446,7 @@ main() { + if (pw1) strcpy(name, pw1->pw_name); + sprintf(buf, "%d:%d", rand(), getpid()); + pw2=getpwnam(buf); +- exit(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name)); ++ return(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name)); + } + ]])],[zsh_cv_sys_getpwnam_faked=no],[zsh_cv_sys_getpwnam_faked=yes],[zsh_cv_sys_getpwnam_faked=no])]) + if test x$zsh_cv_sys_getpwnam_faked = xyes; then +@@ -2775,20 +2765,17 @@ elif test "x$dynamic" = xyes; then + zsh_cv_sys_elf, + [AC_RUN_IFELSE([AC_LANG_SOURCE([[/* Test for whether ELF binaries are produced */ + #include +-#include + #include +-main(argc, argv) +-int argc; +-char *argv[]; ++int main(int argc, char *argv[]) + { + char b[4]; + int i = open(argv[0],O_RDONLY); + if(i == -1) +- exit(1); /* fail */ ++ return(1); /* fail */ + if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') +- exit(0); /* succeed (yes, it's ELF) */ ++ return(0); /* succeed (yes, it's ELF) */ + else +- exit(1); /* fail */ ++ return(1); /* fail */ + }]])],[zsh_cv_sys_elf=yes],[zsh_cv_sys_elf=no],[zsh_cv_sys_elf=yes])]) + + # We use [0-9]* in case statements, so need to change quoting +@@ -2924,13 +2911,12 @@ LDFLAGS="$old_LDFLAGS") + AC_CACHE_CHECK(if your dlsym() needs a leading underscore, + zsh_cv_func_dlsym_needs_underscore, + [echo failed >conftestval && cat >conftest.c <&AS_MESSAGE_LOG_FD) && + AC_TRY_COMMAND($DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&AS_MESSAGE_LOG_FD) && + AC_RUN_IFELSE([AC_LANG_SOURCE([[ + #include +-#include + #ifdef HPUX10DYNAMIC + #include + #define RTLD_LAZY BIND_DEFERRED +@@ -2957,16 +2943,16 @@ char *zsh_gl_sym_addr ; + + extern int fred() ; + +-main() ++int main() + { + void * handle ; + void * symbol ; + FILE *f=fopen("conftestval", "w"); +- if (!f) exit(1); ++ if (!f) return(1); + handle = dlopen("./conftest.$DL_EXT", RTLD_LAZY) ; + if (handle == NULL) { + fprintf (f, "dlopen failed") ; +- exit(1); ++ return(1); + } + symbol = dlsym(handle, "fred") ; + if (symbol == NULL) { +@@ -2974,13 +2960,13 @@ main() + symbol = dlsym(handle, "_fred") ; + if (symbol == NULL) { + fprintf (f, "dlsym failed") ; +- exit(1); ++ return(1); + } + fprintf (f, "yes") ; + } + else + fprintf (f, "no") ; +- exit(0); ++ return(0); + }]])],[zsh_cv_func_dlsym_needs_underscore=`cat conftestval`],[zsh_cv_func_dlsym_needs_underscore=failed + dynamic=no],[zsh_cv_func_dlsym_needs_underscore=no])]) + if test "x$zsh_cv_func_dlsym_needs_underscore" = xyes; then diff --git a/zsh.spec b/zsh.spec index e6d591b..0b64e77 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -15,6 +15,8 @@ Source7: dotzprofile # do not use egrep in tests to make them pass again Patch1: 0001-zsh-5.9-do-not-use-egrep-in-tests.patch +# Upstream commit ab4d62eb975a4c4c51dd35822665050e2ddc6918 +Patch2: 0002-zsh-Use-int-main-in-test-c-codes.patch BuildRequires: autoconf BuildRequires: coreutils @@ -163,6 +165,9 @@ fi %doc Doc/*.html %changelog +* Fri Jan 13 2023 Timm Bäder - 5.9-4 +- use 'int main()' in test C-codes in configure + * Mon Jan 09 2023 Kamil Dudka - 5.9-3 - do not use egrep in tests to make them pass again From 1ca491a90109918759bb3c91fa6b0bb597568862 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 21 Jan 2023 08:21:08 +0000 Subject: [PATCH 52/74] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 0b64e77..79c3b09 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 4%{?dist} +Release: 5%{?dist} License: MIT URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -165,6 +165,9 @@ fi %doc Doc/*.html %changelog +* Sat Jan 21 2023 Fedora Release Engineering - 5.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Fri Jan 13 2023 Timm Bäder - 5.9-4 - use 'int main()' in test C-codes in configure From 51522ac8aa78c4d54a3707b1ce7f7ad3a798f145 Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Wed, 17 May 2023 11:23:20 -0400 Subject: [PATCH 53/74] Update the License tag to use SPDX license expressions Examine the zsh source and construct a new License tag using SPDX identifiers. Most of the zsh source is licensed under what SPDX calls the MIT-Modern-Variant license. One source file (openssh_bsd_setres_id.c) carries an ISC license as well. Three shell extensions are licensed under GPL-2.0-only. Signed-off-by: David Cantrell --- zsh.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zsh.spec b/zsh.spec index 79c3b09..464b2af 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,8 +1,8 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 5%{?dist} -License: MIT +Release: 6%{?dist} +License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz Source1: zlogin.rhs @@ -165,6 +165,9 @@ fi %doc Doc/*.html %changelog +* Wed May 17 2023 David Cantrell - 5.9-6 +- Update the License tag to use SPDX identifiers + * Sat Jan 21 2023 Fedora Release Engineering - 5.9-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From fa2ea2fc3629211809bee13ffc6c14eaced8b4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Thu, 13 Jul 2023 10:06:02 +0200 Subject: [PATCH 54/74] Make zsh/{tcp,zftp} compatible with full RELRO Resolves: rhbz#2212160 --- ...dule-loading-problem-with-full-RELRO.patch | 69 +++++++++++++++++++ zsh.spec | 10 +-- 2 files changed, 75 insertions(+), 4 deletions(-) create mode 100644 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch diff --git a/0003-zsh-fix-module-loading-problem-with-full-RELRO.patch b/0003-zsh-fix-module-loading-problem-with-full-RELRO.patch new file mode 100644 index 0000000..2ca953b --- /dev/null +++ b/0003-zsh-fix-module-loading-problem-with-full-RELRO.patch @@ -0,0 +1,69 @@ +From a84fdd7c8f77935ecce99ff2b0bdba738821ed79 Mon Sep 17 00:00:00 2001 +From: Jun-ichi Takimoto +Date: Mon, 26 Jun 2023 17:13:04 +0900 +Subject: [PATCH] 51889: fix module loading problem with full RELRO + +If full RELRO (relocation read-only, one of the security enhancement +methods for ELF-based systems) is used when building zsh (as in binary +packages of most Linuxes), loading a module (e.g. zsh/zftp) fails unless +all the modules it depends on are already loaded. With this patch the +necessary modules are automatically loaded. + +Upstream-commit: a84fdd7c8f77935ecce99ff2b0bdba738821ed79 +Signed-off-by: Lukáš Zaoral +--- + Src/Modules/zftp.c | 2 +- + Src/mkbltnmlst.sh | 24 ++++++++++++++++++++++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + +diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c +index 49b3ffa89..47a5e9de9 100644 +--- a/Src/Modules/zftp.c ++++ b/Src/Modules/zftp.c +@@ -3172,7 +3172,7 @@ static struct features module_features = { + int + setup_(UNUSED(Module m)) + { +- return (require_module("zsh/net/tcp", NULL, 0) == 1); ++ return 0; + } + + /**/ +diff --git a/Src/mkbltnmlst.sh b/Src/mkbltnmlst.sh +index c4611d8b3..067ecdaf9 100644 +--- a/Src/mkbltnmlst.sh ++++ b/Src/mkbltnmlst.sh +@@ -76,6 +76,30 @@ for x_mod in $x_mods; do + test "x$linked" = xno && echo "#endif" + done + ++# if dynamic module 'mod' with load=no has moddeps in its .mdd, ++# then output add_dep(mod, dep) for each 'dep' in moddeps. ++dyn_mods="`grep ' link=dynamic .* load=no ' $CFMOD | \ ++ sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`" ++ ++for mod in $dyn_mods; do ++ modfile="`grep '^name='$mod' ' $CFMOD | \ ++ sed -e 's/^.* modfile=//' -e 's/ .*//'`" ++ if test "x$modfile" = x; then ++ echo >&2 "WARNING: no name for \`$mod' in $CFMOD (ignored)" ++ continue ++ fi ++ unset moddeps ++ . $srcdir/../$modfile ++ if test -n "$moddeps"; then ++ echo '#ifdef DYNAMIC' ++ echo "/* non-linked-in known module \`$mod' */" ++ for dep in $moddeps; do ++ echo " add_dep(\"$mod\", \"$dep\");" ++ done ++ echo '#endif' ++ fi ++done ++ + echo + done_mods=" " + for bin_mod in $bin_mods; do +-- +2.41.0 + diff --git a/zsh.spec b/zsh.spec index 464b2af..24e66ba 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 6%{?dist} +Release: 7%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -17,6 +17,8 @@ Source7: dotzprofile Patch1: 0001-zsh-5.9-do-not-use-egrep-in-tests.patch # Upstream commit ab4d62eb975a4c4c51dd35822665050e2ddc6918 Patch2: 0002-zsh-Use-int-main-in-test-c-codes.patch +# upstream commit a84fdd7c8f77935ecce99ff2b0bdba738821ed79 +Patch3: 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch BuildRequires: autoconf BuildRequires: coreutils @@ -77,9 +79,6 @@ sed -e 's|^\.NOTPARALLEL|#.NOTPARALLEL|' -i 'Config/defs.mk.in' # make build of run-time loadable modules work again (#1535422) %undefine _strict_symbol_defs_build -# make loading of module's dependencies work again (#1277996) -export LIBLDFLAGS='-z lazy' - # avoid build failure in case we have working ypcat (#1687574) export zsh_cv_sys_nis='no' @@ -165,6 +164,9 @@ fi %doc Doc/*.html %changelog +* Thu Jul 13 2023 Lukáš Zaoral - 5.9-7 +- Make zsh/{tcp,zftp} compatible with full RELRO (rhbz#2212160) + * Wed May 17 2023 David Cantrell - 5.9-6 - Update the License tag to use SPDX identifiers From 261d24400710eefc26c92d6485599eda33e49943 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 22 Jul 2023 19:47:20 +0000 Subject: [PATCH 55/74] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 24e66ba..1e031c0 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 7%{?dist} +Release: 8%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -164,6 +164,9 @@ fi %doc Doc/*.html %changelog +* Sat Jul 22 2023 Fedora Release Engineering - 5.9-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Thu Jul 13 2023 Lukáš Zaoral - 5.9-7 - Make zsh/{tcp,zftp} compatible with full RELRO (rhbz#2212160) From 584e38d1fda565187f2df0997e7ac9f25f583ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Mon, 21 Aug 2023 08:54:34 +0200 Subject: [PATCH 56/74] port to PCRE 2 Resolves: rhbz#1938979 --- 0004-zsh-enable-PCRE-locale-switching.patch | 64 ++ 0005-zsh-port-to-pcre2.patch | 863 ++++++++++++++++++++ zsh.spec | 11 +- 3 files changed, 936 insertions(+), 2 deletions(-) create mode 100644 0004-zsh-enable-PCRE-locale-switching.patch create mode 100644 0005-zsh-port-to-pcre2.patch diff --git a/0004-zsh-enable-PCRE-locale-switching.patch b/0004-zsh-enable-PCRE-locale-switching.patch new file mode 100644 index 0000000..a6f03bf --- /dev/null +++ b/0004-zsh-enable-PCRE-locale-switching.patch @@ -0,0 +1,64 @@ +From 1b421e4978440234fb73117c8505dad1ccc68d46 Mon Sep 17 00:00:00 2001 +From: Jun-ichi Takimoto +Date: Mon, 26 Sep 2022 10:52:50 +0900 +Subject: [PATCH] 50658 + test: Enable to switch between C/UTF-8 locales in + PCRE + +--- + Src/Modules/pcre.c | 10 ++-------- + Test/V07pcre.ztst | 11 +++++++++++ + 2 files changed, 13 insertions(+), 8 deletions(-) + +diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c +index 6289e003e..46875a59b 100644 +--- a/Src/Modules/pcre.c ++++ b/Src/Modules/pcre.c +@@ -47,8 +47,6 @@ zpcre_utf8_enabled(void) + #if defined(MULTIBYTE_SUPPORT) && defined(HAVE_NL_LANGINFO) && defined(CODESET) + static int have_utf8_pcre = -1; + +- /* value can toggle based on MULTIBYTE, so don't +- * be too eager with caching */ + if (have_utf8_pcre < -1) + return 0; + +@@ -56,15 +54,11 @@ zpcre_utf8_enabled(void) + return 0; + + if ((have_utf8_pcre == -1) && +- (!strcmp(nl_langinfo(CODESET), "UTF-8"))) { +- +- if (pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre)) ++ (pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre))) { + have_utf8_pcre = -2; /* erk, failed to ask */ + } + +- if (have_utf8_pcre < 0) +- return 0; +- return have_utf8_pcre; ++ return (have_utf8_pcre == 1) && (!strcmp(nl_langinfo(CODESET), "UTF-8")); + + #else + return 0; +diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst +index ca13419e5..22a0b64c7 100644 +--- a/Test/V07pcre.ztst ++++ b/Test/V07pcre.ztst +@@ -162,3 +162,14 @@ + echo $match[2] ) + 0:regression for segmentation fault, workers/38307 + >test ++ ++ LANG_SAVE=$LANG ++ [[ é =~ '^.\z' ]]; echo $? ++ LANG=C ++ [[ é =~ '^..\z' ]]; echo $? ++ LANG=$LANG_SAVE ++ [[ é =~ '^.\z' ]]; echo $? ++0:swich between C/UTF-8 locales ++>0 ++>0 ++>0 +-- +2.41.0 + diff --git a/0005-zsh-port-to-pcre2.patch b/0005-zsh-port-to-pcre2.patch new file mode 100644 index 0000000..6c1a2c0 --- /dev/null +++ b/0005-zsh-port-to-pcre2.patch @@ -0,0 +1,863 @@ +From b62e911341c8ec7446378b477c47da4256053dc0 Mon Sep 17 00:00:00 2001 +From: Oliver Kiddle +Date: Sat, 13 May 2023 00:53:32 +0200 +Subject: [PATCH 1/3] 51723: migrate pcre module to pcre2 + +--- + Src/Modules/pcre.c | 223 ++++++++++++++++++--------------------------- + Test/V07pcre.ztst | 13 ++- + configure.ac | 20 ++-- + 3 files changed, 109 insertions(+), 149 deletions(-) + +diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c +index 46875a59b..079ecc2c5 100644 +--- a/Src/Modules/pcre.c ++++ b/Src/Modules/pcre.c +@@ -34,11 +34,11 @@ + #define CPCRE_PLAIN 0 + + /**/ +-#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC) +-#include ++#if defined(HAVE_PCRE2_COMPILE_8) && defined(HAVE_PCRE2_H) ++#define PCRE2_CODE_UNIT_WIDTH 8 ++#include + +-static pcre *pcre_pattern; +-static pcre_extra *pcre_hints; ++static pcre2_code *pcre_pattern; + + /**/ + static int +@@ -54,8 +54,8 @@ zpcre_utf8_enabled(void) + return 0; + + if ((have_utf8_pcre == -1) && +- (pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre))) { +- have_utf8_pcre = -2; /* erk, failed to ask */ ++ (pcre2_config(PCRE2_CONFIG_UNICODE, &have_utf8_pcre))) { ++ have_utf8_pcre = -2; /* erk, failed to ask */ + } + + return (have_utf8_pcre == 1) && (!strcmp(nl_langinfo(CODESET), "UTF-8")); +@@ -69,115 +69,87 @@ zpcre_utf8_enabled(void) + static int + bin_pcre_compile(char *nam, char **args, Options ops, UNUSED(int func)) + { +- int pcre_opts = 0, pcre_errptr, target_len; +- const char *pcre_error; ++ uint32_t pcre_opts = 0; ++ int target_len; ++ int pcre_error; ++ PCRE2_SIZE pcre_offset; + char *target; + +- if(OPT_ISSET(ops,'a')) pcre_opts |= PCRE_ANCHORED; +- if(OPT_ISSET(ops,'i')) pcre_opts |= PCRE_CASELESS; +- if(OPT_ISSET(ops,'m')) pcre_opts |= PCRE_MULTILINE; +- if(OPT_ISSET(ops,'x')) pcre_opts |= PCRE_EXTENDED; +- if(OPT_ISSET(ops,'s')) pcre_opts |= PCRE_DOTALL; ++ if (OPT_ISSET(ops, 'a')) pcre_opts |= PCRE2_ANCHORED; ++ if (OPT_ISSET(ops, 'i')) pcre_opts |= PCRE2_CASELESS; ++ if (OPT_ISSET(ops, 'm')) pcre_opts |= PCRE2_MULTILINE; ++ if (OPT_ISSET(ops, 'x')) pcre_opts |= PCRE2_EXTENDED; ++ if (OPT_ISSET(ops, 's')) pcre_opts |= PCRE2_DOTALL; + + if (zpcre_utf8_enabled()) +- pcre_opts |= PCRE_UTF8; +- +-#ifdef HAVE_PCRE_STUDY +- if (pcre_hints) +-#ifdef PCRE_CONFIG_JIT +- pcre_free_study(pcre_hints); +-#else +- pcre_free(pcre_hints); +-#endif +- pcre_hints = NULL; +-#endif ++ pcre_opts |= PCRE2_UTF; + + if (pcre_pattern) +- pcre_free(pcre_pattern); ++ pcre2_code_free(pcre_pattern); + pcre_pattern = NULL; + + target = ztrdup(*args); + unmetafy(target, &target_len); + +- if ((int)strlen(target) != target_len) { +- zwarnnam(nam, "embedded NULs in PCRE pattern terminate pattern"); +- } +- +- pcre_pattern = pcre_compile(target, pcre_opts, &pcre_error, &pcre_errptr, NULL); ++ pcre_pattern = pcre2_compile((PCRE2_SPTR) target, (PCRE2_SIZE) target_len, ++ pcre_opts, &pcre_error, &pcre_offset, NULL); + + free(target); + + if (pcre_pattern == NULL) + { +- zwarnnam(nam, "error in regex: %s", pcre_error); ++ PCRE2_UCHAR buffer[256]; ++ pcre2_get_error_message(pcre_error, buffer, sizeof(buffer)); ++ zwarnnam(nam, "error in regex: %s", buffer); + return 1; + } + + return 0; + } + +-/**/ +-#ifdef HAVE_PCRE_STUDY +- + /**/ + static int + bin_pcre_study(char *nam, UNUSED(char **args), UNUSED(Options ops), UNUSED(int func)) + { +- const char *pcre_error; +- + if (pcre_pattern == NULL) + { + zwarnnam(nam, "no pattern has been compiled for study"); + return 1; + } +- +- if (pcre_hints) +-#ifdef PCRE_CONFIG_JIT +- pcre_free_study(pcre_hints); +-#else +- pcre_free(pcre_hints); +-#endif +- pcre_hints = NULL; + +- pcre_hints = pcre_study(pcre_pattern, 0, &pcre_error); +- if (pcre_error != NULL) +- { +- zwarnnam(nam, "error while studying regex: %s", pcre_error); +- return 1; ++ int jit = 0; ++ if (!pcre2_config(PCRE2_CONFIG_JIT, &jit) && jit) { ++ if (pcre2_jit_compile(pcre_pattern, PCRE2_JIT_COMPLETE) < 0) { ++ zwarnnam(nam, "error while studying regex"); ++ return 1; ++ } + } + + return 0; + } + +-/**/ +-#else /* !HAVE_PCRE_STUDY */ +- +-# define bin_pcre_study bin_notavail +- +-/**/ +-#endif /* !HAVE_PCRE_STUDY */ +- +-/**/ + static int +-zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, +- char *substravar, int want_offset_pair, int matchedinarr, +- int want_begin_end) ++zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count, ++ char *matchvar, char *substravar, int want_offset_pair, ++ int matchedinarr, int want_begin_end) + { +- char **captures, *match_all, **matches; ++ PCRE2_SIZE *ovec; ++ char *match_all, **matches; + char offset_all[50]; + int capture_start = 1; + + if (matchedinarr) { +- /* bash-style captures[0] entire-matched string in the array */ ++ /* bash-style ovec[0] entire-matched string in the array */ + capture_start = 0; + } + +- /* captures[0] will be entire matched string, [1] first substring */ +- if (!pcre_get_substring_list(arg, ovec, captured_count, (const char ***)&captures)) { +- int nelem = arrlen(captures)-1; ++ /* ovec[0] will be entire matched string, [1] first substring */ ++ ovec = pcre2_get_ovector_pointer(mdata); ++ if (ovec) { ++ int nelem = captured_count - 1; + /* Set to the offsets of the complete match */ + if (want_offset_pair) { +- sprintf(offset_all, "%d %d", ovec[0], ovec[1]); ++ sprintf(offset_all, "%ld %ld", ovec[0], ovec[1]); + setsparam("ZPCRE_OP", ztrdup(offset_all)); + } + /* +@@ -186,7 +158,7 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, + * ovec is length 2*(1+capture_list_length) + */ + if (matchvar) { +- match_all = metafy(captures[0], ovec[1] - ovec[0], META_DUP); ++ match_all = metafy(arg + ovec[0], ovec[1] - ovec[0], META_DUP); + setsparam(matchvar, match_all); + } + /* +@@ -201,16 +173,12 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, + */ + if (substravar && + (!want_begin_end || nelem)) { +- char **x, **y; ++ char **x; + int vec_off, i; +- y = &captures[capture_start]; + matches = x = (char **) zalloc(sizeof(char *) * (captured_count+1-capture_start)); +- for (i = capture_start; i < captured_count; i++, y++) { ++ for (i = capture_start; i < captured_count; i++) { + vec_off = 2*i; +- if (*y) +- *x++ = metafy(*y, ovec[vec_off+1]-ovec[vec_off], META_DUP); +- else +- *x++ = NULL; ++ *x++ = metafy(arg + ovec[vec_off], ovec[vec_off+1]-ovec[vec_off], META_DUP); + } + *x = NULL; + setaparam(substravar, matches); +@@ -247,7 +215,8 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, + setiparam("MEND", offs + !isset(KSHARRAYS) - 1); + if (nelem) { + char **mbegin, **mend, **bptr, **eptr; +- int i, *ipair; ++ int i; ++ size_t *ipair; + + bptr = mbegin = zalloc(sizeof(char*)*(nelem+1)); + eptr = mend = zalloc(sizeof(char*)*(nelem+1)); +@@ -287,8 +256,6 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, + setaparam("mend", mend); + } + } +- +- pcre_free_substring_list((const char **)captures); + } + + return 0; +@@ -314,7 +281,8 @@ getposint(char *instr, char *nam) + static int + bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) + { +- int ret, capcount, *ovec, ovecsize, c; ++ int ret, c; ++ pcre2_match_data *pcre_mdata = NULL; + char *matched_portion = NULL; + char *plaintext = NULL; + char *receptacle = NULL; +@@ -344,36 +312,30 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) + /* For the entire match, 'Return' the offset byte positions instead of the matched string */ + if(OPT_ISSET(ops,'b')) want_offset_pair = 1; + +- if ((ret = pcre_fullinfo(pcre_pattern, pcre_hints, PCRE_INFO_CAPTURECOUNT, &capcount))) +- { +- zwarnnam(nam, "error %d in fullinfo", ret); +- return 1; +- } +- +- ovecsize = (capcount+1)*3; +- ovec = zalloc(ovecsize*sizeof(int)); +- + plaintext = ztrdup(*args); + unmetafy(plaintext, &subject_len); + + if (offset_start > 0 && offset_start >= subject_len) +- ret = PCRE_ERROR_NOMATCH; +- else +- ret = pcre_exec(pcre_pattern, pcre_hints, plaintext, subject_len, offset_start, 0, ovec, ovecsize); ++ ret = PCRE2_ERROR_NOMATCH; ++ else { ++ pcre_mdata = pcre2_match_data_create_from_pattern(pcre_pattern, NULL); ++ ret = pcre2_match(pcre_pattern, (PCRE2_SPTR) plaintext, subject_len, ++ offset_start, 0, pcre_mdata, NULL); ++ } + + if (ret==0) return_value = 0; +- else if (ret==PCRE_ERROR_NOMATCH) /* no match */; ++ else if (ret == PCRE2_ERROR_NOMATCH) /* no match */; + else if (ret>0) { +- zpcre_get_substrings(plaintext, ovec, ret, matched_portion, receptacle, ++ zpcre_get_substrings(plaintext, pcre_mdata, ret, matched_portion, receptacle, + want_offset_pair, 0, 0); + return_value = 0; + } + else { +- zwarnnam(nam, "error in pcre_exec [%d]", ret); ++ zwarnnam(nam, "error in pcre2_match [%d]", ret); + } + +- if (ovec) +- zfree(ovec, ovecsize*sizeof(int)); ++ if (pcre_mdata) ++ pcre2_match_data_free(pcre_mdata); + zsfree(plaintext); + + return return_value; +@@ -383,17 +345,19 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) + static int + cond_pcre_match(char **a, int id) + { +- pcre *pcre_pat; +- const char *pcre_err; ++ pcre2_code *pcre_pat = NULL; ++ int pcre_err; ++ PCRE2_SIZE pcre_erroff; + char *lhstr, *rhre, *lhstr_plain, *rhre_plain, *avar, *svar; +- int r = 0, pcre_opts = 0, pcre_errptr, capcnt, *ov, ovsize; ++ int r = 0, pcre_opts = 0; ++ pcre2_match_data *pcre_mdata = NULL; + int lhstr_plain_len, rhre_plain_len; + int return_value = 0; + + if (zpcre_utf8_enabled()) +- pcre_opts |= PCRE_UTF8; ++ pcre_opts |= PCRE2_UTF; + if (isset(REMATCHPCRE) && !isset(CASEMATCH)) +- pcre_opts |= PCRE_CASELESS; ++ pcre_opts |= PCRE2_CASELESS; + + lhstr = cond_str(a,0,0); + rhre = cond_str(a,1,0); +@@ -401,9 +365,6 @@ cond_pcre_match(char **a, int id) + rhre_plain = ztrdup(rhre); + unmetafy(lhstr_plain, &lhstr_plain_len); + unmetafy(rhre_plain, &rhre_plain_len); +- pcre_pat = NULL; +- ov = NULL; +- ovsize = 0; + + if (isset(BASHREMATCH)) { + svar = NULL; +@@ -415,27 +376,27 @@ cond_pcre_match(char **a, int id) + + switch(id) { + case CPCRE_PLAIN: +- if ((int)strlen(rhre_plain) != rhre_plain_len) { +- zwarn("embedded NULs in PCRE pattern terminate pattern"); +- } +- pcre_pat = pcre_compile(rhre_plain, pcre_opts, &pcre_err, &pcre_errptr, NULL); +- if (pcre_pat == NULL) { +- zwarn("failed to compile regexp /%s/: %s", rhre, pcre_err); ++ if (!(pcre_pat = pcre2_compile((PCRE2_SPTR) rhre_plain, ++ (PCRE2_SIZE) rhre_plain_len, pcre_opts, ++ &pcre_err, &pcre_erroff, NULL))) ++ { ++ PCRE2_UCHAR buffer[256]; ++ pcre2_get_error_message(pcre_err, buffer, sizeof(buffer)); ++ zwarn("failed to compile regexp /%s/: %s", rhre, buffer); + break; + } +- pcre_fullinfo(pcre_pat, NULL, PCRE_INFO_CAPTURECOUNT, &capcnt); +- ovsize = (capcnt+1)*3; +- ov = zalloc(ovsize*sizeof(int)); +- r = pcre_exec(pcre_pat, NULL, lhstr_plain, lhstr_plain_len, 0, 0, ov, ovsize); +- /* r < 0 => error; r==0 match but not enough size in ov ++ pcre_mdata = pcre2_match_data_create_from_pattern(pcre_pat, NULL); ++ r = pcre2_match(pcre_pat, (PCRE2_SPTR8) lhstr_plain, lhstr_plain_len, ++ 0, 0, pcre_mdata, NULL); ++ /* r < 0 => error; r==0 match but not enough size in match data + * r > 0 => (r-1) substrings found; r==1 => no substrings + */ + if (r==0) { +- zwarn("reportable zsh problem: pcre_exec() returned 0"); ++ zwarn("reportable zsh problem: pcre2_match() returned 0"); + return_value = 1; + break; + } +- else if (r==PCRE_ERROR_NOMATCH) { ++ else if (r == PCRE2_ERROR_NOMATCH) { + return_value = 0; /* no match */ + break; + } +@@ -444,7 +405,7 @@ cond_pcre_match(char **a, int id) + break; + } + else if (r>0) { +- zpcre_get_substrings(lhstr_plain, ov, r, svar, avar, 0, ++ zpcre_get_substrings(lhstr_plain, pcre_mdata, r, svar, avar, 0, + isset(BASHREMATCH), + !isset(BASHREMATCH)); + return_value = 1; +@@ -457,10 +418,10 @@ cond_pcre_match(char **a, int id) + free(lhstr_plain); + if(rhre_plain) + free(rhre_plain); ++ if (pcre_mdata) ++ pcre2_match_data_free(pcre_mdata); + if (pcre_pat) +- pcre_free(pcre_pat); +- if (ov) +- zfree(ov, ovsize*sizeof(int)); ++ pcre2_code_free(pcre_pat); + + return return_value; + } +@@ -489,11 +450,11 @@ static struct builtin bintab[] = { + + static struct features module_features = { + bintab, sizeof(bintab)/sizeof(*bintab), +-#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC) ++#if defined(HAVE_PCRE2_COMPILE_8) && defined(HAVE_PCRE2_H) + cotab, sizeof(cotab)/sizeof(*cotab), +-#else /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */ ++#else /* !(HAVE_PCRE2_COMPILE_8 && HAVE_PCRE2_H) */ + NULL, 0, +-#endif /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */ ++#endif /* !(HAVE_PCRE2_COMPILE_8 && HAVE_PCRE2_H) */ + NULL, 0, + NULL, 0, + 0 +@@ -540,19 +501,9 @@ cleanup_(Module m) + int + finish_(UNUSED(Module m)) + { +-#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC) +-#ifdef HAVE_PCRE_STUDY +- if (pcre_hints) +-#ifdef PCRE_CONFIG_JIT +- pcre_free_study(pcre_hints); +-#else +- pcre_free(pcre_hints); +-#endif +- pcre_hints = NULL; +-#endif +- ++#if defined(HAVE_PCRE2_COMPILE_8) && defined(HAVE_PCRE2_H) + if (pcre_pattern) +- pcre_free(pcre_pattern); ++ pcre2_code_free(pcre_pattern); + pcre_pattern = NULL; + #endif + +diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst +index 22a0b64c7..6eb366964 100644 +--- a/Test/V07pcre.ztst ++++ b/Test/V07pcre.ztst +@@ -117,12 +117,17 @@ + >78884; ZPCRE_OP: 25 30 + >90210; ZPCRE_OP: 31 36 + +-# Embedded NULs allowed in plaintext, but not in RE (although \0 as two-chars allowed) ++# Embedded NULs allowed in plaintext, in RE, pcre supports \0 as two-chars + [[ $'a\0bc\0d' =~ '^(a\0.)(.+)$' ]] + print "${#MATCH}; ${#match[1]}; ${#match[2]}" + 0:ensure ASCII NUL passes in and out of matched plaintext + >6; 3; 3 + ++# PCRE2 supports NULs also in the RE ++ [[ $'a\0b\0c' =~ $'^(.\0)+' ]] && print "${#MATCH}; ${#match[1]}" ++0:ensure ASCII NUL works also in the regex ++>4; 2 ++ + # Ensure the long-form infix operator works + [[ foo -pcre-match ^f..$ ]] + print $? +@@ -169,7 +174,11 @@ + [[ é =~ '^..\z' ]]; echo $? + LANG=$LANG_SAVE + [[ é =~ '^.\z' ]]; echo $? +-0:swich between C/UTF-8 locales ++0:switch between C/UTF-8 locales + >0 + >0 + >0 ++ ++ [[ abc =~ 'a(d*)bc' ]] && print "$#MATCH; $#match; ${#match[1]}" ++0:empty capture ++>3; 1; 0 +diff --git a/configure.ac b/configure.ac +index d8a17791a..4710d1659 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -438,7 +438,7 @@ fi], + + dnl Do you want to look for pcre support? + AC_ARG_ENABLE(pcre, +-AS_HELP_STRING([--enable-pcre],[enable the search for the pcre library (may create run-time library dependencies)])) ++AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library (may create run-time library dependencies)])) + + dnl Do you want to look for capability support? + AC_ARG_ENABLE(cap, +@@ -652,13 +652,12 @@ AC_HEADER_SYS_WAIT + + oldcflags="$CFLAGS" + if test x$enable_pcre = xyes; then +-AC_CHECK_PROG([PCRECONF], pcre-config, pcre-config) +-dnl Typically (meaning on this single RedHat 9 box in front of me) +-dnl pcre-config --cflags produces a -I output which needs to go into ++AC_CHECK_PROG([PCRECONF], pcre2-config, pcre2-config) ++dnl pcre2-config --cflags may produce a -I output which needs to go into + dnl CPPFLAGS else configure's preprocessor tests don't pick it up, + dnl producing a warning. +-if test "x$ac_cv_prog_PCRECONF" = xpcre-config; then +- CPPFLAGS="$CPPFLAGS `pcre-config --cflags`" ++if test "x$ac_cv_prog_PCRECONF" = xpcre2-config; then ++ CPPFLAGS="$CPPFLAGS `pcre2-config --cflags`" + fi + fi + +@@ -668,9 +667,10 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \ + locale.h errno.h stdio.h stdarg.h varargs.h stdlib.h \ + unistd.h sys/capability.h \ + utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \ +- netinet/in_systm.h pcre.h langinfo.h wchar.h stddef.h \ ++ netinet/in_systm.h langinfo.h wchar.h stddef.h \ + sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \ + ncurses/ncurses.h) ++AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8]) + if test x$dynamic = xyes; then + AC_CHECK_HEADERS(dlfcn.h) + AC_CHECK_HEADERS(dl.h) +@@ -948,9 +948,7 @@ if test "x$ac_found_iconv" = "xyes"; then + fi + + if test x$enable_pcre = xyes; then +-dnl pcre-config should probably be employed here +-dnl AC_SEARCH_LIBS(pcre_compile, pcre) +- LIBS="`$ac_cv_prog_PCRECONF --libs` $LIBS" ++ LIBS="`$ac_cv_prog_PCRECONF --libs8` $LIBS" + fi + + dnl --------------------- +@@ -1313,7 +1311,7 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \ + pathconf sysconf \ + tgetent tigetflag tigetnum tigetstr setupterm initscr resize_term \ + getcchar setcchar waddwstr wget_wch win_wch use_default_colors \ +- pcre_compile pcre_study pcre_exec \ ++ pcre2_compile_8 \ + nl_langinfo \ + erand48 open_memstream \ + posix_openpt \ +-- +2.41.0 + + +From f3f371deb376478176866fd770fbcf9bc0d0609f Mon Sep 17 00:00:00 2001 +From: Oliver Kiddle +Date: Sat, 13 May 2023 00:56:48 +0200 +Subject: [PATCH 2/3] 51728: assign pcre named capture groups to a hash + +--- + Doc/Zsh/mod_pcre.yo | 10 ++++++---- + Src/Modules/pcre.c | 43 +++++++++++++++++++++++++++++++++---------- + Test/V07pcre.ztst | 14 ++++++++++++++ + 3 files changed, 53 insertions(+), 14 deletions(-) + +diff --git a/Doc/Zsh/mod_pcre.yo b/Doc/Zsh/mod_pcre.yo +index c2817f519..6d073985d 100644 +--- a/Doc/Zsh/mod_pcre.yo ++++ b/Doc/Zsh/mod_pcre.yo +@@ -20,12 +20,12 @@ including those that indicate newline. + ) + findex(pcre_study) + item(tt(pcre_study))( +-Studies the previously-compiled PCRE which may result in faster +-matching. ++Requests JIT compilation for the previously-compiled PCRE which ++may result in faster matching. + ) + findex(pcre_match) + item(tt(pcre_match) [ tt(-v) var(var) ] [ tt(-a) var(arr) ] \ +-[ tt(-n) var(offset) ] [ tt(-b) ] var(string))( ++[ tt(-A) var(assoc) ] [ tt(-n) var(offset) ] [ tt(-b) ] var(string))( + Returns successfully if tt(string) matches the previously-compiled + PCRE. + +@@ -36,7 +36,9 @@ substrings, unless the tt(-a) option is given, in which + case it will set the array var(arr). Similarly, the variable + tt(MATCH) will be set to the entire matched portion of the + string, unless the tt(-v) option is given, in which case the variable +-var(var) will be set. ++var(var) will be set. Furthermore, any named captures will ++be stored in the associative array tt(.pcre.match) unless an ++alternative is given with tt(-A). + No variables are altered if there is no successful match. + A tt(-n) option starts searching for a match from the + byte var(offset) position in var(string). If the tt(-b) option is given, +diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c +index 079ecc2c5..6be1f76e2 100644 +--- a/Src/Modules/pcre.c ++++ b/Src/Modules/pcre.c +@@ -129,14 +129,17 @@ bin_pcre_study(char *nam, UNUSED(char **args), UNUSED(Options ops), UNUSED(int f + } + + static int +-zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count, +- char *matchvar, char *substravar, int want_offset_pair, +- int matchedinarr, int want_begin_end) ++zpcre_get_substrings(pcre2_code *pat, char *arg, pcre2_match_data *mdata, ++ int captured_count, char *matchvar, char *substravar, char *namedassoc, ++ int want_offset_pair, int matchedinarr, int want_begin_end) + { + PCRE2_SIZE *ovec; + char *match_all, **matches; + char offset_all[50]; + int capture_start = 1; ++ int vec_off; ++ PCRE2_SPTR ntable; /* table of named captures */ ++ uint32_t ncount, nsize; + + if (matchedinarr) { + /* bash-style ovec[0] entire-matched string in the array */ +@@ -174,7 +177,7 @@ zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count, + if (substravar && + (!want_begin_end || nelem)) { + char **x; +- int vec_off, i; ++ int i; + matches = x = (char **) zalloc(sizeof(char *) * (captured_count+1-capture_start)); + for (i = capture_start; i < captured_count; i++) { + vec_off = 2*i; +@@ -184,6 +187,23 @@ zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count, + setaparam(substravar, matches); + } + ++ if (!pcre2_pattern_info(pat, PCRE2_INFO_NAMECOUNT, &ncount) && ncount ++ && !pcre2_pattern_info(pat, PCRE2_INFO_NAMEENTRYSIZE, &nsize) ++ && !pcre2_pattern_info(pat, PCRE2_INFO_NAMETABLE, &ntable)) ++ { ++ char **hash, **hashptr; ++ uint32_t nidx; ++ hashptr = hash = (char **)zshcalloc((ncount+1)*2*sizeof(char *)); ++ for (nidx = 0; nidx < ncount; nidx++) { ++ vec_off = (ntable[nsize * nidx] << 9) + 2 * ntable[nsize * nidx + 1]; ++ /* would metafy the key but pcre limits characters in the name */ ++ *hashptr++ = ztrdup((char *) ntable + nsize * nidx + 2); ++ *hashptr++ = metafy(arg + ovec[vec_off], ++ ovec[vec_off+1]-ovec[vec_off], META_DUP); ++ } ++ sethparam(namedassoc, hash); ++ } ++ + if (want_begin_end) { + /* + * cond-infix rather than builtin; also not bash; so we set a bunch +@@ -286,6 +306,7 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) + char *matched_portion = NULL; + char *plaintext = NULL; + char *receptacle = NULL; ++ char *named = ".pcre.match"; + int return_value = 1; + /* The subject length and offset start are both int values in pcre_exec */ + int subject_len; +@@ -305,6 +326,9 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) + if(OPT_HASARG(ops,c='v')) { + matched_portion = OPT_ARG(ops,c); + } ++ if (OPT_HASARG(ops, c='A')) { ++ named = OPT_ARG(ops, c); ++ } + if(OPT_HASARG(ops,c='n')) { /* The offset position to start the search, in bytes. */ + if ((offset_start = getposint(OPT_ARG(ops,c), nam)) < 0) + return 1; +@@ -326,8 +350,8 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) + if (ret==0) return_value = 0; + else if (ret == PCRE2_ERROR_NOMATCH) /* no match */; + else if (ret>0) { +- zpcre_get_substrings(plaintext, pcre_mdata, ret, matched_portion, receptacle, +- want_offset_pair, 0, 0); ++ zpcre_get_substrings(pcre_pattern, plaintext, pcre_mdata, ret, matched_portion, ++ receptacle, named, want_offset_pair, 0, 0); + return_value = 0; + } + else { +@@ -405,9 +429,8 @@ cond_pcre_match(char **a, int id) + break; + } + else if (r>0) { +- zpcre_get_substrings(lhstr_plain, pcre_mdata, r, svar, avar, 0, +- isset(BASHREMATCH), +- !isset(BASHREMATCH)); ++ zpcre_get_substrings(pcre_pat, lhstr_plain, pcre_mdata, r, svar, avar, ++ ".pcre.match", 0, isset(BASHREMATCH), !isset(BASHREMATCH)); + return_value = 1; + break; + } +@@ -443,7 +466,7 @@ static struct conddef cotab[] = { + + static struct builtin bintab[] = { + BUILTIN("pcre_compile", 0, bin_pcre_compile, 1, 1, 0, "aimxs", NULL), +- BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "a:v:n:b", NULL), ++ BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "A:a:v:n:b", NULL), + BUILTIN("pcre_study", 0, bin_pcre_study, 0, 0, 0, NULL, NULL) + }; + +diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst +index 6eb366964..027fea3aa 100644 +--- a/Test/V07pcre.ztst ++++ b/Test/V07pcre.ztst +@@ -182,3 +182,17 @@ + [[ abc =~ 'a(d*)bc' ]] && print "$#MATCH; $#match; ${#match[1]}" + 0:empty capture + >3; 1; 0 ++ ++ [[ category/name-12345 =~ '(?x)^ ++ (? [^/]* ) / ++ (? ++ (? \w+ ) - ++ (? \d+ ))$' ]] ++ typeset -p1 .pcre.match ++0:named captures ++>typeset -g -A .pcre.match=( ++> [category]=category ++> [name]=name ++> [package]=name-12345 ++> [version]=12345 ++>) +-- +2.41.0 + + +From b4d1c756f50909b4a13e5c8fe5f26f71e9d54f63 Mon Sep 17 00:00:00 2001 +From: Oliver Kiddle +Date: Sat, 13 May 2023 00:59:00 +0200 +Subject: [PATCH 3/3] 51738: support pcre's alternative DFA matching algorithm + +--- + Doc/Zsh/mod_pcre.yo | 6 ++++- + Src/Modules/pcre.c | 53 ++++++++++++++++++++++++++++++--------------- + Test/V07pcre.ztst | 5 +++++ + 3 files changed, 46 insertions(+), 18 deletions(-) + +diff --git a/Doc/Zsh/mod_pcre.yo b/Doc/Zsh/mod_pcre.yo +index 6d073985d..da73ac85a 100644 +--- a/Doc/Zsh/mod_pcre.yo ++++ b/Doc/Zsh/mod_pcre.yo +@@ -25,7 +25,7 @@ may result in faster matching. + ) + findex(pcre_match) + item(tt(pcre_match) [ tt(-v) var(var) ] [ tt(-a) var(arr) ] \ +-[ tt(-A) var(assoc) ] [ tt(-n) var(offset) ] [ tt(-b) ] var(string))( ++[ tt(-A) var(assoc) ] [ tt(-n) var(offset) ] [ tt(-bd) ] var(string))( + Returns successfully if tt(string) matches the previously-compiled + PCRE. + +@@ -69,6 +69,10 @@ print -l $accum) + ) + enditem() + ++The option tt(-d) uses the alternative breadth-first DFA search algorithm of ++pcre. This sets tt(match), or the array given with tt(-a), to all the matches ++found from the same start point in the subject. ++ + The tt(zsh/pcre) module makes available the following test condition: + + startitem() +diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c +index 6be1f76e2..96f3c6e65 100644 +--- a/Src/Modules/pcre.c ++++ b/Src/Modules/pcre.c +@@ -305,30 +305,29 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) + pcre2_match_data *pcre_mdata = NULL; + char *matched_portion = NULL; + char *plaintext = NULL; +- char *receptacle = NULL; +- char *named = ".pcre.match"; ++ char *receptacle; ++ char *named = NULL; + int return_value = 1; + /* The subject length and offset start are both int values in pcre_exec */ + int subject_len; + int offset_start = 0; + int want_offset_pair = 0; ++ int use_dfa = 0; + + if (pcre_pattern == NULL) { + zwarnnam(nam, "no pattern has been compiled"); + return 1; + } + +- matched_portion = "MATCH"; +- receptacle = "match"; +- if(OPT_HASARG(ops,c='a')) { +- receptacle = OPT_ARG(ops,c); +- } +- if(OPT_HASARG(ops,c='v')) { +- matched_portion = OPT_ARG(ops,c); +- } +- if (OPT_HASARG(ops, c='A')) { +- named = OPT_ARG(ops, c); ++ if (!(use_dfa = OPT_ISSET(ops, 'd'))) { ++ matched_portion = OPT_HASARG(ops, c='v') ? OPT_ARG(ops, c) : "MATCH"; ++ named = OPT_HASARG(ops, c='A') ? OPT_ARG(ops, c) : ".pcre.match"; ++ } else if (OPT_HASARG(ops, c='v') || OPT_HASARG(ops, c='A')) { ++ zwarnnam(nam, "-d cannot be combined with -%c", c); ++ return 1; + } ++ receptacle = OPT_HASARG(ops, 'a') ? OPT_ARG(ops, 'a') : "match"; ++ + if(OPT_HASARG(ops,c='n')) { /* The offset position to start the search, in bytes. */ + if ((offset_start = getposint(OPT_ARG(ops,c), nam)) < 0) + return 1; +@@ -341,7 +340,25 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) + + if (offset_start > 0 && offset_start >= subject_len) + ret = PCRE2_ERROR_NOMATCH; +- else { ++ else if (use_dfa) { ++ PCRE2_SIZE old, wscount = 128, capcount = 128; ++ void *workspace = zhalloc(sizeof(int) * wscount); ++ pcre_mdata = pcre2_match_data_create(capcount, NULL); ++ do { ++ ret = pcre2_dfa_match(pcre_pattern, (PCRE2_SPTR) plaintext, subject_len, ++ offset_start, 0, pcre_mdata, NULL, (int *) workspace, wscount); ++ if (ret == PCRE2_ERROR_DFA_WSSIZE) { ++ old = wscount; ++ wscount += wscount / 2; ++ workspace = hrealloc(workspace, sizeof(int) * old, sizeof(int) * wscount); ++ } else if (ret == 0) { ++ capcount += capcount / 2; ++ pcre2_match_data_free(pcre_mdata); ++ pcre_mdata = pcre2_match_data_create(capcount, NULL); ++ } else ++ break; ++ } while(1); ++ } else { + pcre_mdata = pcre2_match_data_create_from_pattern(pcre_pattern, NULL); + ret = pcre2_match(pcre_pattern, (PCRE2_SPTR) plaintext, subject_len, + offset_start, 0, pcre_mdata, NULL); +@@ -350,12 +367,14 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) + if (ret==0) return_value = 0; + else if (ret == PCRE2_ERROR_NOMATCH) /* no match */; + else if (ret>0) { +- zpcre_get_substrings(pcre_pattern, plaintext, pcre_mdata, ret, matched_portion, +- receptacle, named, want_offset_pair, 0, 0); ++ zpcre_get_substrings(pcre_pattern, plaintext, pcre_mdata, ret, ++ matched_portion, receptacle, named, want_offset_pair, use_dfa, 0); + return_value = 0; + } + else { +- zwarnnam(nam, "error in pcre2_match [%d]", ret); ++ PCRE2_UCHAR buffer[256]; ++ pcre2_get_error_message(ret, buffer, sizeof(buffer)); ++ zwarnnam(nam, "error in pcre matching for /%s/: %s", plaintext, buffer); + } + + if (pcre_mdata) +@@ -466,7 +485,7 @@ static struct conddef cotab[] = { + + static struct builtin bintab[] = { + BUILTIN("pcre_compile", 0, bin_pcre_compile, 1, 1, 0, "aimxs", NULL), +- BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "A:a:v:n:b", NULL), ++ BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "A:a:v:n:bd", NULL), + BUILTIN("pcre_study", 0, bin_pcre_study, 0, 0, 0, NULL, NULL) + }; + +diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst +index 027fea3aa..585698d05 100644 +--- a/Test/V07pcre.ztst ++++ b/Test/V07pcre.ztst +@@ -196,3 +196,8 @@ + > [package]=name-12345 + > [version]=12345 + >) ++ ++ pcre_compile 'cat(er(pillar)?)?' ++ pcre_match -d 'the caterpillar catchment' && print $match ++0:pcre_match -d ++>caterpillar cater cat +-- +2.41.0 + diff --git a/zsh.spec b/zsh.spec index 1e031c0..ebb19d9 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 8%{?dist} +Release: 9%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -19,6 +19,10 @@ Patch1: 0001-zsh-5.9-do-not-use-egrep-in-tests.patch Patch2: 0002-zsh-Use-int-main-in-test-c-codes.patch # upstream commit a84fdd7c8f77935ecce99ff2b0bdba738821ed79 Patch3: 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch +# upstream commit 1b421e4978440234fb73117c8505dad1ccc68d46 +Patch4: 0004-zsh-enable-PCRE-locale-switching.patch +# upstream commits b62e911341c8ec7446378b477c47da4256053dc0...b4d1c756f50909b4a13e5c8fe5f26f71e9d54f63 +Patch5: 0005-zsh-port-to-pcre2.patch BuildRequires: autoconf BuildRequires: coreutils @@ -29,7 +33,7 @@ BuildRequires: glibc-langpack-ja BuildRequires: libcap-devel BuildRequires: make BuildRequires: ncurses-devel -BuildRequires: pcre-devel +BuildRequires: pcre2-devel BuildRequires: sed BuildRequires: texi2html BuildRequires: texinfo @@ -164,6 +168,9 @@ fi %doc Doc/*.html %changelog +* Mon Aug 21 2023 Lukáš Zaoral - 5.9-9 +- port to PCRE 2 (rhbz#1938979) + * Sat Jul 22 2023 Fedora Release Engineering - 5.9-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 47d6eba90a8aaaaa4af3a89d98a488171f0efc1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Tue, 21 Nov 2023 18:40:21 +0100 Subject: [PATCH 57/74] fix FTBFS caused by texinfo 7.1 - fix build of the PCRE module --- 0005-zsh-port-to-pcre2.patch | 414 +++++++---------------------- 0006-zsh-support-texinfo-7.0.patch | 53 ++++ zsh.spec | 12 +- 3 files changed, 158 insertions(+), 321 deletions(-) create mode 100644 0006-zsh-support-texinfo-7.0.patch diff --git a/0005-zsh-port-to-pcre2.patch b/0005-zsh-port-to-pcre2.patch index 6c1a2c0..fd8ea0e 100644 --- a/0005-zsh-port-to-pcre2.patch +++ b/0005-zsh-port-to-pcre2.patch @@ -1,8 +1,9 @@ From b62e911341c8ec7446378b477c47da4256053dc0 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 13 May 2023 00:53:32 +0200 -Subject: [PATCH 1/3] 51723: migrate pcre module to pcre2 +Subject: [PATCH] 51723: migrate pcre module to pcre2 + Cherry-picked-by: Lukáš Zaoral --- Src/Modules/pcre.c | 223 ++++++++++++++++++--------------------------- Test/V07pcre.ztst | 13 ++- @@ -533,331 +534,108 @@ index d8a17791a..4710d1659 100644 -- 2.41.0 +From 10bdbd8b5b0b43445aff23dcd412f25cf6aa328a Mon Sep 17 00:00:00 2001 +From: Jun-ichi Takimoto +Date: Tue, 20 Jun 2023 18:14:27 +0900 +Subject: [PATCH] 51877: do not build pcre module if pcre2-config is not found -From f3f371deb376478176866fd770fbcf9bc0d0609f Mon Sep 17 00:00:00 2001 -From: Oliver Kiddle -Date: Sat, 13 May 2023 00:56:48 +0200 -Subject: [PATCH 2/3] 51728: assign pcre named capture groups to a hash - + Cherry-picked-by: Lukáš Zaoral --- - Doc/Zsh/mod_pcre.yo | 10 ++++++---- - Src/Modules/pcre.c | 43 +++++++++++++++++++++++++++++++++---------- - Test/V07pcre.ztst | 14 ++++++++++++++ - 3 files changed, 53 insertions(+), 14 deletions(-) + Src/Modules/pcre.mdd | 2 +- + configure.ac | 31 +++++++++++++++++++------------ + 2 files changed, 20 insertions(+), 13 deletions(-) -diff --git a/Doc/Zsh/mod_pcre.yo b/Doc/Zsh/mod_pcre.yo -index c2817f519..6d073985d 100644 ---- a/Doc/Zsh/mod_pcre.yo -+++ b/Doc/Zsh/mod_pcre.yo -@@ -20,12 +20,12 @@ including those that indicate newline. - ) - findex(pcre_study) - item(tt(pcre_study))( --Studies the previously-compiled PCRE which may result in faster --matching. -+Requests JIT compilation for the previously-compiled PCRE which -+may result in faster matching. - ) - findex(pcre_match) - item(tt(pcre_match) [ tt(-v) var(var) ] [ tt(-a) var(arr) ] \ --[ tt(-n) var(offset) ] [ tt(-b) ] var(string))( -+[ tt(-A) var(assoc) ] [ tt(-n) var(offset) ] [ tt(-b) ] var(string))( - Returns successfully if tt(string) matches the previously-compiled - PCRE. +diff --git a/Src/Modules/pcre.mdd b/Src/Modules/pcre.mdd +index 6eb3c691b..3e1579117 100644 +--- a/Src/Modules/pcre.mdd ++++ b/Src/Modules/pcre.mdd +@@ -1,5 +1,5 @@ + name=zsh/pcre +-link=`if test x$enable_pcre = xyes && (pcre-config --version >/dev/null 2>/dev/null); then echo dynamic; else echo no; fi` ++link=`if test x$enable_pcre = xyes; then echo dynamic; else echo no; fi` + load=no -@@ -36,7 +36,9 @@ substrings, unless the tt(-a) option is given, in which - case it will set the array var(arr). Similarly, the variable - tt(MATCH) will be set to the entire matched portion of the - string, unless the tt(-v) option is given, in which case the variable --var(var) will be set. -+var(var) will be set. Furthermore, any named captures will -+be stored in the associative array tt(.pcre.match) unless an -+alternative is given with tt(-A). - No variables are altered if there is no successful match. - A tt(-n) option starts searching for a match from the - byte var(offset) position in var(string). If the tt(-b) option is given, -diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c -index 079ecc2c5..6be1f76e2 100644 ---- a/Src/Modules/pcre.c -+++ b/Src/Modules/pcre.c -@@ -129,14 +129,17 @@ bin_pcre_study(char *nam, UNUSED(char **args), UNUSED(Options ops), UNUSED(int f - } + autofeatures="b:pcre_compile b:pcre_study b:pcre_match" +diff --git a/configure.ac b/configure.ac +index ba76f9a60..c5263035e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -440,6 +440,17 @@ dnl Do you want to look for pcre support? + AC_ARG_ENABLE(pcre, + AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library (may create run-time library dependencies)])) - static int --zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count, -- char *matchvar, char *substravar, int want_offset_pair, -- int matchedinarr, int want_begin_end) -+zpcre_get_substrings(pcre2_code *pat, char *arg, pcre2_match_data *mdata, -+ int captured_count, char *matchvar, char *substravar, char *namedassoc, -+ int want_offset_pair, int matchedinarr, int want_begin_end) - { - PCRE2_SIZE *ovec; - char *match_all, **matches; - char offset_all[50]; - int capture_start = 1; -+ int vec_off; -+ PCRE2_SPTR ntable; /* table of named captures */ -+ uint32_t ncount, nsize; - - if (matchedinarr) { - /* bash-style ovec[0] entire-matched string in the array */ -@@ -174,7 +177,7 @@ zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count, - if (substravar && - (!want_begin_end || nelem)) { - char **x; -- int vec_off, i; -+ int i; - matches = x = (char **) zalloc(sizeof(char *) * (captured_count+1-capture_start)); - for (i = capture_start; i < captured_count; i++) { - vec_off = 2*i; -@@ -184,6 +187,23 @@ zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count, - setaparam(substravar, matches); - } - -+ if (!pcre2_pattern_info(pat, PCRE2_INFO_NAMECOUNT, &ncount) && ncount -+ && !pcre2_pattern_info(pat, PCRE2_INFO_NAMEENTRYSIZE, &nsize) -+ && !pcre2_pattern_info(pat, PCRE2_INFO_NAMETABLE, &ntable)) -+ { -+ char **hash, **hashptr; -+ uint32_t nidx; -+ hashptr = hash = (char **)zshcalloc((ncount+1)*2*sizeof(char *)); -+ for (nidx = 0; nidx < ncount; nidx++) { -+ vec_off = (ntable[nsize * nidx] << 9) + 2 * ntable[nsize * nidx + 1]; -+ /* would metafy the key but pcre limits characters in the name */ -+ *hashptr++ = ztrdup((char *) ntable + nsize * nidx + 2); -+ *hashptr++ = metafy(arg + ovec[vec_off], -+ ovec[vec_off+1]-ovec[vec_off], META_DUP); -+ } -+ sethparam(namedassoc, hash); -+ } ++AC_ARG_VAR(PCRE_CONFIG, [pathname of pcre2-config if it is not in PATH]) ++if test "x$enable_pcre" = xyes; then ++ AC_CHECK_PROG([PCRE_CONFIG], pcre2-config, pcre2-config) ++ if test "x$PCRE_CONFIG" = x; then ++ enable_pcre=no ++ AC_MSG_WARN([pcre2-config not found: pcre module is disabled.]) ++ AC_MSG_NOTICE( ++ [Set PCRE_CONFIG to pathname of pcre2-config if it is not in PATH.]) ++ fi ++fi + - if (want_begin_end) { - /* - * cond-infix rather than builtin; also not bash; so we set a bunch -@@ -286,6 +306,7 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) - char *matched_portion = NULL; - char *plaintext = NULL; - char *receptacle = NULL; -+ char *named = ".pcre.match"; - int return_value = 1; - /* The subject length and offset start are both int values in pcre_exec */ - int subject_len; -@@ -305,6 +326,9 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) - if(OPT_HASARG(ops,c='v')) { - matched_portion = OPT_ARG(ops,c); - } -+ if (OPT_HASARG(ops, c='A')) { -+ named = OPT_ARG(ops, c); -+ } - if(OPT_HASARG(ops,c='n')) { /* The offset position to start the search, in bytes. */ - if ((offset_start = getposint(OPT_ARG(ops,c), nam)) < 0) - return 1; -@@ -326,8 +350,8 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) - if (ret==0) return_value = 0; - else if (ret == PCRE2_ERROR_NOMATCH) /* no match */; - else if (ret>0) { -- zpcre_get_substrings(plaintext, pcre_mdata, ret, matched_portion, receptacle, -- want_offset_pair, 0, 0); -+ zpcre_get_substrings(pcre_pattern, plaintext, pcre_mdata, ret, matched_portion, -+ receptacle, named, want_offset_pair, 0, 0); - return_value = 0; - } - else { -@@ -405,9 +429,8 @@ cond_pcre_match(char **a, int id) - break; - } - else if (r>0) { -- zpcre_get_substrings(lhstr_plain, pcre_mdata, r, svar, avar, 0, -- isset(BASHREMATCH), -- !isset(BASHREMATCH)); -+ zpcre_get_substrings(pcre_pat, lhstr_plain, pcre_mdata, r, svar, avar, -+ ".pcre.match", 0, isset(BASHREMATCH), !isset(BASHREMATCH)); - return_value = 1; - break; - } -@@ -443,7 +466,7 @@ static struct conddef cotab[] = { + dnl Do you want to look for capability support? + AC_ARG_ENABLE(cap, + AS_HELP_STRING([--enable-cap],[enable the search for POSIX capabilities (may require additional headers to be added by hand)])) +@@ -655,15 +666,12 @@ AC_HEADER_DIRENT + AC_HEADER_STAT + AC_HEADER_SYS_WAIT - static struct builtin bintab[] = { - BUILTIN("pcre_compile", 0, bin_pcre_compile, 1, 1, 0, "aimxs", NULL), -- BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "a:v:n:b", NULL), -+ BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "A:a:v:n:b", NULL), - BUILTIN("pcre_study", 0, bin_pcre_study, 0, 0, 0, NULL, NULL) - }; +-oldcflags="$CFLAGS" +-if test x$enable_pcre = xyes; then +-AC_CHECK_PROG([PCRECONF], pcre2-config, pcre2-config) + dnl pcre2-config --cflags may produce a -I output which needs to go into + dnl CPPFLAGS else configure's preprocessor tests don't pick it up, + dnl producing a warning. +-if test "x$ac_cv_prog_PCRECONF" = xpcre2-config; then +- CPPFLAGS="$CPPFLAGS `pcre2-config --cflags`" +-fi ++if test "x$enable_pcre" = xyes; then ++ CPPFLAGS="`$PCRE_CONFIG --cflags` $CPPFLAGS" ++ AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8]) + fi -diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst -index 6eb366964..027fea3aa 100644 ---- a/Test/V07pcre.ztst -+++ b/Test/V07pcre.ztst -@@ -182,3 +182,17 @@ - [[ abc =~ 'a(d*)bc' ]] && print "$#MATCH; $#match; ${#match[1]}" - 0:empty capture - >3; 1; 0 + AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \ +@@ -675,7 +683,6 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \ + netinet/in_systm.h langinfo.h wchar.h stddef.h \ + sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \ + ncurses/ncurses.h) +-AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8]) + if test x$dynamic = xyes; then + AC_CHECK_HEADERS(dlfcn.h) + AC_CHECK_HEADERS(dl.h) +@@ -952,10 +959,6 @@ if test "x$ac_found_iconv" = "xyes"; then + [Define as const if the declaration of iconv() needs const.]) + fi + +-if test x$enable_pcre = xyes; then +- LIBS="`$ac_cv_prog_PCRECONF --libs8` $LIBS" +-fi +- + dnl --------------------- + dnl CHECK TERMCAP LIBRARY + dnl --------------------- +@@ -1316,7 +1319,6 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \ + pathconf sysconf \ + tgetent tigetflag tigetnum tigetstr setupterm initscr resize_term \ + getcchar setcchar waddwstr wget_wch win_wch use_default_colors \ +- pcre2_compile_8 \ + nl_langinfo \ + erand48 open_memstream \ + posix_openpt \ +@@ -1371,6 +1373,11 @@ if test x$zsh_cv_func_realpath_accepts_null = xyes; then + AC_DEFINE(REALPATH_ACCEPTS_NULL) + fi + ++if test x$enable_pcre = xyes; then ++ LIBS="`$PCRE_CONFIG --libs8` $LIBS" ++ AC_CHECK_FUNCS(pcre2_compile_8) ++fi + -+ [[ category/name-12345 =~ '(?x)^ -+ (? [^/]* ) / -+ (? -+ (? \w+ ) - -+ (? \d+ ))$' ]] -+ typeset -p1 .pcre.match -+0:named captures -+>typeset -g -A .pcre.match=( -+> [category]=category -+> [name]=name -+> [package]=name-12345 -+> [version]=12345 -+>) + if test x$enable_cap = xyes; then + AC_CHECK_FUNCS(cap_get_proc) + fi -- -2.41.0 - - -From b4d1c756f50909b4a13e5c8fe5f26f71e9d54f63 Mon Sep 17 00:00:00 2001 -From: Oliver Kiddle -Date: Sat, 13 May 2023 00:59:00 +0200 -Subject: [PATCH 3/3] 51738: support pcre's alternative DFA matching algorithm - ---- - Doc/Zsh/mod_pcre.yo | 6 ++++- - Src/Modules/pcre.c | 53 ++++++++++++++++++++++++++++++--------------- - Test/V07pcre.ztst | 5 +++++ - 3 files changed, 46 insertions(+), 18 deletions(-) - -diff --git a/Doc/Zsh/mod_pcre.yo b/Doc/Zsh/mod_pcre.yo -index 6d073985d..da73ac85a 100644 ---- a/Doc/Zsh/mod_pcre.yo -+++ b/Doc/Zsh/mod_pcre.yo -@@ -25,7 +25,7 @@ may result in faster matching. - ) - findex(pcre_match) - item(tt(pcre_match) [ tt(-v) var(var) ] [ tt(-a) var(arr) ] \ --[ tt(-A) var(assoc) ] [ tt(-n) var(offset) ] [ tt(-b) ] var(string))( -+[ tt(-A) var(assoc) ] [ tt(-n) var(offset) ] [ tt(-bd) ] var(string))( - Returns successfully if tt(string) matches the previously-compiled - PCRE. - -@@ -69,6 +69,10 @@ print -l $accum) - ) - enditem() - -+The option tt(-d) uses the alternative breadth-first DFA search algorithm of -+pcre. This sets tt(match), or the array given with tt(-a), to all the matches -+found from the same start point in the subject. -+ - The tt(zsh/pcre) module makes available the following test condition: - - startitem() -diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c -index 6be1f76e2..96f3c6e65 100644 ---- a/Src/Modules/pcre.c -+++ b/Src/Modules/pcre.c -@@ -305,30 +305,29 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) - pcre2_match_data *pcre_mdata = NULL; - char *matched_portion = NULL; - char *plaintext = NULL; -- char *receptacle = NULL; -- char *named = ".pcre.match"; -+ char *receptacle; -+ char *named = NULL; - int return_value = 1; - /* The subject length and offset start are both int values in pcre_exec */ - int subject_len; - int offset_start = 0; - int want_offset_pair = 0; -+ int use_dfa = 0; - - if (pcre_pattern == NULL) { - zwarnnam(nam, "no pattern has been compiled"); - return 1; - } - -- matched_portion = "MATCH"; -- receptacle = "match"; -- if(OPT_HASARG(ops,c='a')) { -- receptacle = OPT_ARG(ops,c); -- } -- if(OPT_HASARG(ops,c='v')) { -- matched_portion = OPT_ARG(ops,c); -- } -- if (OPT_HASARG(ops, c='A')) { -- named = OPT_ARG(ops, c); -+ if (!(use_dfa = OPT_ISSET(ops, 'd'))) { -+ matched_portion = OPT_HASARG(ops, c='v') ? OPT_ARG(ops, c) : "MATCH"; -+ named = OPT_HASARG(ops, c='A') ? OPT_ARG(ops, c) : ".pcre.match"; -+ } else if (OPT_HASARG(ops, c='v') || OPT_HASARG(ops, c='A')) { -+ zwarnnam(nam, "-d cannot be combined with -%c", c); -+ return 1; - } -+ receptacle = OPT_HASARG(ops, 'a') ? OPT_ARG(ops, 'a') : "match"; -+ - if(OPT_HASARG(ops,c='n')) { /* The offset position to start the search, in bytes. */ - if ((offset_start = getposint(OPT_ARG(ops,c), nam)) < 0) - return 1; -@@ -341,7 +340,25 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) - - if (offset_start > 0 && offset_start >= subject_len) - ret = PCRE2_ERROR_NOMATCH; -- else { -+ else if (use_dfa) { -+ PCRE2_SIZE old, wscount = 128, capcount = 128; -+ void *workspace = zhalloc(sizeof(int) * wscount); -+ pcre_mdata = pcre2_match_data_create(capcount, NULL); -+ do { -+ ret = pcre2_dfa_match(pcre_pattern, (PCRE2_SPTR) plaintext, subject_len, -+ offset_start, 0, pcre_mdata, NULL, (int *) workspace, wscount); -+ if (ret == PCRE2_ERROR_DFA_WSSIZE) { -+ old = wscount; -+ wscount += wscount / 2; -+ workspace = hrealloc(workspace, sizeof(int) * old, sizeof(int) * wscount); -+ } else if (ret == 0) { -+ capcount += capcount / 2; -+ pcre2_match_data_free(pcre_mdata); -+ pcre_mdata = pcre2_match_data_create(capcount, NULL); -+ } else -+ break; -+ } while(1); -+ } else { - pcre_mdata = pcre2_match_data_create_from_pattern(pcre_pattern, NULL); - ret = pcre2_match(pcre_pattern, (PCRE2_SPTR) plaintext, subject_len, - offset_start, 0, pcre_mdata, NULL); -@@ -350,12 +367,14 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) - if (ret==0) return_value = 0; - else if (ret == PCRE2_ERROR_NOMATCH) /* no match */; - else if (ret>0) { -- zpcre_get_substrings(pcre_pattern, plaintext, pcre_mdata, ret, matched_portion, -- receptacle, named, want_offset_pair, 0, 0); -+ zpcre_get_substrings(pcre_pattern, plaintext, pcre_mdata, ret, -+ matched_portion, receptacle, named, want_offset_pair, use_dfa, 0); - return_value = 0; - } - else { -- zwarnnam(nam, "error in pcre2_match [%d]", ret); -+ PCRE2_UCHAR buffer[256]; -+ pcre2_get_error_message(ret, buffer, sizeof(buffer)); -+ zwarnnam(nam, "error in pcre matching for /%s/: %s", plaintext, buffer); - } - - if (pcre_mdata) -@@ -466,7 +485,7 @@ static struct conddef cotab[] = { - - static struct builtin bintab[] = { - BUILTIN("pcre_compile", 0, bin_pcre_compile, 1, 1, 0, "aimxs", NULL), -- BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "A:a:v:n:b", NULL), -+ BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "A:a:v:n:bd", NULL), - BUILTIN("pcre_study", 0, bin_pcre_study, 0, 0, 0, NULL, NULL) - }; - -diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst -index 027fea3aa..585698d05 100644 ---- a/Test/V07pcre.ztst -+++ b/Test/V07pcre.ztst -@@ -196,3 +196,8 @@ - > [package]=name-12345 - > [version]=12345 - >) -+ -+ pcre_compile 'cat(er(pillar)?)?' -+ pcre_match -d 'the caterpillar catchment' && print $match -+0:pcre_match -d -+>caterpillar cater cat --- -2.41.0 +2.42.0 diff --git a/0006-zsh-support-texinfo-7.0.patch b/0006-zsh-support-texinfo-7.0.patch new file mode 100644 index 0000000..c68bd26 --- /dev/null +++ b/0006-zsh-support-texinfo-7.0.patch @@ -0,0 +1,53 @@ +From ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 Mon Sep 17 00:00:00 2001 +From: Jun-ichi Takimoto +Date: Mon, 19 Jun 2023 11:19:25 +0900 +Subject: [PATCH] 51862: support texinfo-7.0 + +Upstream-commit: ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 +Cherry-picked-by: Lukáš Zaoral +--- + Doc/Makefile.in | 3 ++- + configure.ac | 5 +++++ + 2 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/Doc/Makefile.in b/Doc/Makefile.in +index 136b080d6..dabe11fe3 100644 +--- a/Doc/Makefile.in ++++ b/Doc/Makefile.in +@@ -43,6 +43,7 @@ TEXI2DVI = @TEXI2DVI@ + DVIPS = dvips + TEXI2PDF = @TEXI2PDF@ + TEXI2HTML = @TEXI2HTML@ ++SET_TEXI2ANY_VAR = @SET_TEXI2ANY_VAR@ + PAPERSIZE = @PAPERSIZE@ + + .SUFFIXES: .yo .1 +@@ -266,7 +267,7 @@ texi2html.conf: $(sdir_top)/Config/version.mk + d=`echo $(VERSION_DATE)`; \ + v="Zsh version $(VERSION), released on $$d."; \ + case '$(TEXI2HTML)' in \ +- *texi2any*) echo "set_from_init_file('PRE_BODY_CLOSE','$$v');" ;; \ ++ *texi2any*) echo "$(SET_TEXI2ANY_VAR)('PRE_BODY_CLOSE','$$v');" ;; \ + *) echo "\$$PRE_BODY_CLOSE = '$$v';" ;; \ + esac > $@ + +diff --git a/configure.ac b/configure.ac +index 4710d1659..ba76f9a60 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -623,7 +623,12 @@ fi + + if test x"$TEXI2HTML" = xtexi2any; then + TEXI2HTML='texi2any -c TEXI2HTML=1' ++ case `texi2any --version 2>/dev/null | sed -e 's/^.*) *//' -e 1q` in ++ [[1-6]].*) SET_TEXI2ANY_VAR=set_from_init_file ;; ++ *) SET_TEXI2ANY_VAR=texinfo_set_from_init_file ;; ++ esac + fi ++AC_SUBST(SET_TEXI2ANY_VAR) + + case "$LC_PAPER" in + ??_US*) PAPERSIZE=us ;; +-- +2.42.0 + diff --git a/zsh.spec b/zsh.spec index ebb19d9..6bd9360 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 9%{?dist} +Release: 10%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -19,10 +19,12 @@ Patch1: 0001-zsh-5.9-do-not-use-egrep-in-tests.patch Patch2: 0002-zsh-Use-int-main-in-test-c-codes.patch # upstream commit a84fdd7c8f77935ecce99ff2b0bdba738821ed79 Patch3: 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch -# upstream commit 1b421e4978440234fb73117c8505dad1ccc68d46 +# upstream commit 1b421e4978440234fb73117c8505dad1ccc68d46 Patch4: 0004-zsh-enable-PCRE-locale-switching.patch -# upstream commits b62e911341c8ec7446378b477c47da4256053dc0...b4d1c756f50909b4a13e5c8fe5f26f71e9d54f63 +# upstream commit b62e911341c8ec7446378b477c47da4256053dc0 and 10bdbd8b5b0b43445aff23dcd412f25cf6aa328a Patch5: 0005-zsh-port-to-pcre2.patch +# upstream commit ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 +Patch6: 0006-zsh-support-texinfo-7.0.patch BuildRequires: autoconf BuildRequires: coreutils @@ -168,6 +170,10 @@ fi %doc Doc/*.html %changelog +* Tue Nov 21 2023 Lukáš Zaoral - 5.9-10 +- fix FTBFS caused by texinfo 7.1 +- fix build of the PCRE module + * Mon Aug 21 2023 Lukáš Zaoral - 5.9-9 - port to PCRE 2 (rhbz#1938979) From 82b6281e8c2c5e61a9db8fc6510fc740e50c6be8 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Fri, 8 Dec 2023 21:54:47 +0100 Subject: [PATCH 58/74] Fix C compatibility issue in the configure script Related to: --- zsh-configure-c99.patch | 44 +++++++++++++++++++++++++++++++++++++++++ zsh.spec | 6 +++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 zsh-configure-c99.patch diff --git a/zsh-configure-c99.patch b/zsh-configure-c99.patch new file mode 100644 index 0000000..c4b3623 --- /dev/null +++ b/zsh-configure-c99.patch @@ -0,0 +1,44 @@ +Avoid incompatible pointer types in terminfo global variable checks. +Some compilers reject these incompatible pointer types, causing the +checks to always fail, when these variables are in fact available. + +Submitted upstream: + +diff --git a/configure.ac b/configure.ac +index a58242f453b4a8f3..5534f42df14eb28c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1769,27 +1769,27 @@ if test x$zsh_cv_path_term_header != xnone; then + fi + + AC_MSG_CHECKING(if boolcodes is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no]) + AC_MSG_RESULT($boolcodes) + + AC_MSG_CHECKING(if numcodes is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no]) + AC_MSG_RESULT($numcodes) + + AC_MSG_CHECKING(if strcodes is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no]) + AC_MSG_RESULT($strcodes) + + AC_MSG_CHECKING(if boolnames is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no]) + AC_MSG_RESULT($boolnames) + + AC_MSG_CHECKING(if numnames is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no]) + AC_MSG_RESULT($numnames) + + AC_MSG_CHECKING(if strnames is available) +- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no]) ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no]) + AC_MSG_RESULT($strnames) + + dnl There are apparently defective terminal library headers on some diff --git a/zsh.spec b/zsh.spec index 6bd9360..87d0a7f 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 10%{?dist} +Release: 11%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -25,6 +25,7 @@ Patch4: 0004-zsh-enable-PCRE-locale-switching.patch Patch5: 0005-zsh-port-to-pcre2.patch # upstream commit ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 Patch6: 0006-zsh-support-texinfo-7.0.patch +Patch7: zsh-configure-c99.patch BuildRequires: autoconf BuildRequires: coreutils @@ -170,6 +171,9 @@ fi %doc Doc/*.html %changelog +* Fri Dec 8 2023 Florian Weimer - 5.9-11 +- Fix C compatibility issue in the configure script + * Tue Nov 21 2023 Lukáš Zaoral - 5.9-10 - fix FTBFS caused by texinfo 7.1 - fix build of the PCRE module From 44214321eec6a906288820cc8e2b1be4b588df23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Wed, 17 Jan 2024 14:05:37 +0100 Subject: [PATCH 59/74] fix segfault in delerefilelist Resolves: rhbz#2245462 --- ...-c99.patch => 0007-zsh-configure-c99.patch | 0 0008-zsh-deletefilelist-segfault.patch | 42 +++++++++++++++++++ zsh.spec | 10 ++++- 3 files changed, 50 insertions(+), 2 deletions(-) rename zsh-configure-c99.patch => 0007-zsh-configure-c99.patch (100%) create mode 100644 0008-zsh-deletefilelist-segfault.patch diff --git a/zsh-configure-c99.patch b/0007-zsh-configure-c99.patch similarity index 100% rename from zsh-configure-c99.patch rename to 0007-zsh-configure-c99.patch diff --git a/0008-zsh-deletefilelist-segfault.patch b/0008-zsh-deletefilelist-segfault.patch new file mode 100644 index 0000000..8abaab1 --- /dev/null +++ b/0008-zsh-deletefilelist-segfault.patch @@ -0,0 +1,42 @@ +From d3edf318306e37d2d96c4e4ea442d10207722e94 Mon Sep 17 00:00:00 2001 +From: Bart Schaefer +Date: Sun, 12 Feb 2023 09:52:39 -0800 +Subject: [PATCH] 51404: Nullify filelist after deleting (fix segfault) + +Cherry-picked-by: Lukáš Zaoral +Upstream-commit: d3edf318306e37d2d96c4e4ea442d10207722e94 +--- + Src/jobs.c | 8 ++++++-- + 1 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/Src/jobs.c b/Src/jobs.c +index 4863962b9..59ddd952e 100644 +--- a/Src/jobs.c ++++ b/Src/jobs.c +@@ -1372,8 +1372,10 @@ cleanfilelists(void) + + DPUTS(shell_exiting >= 0, "BUG: cleanfilelists() before exit"); + +- for (i = 1; i <= maxjob; i++) ++ for (i = 1; i <= maxjob; i++) { + deletefilelist(jobtab[i].filelist, 0); ++ jobtab[i].filelist = 0; ++ } + } + + /**/ +@@ -1531,8 +1533,10 @@ havefiles(void) + int i; + + for (i = 1; i <= maxjob; i++) +- if (jobtab[i].stat && jobtab[i].filelist) ++ if (jobtab[i].stat && jobtab[i].filelist && ++ peekfirst(jobtab[i].filelist)) { + return 1; ++ } + return 0; + + } +-- +2.43.0 + diff --git a/zsh.spec b/zsh.spec index 87d0a7f..56074a0 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 11%{?dist} +Release: 12%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -25,7 +25,10 @@ Patch4: 0004-zsh-enable-PCRE-locale-switching.patch Patch5: 0005-zsh-port-to-pcre2.patch # upstream commit ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 Patch6: 0006-zsh-support-texinfo-7.0.patch -Patch7: zsh-configure-c99.patch +# upstream commit 4c89849c98172c951a9def3690e8647dae76308f +Patch7: 0007-zsh-configure-c99.patch +# upstream commit d3edf318306e37d2d96c4e4ea442d10207722e94 +Patch8: 0008-zsh-deletefilelist-segfault.patch BuildRequires: autoconf BuildRequires: coreutils @@ -171,6 +174,9 @@ fi %doc Doc/*.html %changelog +* Wed Jan 17 2024 Lukáš Zaoral - 5.9-12 +- fix segfault in delerefilelist (rhbz#2245462) + * Fri Dec 8 2023 Florian Weimer - 5.9-11 - Fix C compatibility issue in the configure script From aeaca3cd3607cbdd5cbfac2bcc762a2d94dbc060 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 11:17:42 +0000 Subject: [PATCH 60/74] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 56074a0..9d119b9 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 12%{?dist} +Release: 13%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -174,6 +174,9 @@ fi %doc Doc/*.html %changelog +* Sat Jan 27 2024 Fedora Release Engineering - 5.9-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Wed Jan 17 2024 Lukáš Zaoral - 5.9-12 - fix segfault in delerefilelist (rhbz#2245462) From d2bb79226e2a0933a2f49360ecef4a4e6d0c5dcb Mon Sep 17 00:00:00 2001 From: Nate Leong Date: Mon, 1 Apr 2024 01:30:04 +0000 Subject: [PATCH 61/74] Skip 'clear' if missing for zlogout.rhs In the fedora:39 Docker image, the following occurs: # logout /etc/zlogout:7: command not found: clear --- zlogout.rhs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zlogout.rhs b/zlogout.rhs index 3e78094..0d292de 100644 --- a/zlogout.rhs +++ b/zlogout.rhs @@ -4,4 +4,6 @@ # # -clear +if command -v clear > /dev/null; then + clear +fi \ No newline at end of file From ba0ada335bbfb3194a527228d013c89d1f0af174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Mon, 13 May 2024 10:57:14 +0200 Subject: [PATCH 62/74] Fix zlogout when ncurses is not installed Resolves: rhbz#2279741 Fixes: d2bb79226e2a0933a2f49360ecef4a4e6d0c5dcb (Skip 'clear' if missing for zlogout.rhs) --- zlogout.rhs | 4 +--- zsh.spec | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/zlogout.rhs b/zlogout.rhs index 0d292de..600702c 100644 --- a/zlogout.rhs +++ b/zlogout.rhs @@ -4,6 +4,4 @@ # # -if command -v clear > /dev/null; then - clear -fi \ No newline at end of file +command -v clear &> /dev/null && clear diff --git a/zsh.spec b/zsh.spec index 9d119b9..9a8fba3 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 13%{?dist} +Release: 14%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -174,6 +174,9 @@ fi %doc Doc/*.html %changelog +* Mon May 13 2024 Lukáš Zaoral - 5.9-14 +- fix zlogout when ncurses is not installed (rhbz#2279741) + * Sat Jan 27 2024 Fedora Release Engineering - 5.9-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 10d8a438469aaa9a8b655f0d5dcd4b92b9270fd7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 10:57:13 +0000 Subject: [PATCH 63/74] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 9a8fba3..dc67b2e 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 14%{?dist} +Release: 15%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -174,6 +174,9 @@ fi %doc Doc/*.html %changelog +* Sat Jul 20 2024 Fedora Release Engineering - 5.9-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Mon May 13 2024 Lukáš Zaoral - 5.9-14 - fix zlogout when ncurses is not installed (rhbz#2279741) From 1c5480cb7f074d86292e37ea71ad4f1324ca0bed Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 16:52:32 +0000 Subject: [PATCH 64/74] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index dc67b2e..75665dc 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 15%{?dist} +Release: 16%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -174,6 +174,9 @@ fi %doc Doc/*.html %changelog +* Sun Jan 19 2025 Fedora Release Engineering - 5.9-16 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sat Jul 20 2024 Fedora Release Engineering - 5.9-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 631ad08bf20eecd23ab16a15d6e644f81a52b7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Fri, 11 Apr 2025 17:03:05 +0200 Subject: [PATCH 65/74] tests: remove dependency on Fedora shell tests --- .fmf/version | 1 - plans/shell.fmf | 14 -------------- 2 files changed, 15 deletions(-) delete mode 100644 .fmf/version delete mode 100644 plans/shell.fmf diff --git a/.fmf/version b/.fmf/version deleted file mode 100644 index d00491f..0000000 --- a/.fmf/version +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/plans/shell.fmf b/plans/shell.fmf deleted file mode 100644 index bcc3572..0000000 --- a/plans/shell.fmf +++ /dev/null @@ -1,14 +0,0 @@ -summary: - Run relevant tests from the shell tests repository -discover: - how: fmf - url: https://src.fedoraproject.org/tests/shell - filter: component:zsh -prepare: - how: install - package: zsh -execute: - how: tmt -environment: - PACKAGES: zsh - SH_BIN: zsh From 62445c1b7d138d72109d0855677a4a5c7862a3e3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 21:20:56 +0000 Subject: [PATCH 66/74] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 75665dc..e55d65e 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 16%{?dist} +Release: 17%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -174,6 +174,9 @@ fi %doc Doc/*.html %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 5.9-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Sun Jan 19 2025 Fedora Release Engineering - 5.9-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 43ef6c97ad83eb07df56def53a4b7e577d2e7bd8 Mon Sep 17 00:00:00 2001 From: Christoph Erhardt Date: Mon, 29 Sep 2025 23:47:41 +0200 Subject: [PATCH 67/74] Add completion support for dnf5 --- 0009-zsh-support-dnf5.patch | 846 ++++++++++++++++++ ...h-fix-dnf5-completion-with-rpm-files.patch | 19 + zsh.spec | 9 +- 3 files changed, 873 insertions(+), 1 deletion(-) create mode 100644 0009-zsh-support-dnf5.patch create mode 100644 0010-zsh-fix-dnf5-completion-with-rpm-files.patch diff --git a/0009-zsh-support-dnf5.patch b/0009-zsh-support-dnf5.patch new file mode 100644 index 0000000..8e55aa0 --- /dev/null +++ b/0009-zsh-support-dnf5.patch @@ -0,0 +1,846 @@ +commit b70b241cc5ca88cc129ff9ba14f8af2e889b90e6 +Author: Jun-ichi Takimoto +Date: Thu Nov 21 12:26:51 2024 +0900 + + 53238 (+53239 Mikael): support dnf5 + + some options etc for dnf4 are also updated + +diff --git a/Completion/Redhat/Command/_dnf b/Completion/Redhat/Command/_dnf +index a5edf8564..c41795adf 100644 +--- a/Completion/Redhat/Command/_dnf ++++ b/Completion/Redhat/Command/_dnf +@@ -1,7 +1,11 @@ +-#compdef dnf dnf-2 dnf-3 +-# +-# based on dnf-4.2.18 +-# ++#compdef dnf dnf-2 dnf-3 dnf4 ++# based on dnf-4.21.1 ++ ++# avoid 'dnf --version' since it's rather slow for dnf4 ++if [[ $service = dnf && $commands[dnf]:P = */dnf5 ]]; then ++ _dnf5 "$@" && return 0 ++ return 1 ++fi + + _dnf_helper() { + # Get the pathname of the python executable from the 1st line of dnf-2/dnf-3. +@@ -68,25 +72,23 @@ _dnf_packages_or_rpms() { + fi + } + +-_dnf_groups_caching_policy() { +- # TODO: Are there any reliable ways to validate the cache? +- local -a newer=( "$1"(Nmw-1) ) # rebuild if more than a week old +- return $#newer +-} +- + _dnf_groups() { +- local package_groups update_policy expl +- zstyle -s ":completion:${curcontext}:" cache-policy update_policy +- if [[ -z "$update_policy" ]]; then +- zstyle ":completion:${curcontext}:" cache-policy _dnf_groups_caching_policy +- fi +- if _cache_invalid dnf-groups || ! _retrieve_cache dnf-groups; then +- # this can be very slow +- package_groups=( ${${${(M)${(f)"$(_call_program package-groups \ +- $service group list -v 2>/dev/null)"}:# *}#*\(}%\)*} ) +- _store_cache dnf-groups package_groups +- fi +- _wanted package-groups expl 'package group' compadd "$@" -a package_groups ++ # optional option: -T (available|installed) ++ local selected line groups section=none ++ zparseopts -D -E - T:=selected ++ selected=$selected[2] ++ [[ -z $selected ]] && selected=all ++ # XXX hidden groups are not included. ++ # --installed and --available can't be specified with --hidden ++ for line in ${(f)"$(_call_program package-groups ++ $service group list --$selected -qCv 2>/dev/null)"}; do ++ # a line for each group is of the following form: ++ # ' description of the group (group-id)' ++ if [[ $line = \ ##(#b)(*)\(([-_[:alnum:]]#)\) ]]; then ++ groups+=( "${match[2]}:${match[1]}" ) ++ fi ++ done ++ _describe -t groups "$selected group" groups + } + + _dnf_repoquery() { +@@ -194,7 +196,7 @@ _dnf_repository_packages() { + fi + } + +-_dnf() { ++_dnf4() { + local cache_file="/var/cache/dnf/packages.db" + local -a opts=( + '(-6)-4[resolve to IPv4 addresses only]' +@@ -226,7 +228,7 @@ _dnf() { + '*'{-x+,--exclude=}'[exclude specified packages]: : _sequence _dnf_packages -T all' + '--forcearch=[force the use of the specified arch]:arch: ' + '(-)'{-h,--help}'[show the help message]' +- '--installroot=[set install root]:directory:_files -/' ++ '--installroot=[set install root]:directory:_files -/ -g "/*"' + '--newpackage[include newpackage relevant packages]' + '--noautoremove[disable removal of dependencies that are no longer used]' + '--nobest[do not limit transactions to best candidates]' +@@ -289,18 +291,21 @@ _dnf_command() { + if (( CURRENT == 1 )); then + _describe -t dnf-commands 'dnf command' dnf_cmds + else +- local curcontext=$curcontext cur=$words[CURRENT] cmd tmp expl ret=1 ++ local cur=$words[CURRENT] cmd=$words[1] tmp expl ret=1 + # Deal with aliases (not comprehensive) +- case $words[1] in ++ case $cmd in + check-updgrade) cmd=check-update;; + distrosync|dsync) cmd=distro-sync;; + dg) cmd=downgrade;; ++ dsync) cmd=distro-sync;; + erase|rm) cmd=remove;; + groups|grp) cmd=group;; + hist) cmd=history;; + in) cmd=install;; ++ if) cmd=info;; ++ ls) cmd=list;; + mc) cmd=makecache;; +- prov|whatprovides) cmd=provides;; ++ prov|whatprovides|wp) cmd=provides;; + rei) cmd=reinstall;; + repoinfo) cmd=repolist;; + rq) cmd=repoquery;; +@@ -308,9 +313,9 @@ _dnf_command() { + sh) cmd=shell;; + update|up) cmd=upgrade;; + update-minimal|up-min) cmd=upgrade-minimal;; +- *) cmd="${${dnf_cmds[(r)$words[1]:*]%%:*}}";; ++ upif) cmd=updateinfo;; + esac +- (( $#cmd )) && curcontext="${curcontext%:*:*}:dnf-${cmd}:" ++ local curcontext="${curcontext%:*:*}:dnf-${cmd}:" + + case $cmd in + alias) +@@ -337,11 +342,9 @@ _dnf_command() { + _describe -t options 'option' tmp && ret=0 + ;; + check-update) +- if [[ $cur = -* ]]; then +- _wanted options expl 'option' compadd - --changelogs && ret=0 +- else +- _dnf_packages -T installed && ret=0 +- fi ++ _arguments : \ ++ '--changelogs[also print changelog delta of packages]' \ ++ '*: :_dnf_packages -T installed' && ret=0 + ;; + clean) + tmp=( +@@ -368,23 +371,38 @@ _dnf_command() { + "mark:mark a group for installation or removal" + ) + _describe -t subcommands 'subcommand' tmp && ret=0 +- elif (( CURRENT == 3 )) && [[ $cur = -* ]]; then +- if [[ $words[2] == install ]]; then +- _wanted options expl 'option' compadd - --with-optional && ret=0 +- elif [[ $words[2] == list ]]; then +- tmp=( +- '--available:show only available groups' +- '--installed:show only installed groups' +- '--hidden:show also hidden groups' +- '--ids:show also ID of groups' +- ) +- _describe -t options 'option' tmp && ret=0 +- fi +- elif (( CURRENT == 3 )) && [[ $words[2] == mark ]]; then +- _wanted subcommands expl 'subcommand' \ +- compadd - install remove && ret=0 + else +- _dnf_groups && ret=0 ++ case $words[2] in ++ summary) ++ _arguments : '--hidden' '2: :_dnf_groups' && ret=0 ++ ;; ++ info) ++ _dnf_groups && ret=0 ++ ;; ++ install) ++ _arguments : '--with-optional[also include optional packages]' \ ++ '*: :_dnf_groups -T available' && ret=0 ++ ;; ++ list) ++ _arguments : \ ++ '(--installed)--available[show only available groups]' \ ++ '(--available)--installed[show only installed groups]' \ ++ '--hidden[show also hidden groups]' \ ++ {--ids,-v}'[show also ID of groups]' \ ++ '*: :_dnf_groups' && ret=0 ++ ;; ++ remove|upgrade) ++ _dnf_groups -T installed && ret=0 ++ ;; ++ mark) ++ if (( CURRENT == 3 )); then ++ _wanted subcommands expl 'subcommand' \ ++ compadd - install remove && ret=0 ++ else ++ _dnf_groups && ret=0 ++ fi ++ ;; ++ esac + fi + ;; + help) +@@ -399,13 +417,32 @@ _dnf_command() { + "list:list transactions" + "info:describe the given transactions" + "redo:repeat the specified transaction" ++ "replay:replay transaction stored in the specified file" + "rollback:undo all since the given transaction" ++ "store:store the specified transaction in file" + "undo:undo transactions" + "userinstalled:list all packages installed by users" + ) + _describe -t subcommands 'subcommand' tmp && ret=0 +- elif [[ $words[2] != userinstalled ]]; then +- _message 'transaction' && ret=0 ++ else ++ case $words[2] in ++ list) ++ _arguments : '--reverse[output history in reverse order]' \ ++ '*:transaction ID or ID..ID: ' && ret=0 ;; ++ info) ++ _message 'transaction ID or ID..ID' && ret=0 ;; ++ redo|rollback|undo) ++ _message 'transaction or package' && ret=0 ;; ++ replay) ++ _arguments : \ ++ "--ignore-installed[don't check for installed packages being in the same state as recorded in transaction]" \ ++ "--ignore-extras[don't check for extra packages pulled into the transaction on the target system]" \ ++ '--skip-unavailable[skip packages that are in transaction but not in target system]' \ ++ '2:transaction file:_files' && ret=0 ;; ++ store) ++ _arguments : {-o+,--output=}'[store in specified file]: :_files' \ ++ '2:transaction: ' && ret=0 ;; ++ esac + fi + ;; + info|list) +@@ -413,7 +450,7 @@ _dnf_command() { + if [[ $cur = -* ]]; then + tmp=( --all --available --installed --extras + --obsoletes --upgrades --autoremove --recent ) +- _wanted options expl 'option' compadd -a tmp ++ _wanted options expl 'option' compadd -a tmp && ret=0 + else + _dnf_packages -T all && ret=0 + fi +@@ -449,6 +486,7 @@ _dnf_command() { + tmp=( + 'install:install a module profile including its packages' + 'update:update packages associated with an active module stream' ++ 'switch-to:switch to a module stream and change versions of installed packages' + 'remove:remove installed module profiles and their packages' + 'enable:enable a module stream' + 'disable:disable a module with all its streams' +@@ -502,7 +540,7 @@ _dnf_command() { + _dnf_repoquery && ret=0 + ;; + repository-packages) +- _dnf_repository_packages ++ _dnf_repository_packages && ret=0 + ;; + search) + if [[ $cur = -* ]]; then +@@ -531,6 +569,7 @@ _dnf_command() { + '--list[display list of advisories]' + '--info[display detailed information of advisories]' + + '(availability)' ++ '-all[include advisories about any versions of installed packages]' + '--available[limit to advisories about newer versions of installed packages]' + '--installed[limit to advisories about equal or older versions of installed packages]' + '--updates[limit to advisories about newer and available versions of installed packages]' +@@ -548,4 +587,4 @@ _dnf_command() { + fi + } + +-_dnf "$@" ++_dnf4 "$@" +diff --git a/Completion/Redhat/Command/_dnf5 b/Completion/Redhat/Command/_dnf5 +new file mode 100644 +index 000000000..e194dd5a7 +--- /dev/null ++++ b/Completion/Redhat/Command/_dnf5 +@@ -0,0 +1,570 @@ ++#compdef dnf5 ++# based on dnf-5.2.6.2 ++ ++# utility functions ++ ++_dnf5_helper() { ++ _call_program specs $service "${(q-)@}" "${(q-)PREFIX}\*" \ ++ -qC --assumeno --nogpgcheck 2>/dev/null command' '*:: :->cmd_args' && ret=0 ++ ++ case $state in ++ command) _dnf5_commands && ret=0 ;; ++ cmd_args) _dnf5_subcmds_opts && ret=0 ;; ++ esac ++ return ret ++} ++ ++_dnf5 "$@" diff --git a/0010-zsh-fix-dnf5-completion-with-rpm-files.patch b/0010-zsh-fix-dnf5-completion-with-rpm-files.patch new file mode 100644 index 0000000..eacb810 --- /dev/null +++ b/0010-zsh-fix-dnf5-completion-with-rpm-files.patch @@ -0,0 +1,19 @@ +commit 071e325c826a89b792056c3faf0c400b8c0c5738 +Author: Christoph Erhardt +Date: Tue Sep 30 08:47:15 2025 +0900 + + 53981: _dnf5: fix completion of local rpm files + +diff --git a/Completion/Redhat/Command/_dnf5 b/Completion/Redhat/Command/_dnf5 +index e194dd5a7..9cbf451a8 100644 +--- a/Completion/Redhat/Command/_dnf5 ++++ b/Completion/Redhat/Command/_dnf5 +@@ -38,7 +38,7 @@ _dnf5_rpm_files() { + + _dnf5_packages_or_rpms() { + if [[ "$words[CURRENT]" = (*/*|\~*) ]]; then # if looks like a path name +- _dnf_rpm_files ++ _dnf5_rpm_files + else + _dnf5_packages "$@" + fi diff --git a/zsh.spec b/zsh.spec index e55d65e..bb25350 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 17%{?dist} +Release: 18%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -29,6 +29,10 @@ Patch6: 0006-zsh-support-texinfo-7.0.patch Patch7: 0007-zsh-configure-c99.patch # upstream commit d3edf318306e37d2d96c4e4ea442d10207722e94 Patch8: 0008-zsh-deletefilelist-segfault.patch +# upstream commit b70b241cc5ca88cc129ff9ba14f8af2e889b90e6 +Patch9: 0009-zsh-support-dnf5.patch +# upstream commit 071e325c826a89b792056c3faf0c400b8c0c5738 +Patch10: 0010-zsh-fix-dnf5-completion-with-rpm-files.patch BuildRequires: autoconf BuildRequires: coreutils @@ -174,6 +178,9 @@ fi %doc Doc/*.html %changelog +* Mon Sep 29 2025 Christoph Erhardt - 5.9-18 +- Add completion support for dnf5 + * Fri Jul 25 2025 Fedora Release Engineering - 5.9-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 43281b3111b29c042423348dc8cc3d9ccdb79dfc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 21:11:08 +0000 Subject: [PATCH 68/74] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index bb25350..7effffd 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 18%{?dist} +Release: 19%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -178,6 +178,9 @@ fi %doc Doc/*.html %changelog +* Sat Jan 17 2026 Fedora Release Engineering - 5.9-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Mon Sep 29 2025 Christoph Erhardt - 5.9-18 - Add completion support for dnf5 From fed92fd5ffc7b4dee6c43da259e7d8414948582a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Tue, 24 Mar 2026 10:31:08 +0100 Subject: [PATCH 69/74] fix segfault in _IO_putc Resolves: rhbz#2449939 --- 0100-zsh-_IO_putc-SIGSEGV.patch | 25 +++++++++++++++++++++++++ zsh.spec | 9 ++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 0100-zsh-_IO_putc-SIGSEGV.patch diff --git a/0100-zsh-_IO_putc-SIGSEGV.patch b/0100-zsh-_IO_putc-SIGSEGV.patch new file mode 100644 index 0000000..3adf849 --- /dev/null +++ b/0100-zsh-_IO_putc-SIGSEGV.patch @@ -0,0 +1,25 @@ +diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c +index 8f32c68e3..bd4a67cee 100644 +--- a/Src/Zle/zle_tricky.c ++++ b/Src/Zle/zle_tricky.c +@@ -2490,15 +2490,17 @@ printfmt(char *fmt, int n, int dopr, int doesc) + p--; + } else + atr = match_colour(NULL, is_fg, arg); +- if (atr != TXT_ERROR) ++ if (atr != TXT_ERROR && dopr) + set_colour_attribute(atr, is_fg ? COL_SEQ_FG : + COL_SEQ_BG, 0); + break; + case 'f': +- set_colour_attribute(TXTNOFGCOLOUR, COL_SEQ_FG, 0); ++ if (dopr) ++ set_colour_attribute(TXTNOFGCOLOUR, COL_SEQ_FG, 0); + break; + case 'k': +- set_colour_attribute(TXTNOBGCOLOUR, COL_SEQ_BG, 0); ++ if (dopr) ++ set_colour_attribute(TXTNOBGCOLOUR, COL_SEQ_BG, 0); + break; + case '{': + if (arg) diff --git a/zsh.spec b/zsh.spec index 7effffd..3598f05 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9 -Release: 19%{?dist} +Release: 20%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz @@ -34,6 +34,10 @@ Patch9: 0009-zsh-support-dnf5.patch # upstream commit 071e325c826a89b792056c3faf0c400b8c0c5738 Patch10: 0010-zsh-fix-dnf5-completion-with-rpm-files.patch +# downstream patch for rhbz#2449939 +# already fixed upstream in a major refactor of term color attribute handling +Patch100: 0100-zsh-_IO_putc-SIGSEGV.patch + BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk @@ -178,6 +182,9 @@ fi %doc Doc/*.html %changelog +* Tue Mar 24 2026 Lukáš Zaoral - 5.9-20 +- fix segfault in _IO_putc (rhbz#2449939) + * Sat Jan 17 2026 Fedora Release Engineering - 5.9-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From ea51b5077a648a0831e45417590ca44eb1727444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Tue, 24 Mar 2026 10:31:31 +0100 Subject: [PATCH 70/74] Fix typo in changelog --- zsh.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index 3598f05..82a14a3 100644 --- a/zsh.spec +++ b/zsh.spec @@ -207,7 +207,7 @@ fi - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Wed Jan 17 2024 Lukáš Zaoral - 5.9-12 -- fix segfault in delerefilelist (rhbz#2245462) +- fix segfault in deletefilelist (rhbz#2245462) * Fri Dec 8 2023 Florian Weimer - 5.9-11 - Fix C compatibility issue in the configure script From 95be2e37b5c0d1282c249ef938f11ab5dc470d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Thu, 4 Jun 2026 11:03:21 +0200 Subject: [PATCH 71/74] rebase to the latest upstream release Resolves: rhbz#2483668 --- 0001-zsh-5.9-do-not-use-egrep-in-tests.patch | 178 ---- 0002-zsh-Use-int-main-in-test-c-codes.patch | 541 ----------- 0004-zsh-enable-PCRE-locale-switching.patch | 64 -- 0005-zsh-port-to-pcre2.patch | 641 ------------- 0006-zsh-support-texinfo-7.0.patch | 53 -- 0007-zsh-configure-c99.patch | 44 - 0008-zsh-deletefilelist-segfault.patch | 42 - 0009-zsh-support-dnf5.patch | 846 ------------------ ...h-fix-dnf5-completion-with-rpm-files.patch | 19 - sources | 4 +- zsh-keyring.asc | 269 ++++++ zsh.spec | 68 +- 12 files changed, 296 insertions(+), 2473 deletions(-) delete mode 100644 0001-zsh-5.9-do-not-use-egrep-in-tests.patch delete mode 100644 0002-zsh-Use-int-main-in-test-c-codes.patch delete mode 100644 0004-zsh-enable-PCRE-locale-switching.patch delete mode 100644 0005-zsh-port-to-pcre2.patch delete mode 100644 0006-zsh-support-texinfo-7.0.patch delete mode 100644 0007-zsh-configure-c99.patch delete mode 100644 0008-zsh-deletefilelist-segfault.patch delete mode 100644 0009-zsh-support-dnf5.patch delete mode 100644 0010-zsh-fix-dnf5-completion-with-rpm-files.patch create mode 100644 zsh-keyring.asc diff --git a/0001-zsh-5.9-do-not-use-egrep-in-tests.patch b/0001-zsh-5.9-do-not-use-egrep-in-tests.patch deleted file mode 100644 index 4d5a1cf..0000000 --- a/0001-zsh-5.9-do-not-use-egrep-in-tests.patch +++ /dev/null @@ -1,178 +0,0 @@ -From 6935aa4b515fe9b782507820c77ab681136470bc Mon Sep 17 00:00:00 2001 -From: Jun-ichi Takimoto -Date: Thu, 15 Sep 2022 18:56:20 +0900 -Subject: [PATCH] 50629: do not use egrep in tests - -Upstream-commit: 4fc5dc0292acd77f17281f451774ba2ca4203026 -Signed-off-by: Kamil Dudka ---- - Test/D07multibyte.ztst | 16 ++-------------- - Test/E01options.ztst | 2 +- - Test/V07pcre.ztst | 16 ++-------------- - Test/X02zlevi.ztst | 11 +---------- - Test/X03zlebindkey.ztst | 11 +---------- - Test/Y01completion.ztst | 11 +---------- - Test/ztst.zsh | 15 +++++++++++++++ - 7 files changed, 23 insertions(+), 59 deletions(-) - -diff --git a/Test/D07multibyte.ztst b/Test/D07multibyte.ztst -index e2e9a25..6909346 100644 ---- a/Test/D07multibyte.ztst -+++ b/Test/D07multibyte.ztst -@@ -1,19 +1,7 @@ - %prep - --# Find a UTF-8 locale. -- setopt multibyte --# Don't let LC_* override our choice of locale. -- unset -m LC_\* -- mb_ok= -- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 -- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) -- for LANG in $langs; do -- if [[ é = ? ]]; then -- mb_ok=1 -- break; -- fi -- done -- if [[ -z $mb_ok ]]; then -+ LANG=$(ZTST_find_UTF8) -+ if [[ -z $LANG ]]; then - ZTST_unimplemented="no UTF-8 locale or multibyte mode is not implemented" - else - print -u $ZTST_fd Testing multibyte with locale $LANG -diff --git a/Test/E01options.ztst b/Test/E01options.ztst -index 2acbfd3..d38fbed 100644 ---- a/Test/E01options.ztst -+++ b/Test/E01options.ztst -@@ -651,7 +651,7 @@ - >noktarg1 - >0 1 - -- showopt() { setopt | egrep 'localoptions|ksharrays'; } -+ showopt() { echo ${(FM)${(@f)"$(setopt)"}:#(localoptions|ksharrays)*} } - f1() { setopt localoptions ksharrays; showopt } - f2() { setopt ksharrays; showopt } - setopt kshoptionprint -diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst -index c9c844d..ca13419 100644 ---- a/Test/V07pcre.ztst -+++ b/Test/V07pcre.ztst -@@ -6,20 +6,8 @@ - return 0 - fi - setopt rematch_pcre --# Find a UTF-8 locale. -- setopt multibyte --# Don't let LC_* override our choice of locale. -- unset -m LC_\* -- mb_ok= -- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 -- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) -- for LANG in $langs; do -- if [[ é = ? ]]; then -- mb_ok=1 -- break; -- fi -- done -- if [[ -z $mb_ok ]]; then -+ LANG=$(ZTST_find_UTF8) -+ if [[ -z $LANG ]]; then - ZTST_unimplemented="no UTF-8 locale or multibyte mode is not implemented" - else - print -u $ZTST_fd Testing PCRE multibyte with locale $LANG -diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst -index 8146d67..203c13c 100644 ---- a/Test/X02zlevi.ztst -+++ b/Test/X02zlevi.ztst -@@ -1,16 +1,7 @@ - # Tests of the vi mode of ZLE - - %prep -- unset -m LC_\* -- ZSH_TEST_LANG= -- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 -- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) -- for LANG in $langs; do -- if [[ é = ? ]]; then -- ZSH_TEST_LANG=$LANG -- break; -- fi -- done -+ ZSH_TEST_LANG=$(ZTST_find_UTF8) - if ( zmodload zsh/zpty 2>/dev/null ); then - . $ZTST_srcdir/comptest - comptestinit -v -z $ZTST_testdir/../Src/zsh -diff --git a/Test/X03zlebindkey.ztst b/Test/X03zlebindkey.ztst -index 43692a8..5277332 100644 ---- a/Test/X03zlebindkey.ztst -+++ b/Test/X03zlebindkey.ztst -@@ -3,16 +3,7 @@ - # into bindings. The latter is particularly tricky with multibyte sequences. - - %prep -- unset -m LC_\* -- ZSH_TEST_LANG= -- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 -- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) -- for LANG in $langs; do -- if [[ é = ? ]]; then -- ZSH_TEST_LANG=$LANG -- break; -- fi -- done -+ ZSH_TEST_LANG=$(ZTST_find_UTF8) - if ( zmodload zsh/zpty 2>/dev/null ); then - . $ZTST_srcdir/comptest - comptestinit -z $ZTST_testdir/../Src/zsh -diff --git a/Test/Y01completion.ztst b/Test/Y01completion.ztst -index 6af0efc..f976f9f 100644 ---- a/Test/Y01completion.ztst -+++ b/Test/Y01completion.ztst -@@ -1,16 +1,7 @@ - # Tests for completion system. - - %prep -- unset -m LC_\* -- ZSH_TEST_LANG= -- langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 -- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8')) -- for LANG in $langs; do -- if [[ é = ? ]]; then -- ZSH_TEST_LANG=$LANG -- break; -- fi -- done -+ ZSH_TEST_LANG=$(ZTST_find_UTF8) - if ( zmodload zsh/zpty 2>/dev/null ); then - . $ZTST_srcdir/comptest - mkdir comp.tmp -diff --git a/Test/ztst.zsh b/Test/ztst.zsh -index aca275c..d95b726 100755 ---- a/Test/ztst.zsh -+++ b/Test/ztst.zsh -@@ -37,6 +37,21 @@ emulate -R zsh - # LANG must be passed to child zsh. - export LANG - -+# find UTF-8 locale -+ZTST_find_UTF8 () { -+ setopt multibyte -+ # Don't let LC_* override our choice of locale. -+ unset -m LC_\* -+ local langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8 -+ ${(M)$(locale -a 2>/dev/null):#*.(utf8|UTF-8)}) -+ for LANG in $langs; do -+ if [[ é = ? ]]; then -+ echo $LANG -+ return -+ fi -+ done -+} -+ - # Don't propagate variables that are set by default in the shell. - typeset +x WORDCHARS - --- -2.39.0 - diff --git a/0002-zsh-Use-int-main-in-test-c-codes.patch b/0002-zsh-Use-int-main-in-test-c-codes.patch deleted file mode 100644 index 3585cc4..0000000 --- a/0002-zsh-Use-int-main-in-test-c-codes.patch +++ /dev/null @@ -1,541 +0,0 @@ -commit ab4d62eb975a4c4c51dd35822665050e2ddc6918 -Author: Nicholas Vinson -Date: Wed Sep 21 09:22:11 2022 +0900 - - 50641: use 'int main()' in test C-codes in configure - -diff --git a/aczsh.m4 b/aczsh.m4 -index 1209ac614..b31236020 100644 ---- a/aczsh.m4 -+++ b/aczsh.m4 -@@ -44,6 +44,7 @@ AC_DEFUN(zsh_64_BIT_TYPE, - #include - #endif - -+int - main() - { - $1 foo = 0; -@@ -118,7 +119,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS - AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) && - AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ --#include - #ifdef HPUX10DYNAMIC - #include - #define RTLD_LAZY BIND_DEFERRED -@@ -146,29 +146,30 @@ char *zsh_gl_sym_addr ; - #define RTLD_GLOBAL 0 - #endif - -+int - main() - { - void *handle1, *handle2; - void *(*zsh_getaddr1)(), *(*zsh_getaddr2)(); - void *sym1, *sym2; - handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle1) exit(1); -+ if(!handle1) return(1); - handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle2) exit(1); -+ if(!handle2) return(1); - zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); - zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2"); - sym1 = zsh_getaddr1(); - sym2 = zsh_getaddr2(); -- if(!sym1 || !sym2) exit(1); -- if(sym1 != sym2) exit(1); -+ if(!sym1 || !sym2) return(1); -+ if(sym1 != sym2) return(1); - dlclose(handle1); - handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle1) exit(1); -+ if(!handle1) return(1); - zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); - sym1 = zsh_getaddr1(); -- if(!sym1) exit(1); -- if(sym1 != sym2) exit(1); -- exit(0); -+ if(!sym1) return(1); -+ if(sym1 != sym2) return(1); -+ return(0); - } - ]])],[zsh_cv_shared_$1=yes], - [zsh_cv_shared_$1=no], -@@ -200,7 +201,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS - AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) && - AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ --#include - #ifdef HPUX10DYNAMIC - #include - #define RTLD_LAZY BIND_DEFERRED -@@ -228,19 +228,19 @@ char *zsh_gl_sym_addr ; - #define RTLD_GLOBAL 0 - #endif - -- -+int - main() - { - void *handle1, *handle2; - int (*fred1)(), (*fred2)(); - handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle1) exit(1); -+ if(!handle1) return(1); - handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle2) exit(1); -+ if(!handle2) return(1); - fred1 = (int (*)()) dlsym(handle1, "${us}fred"); - fred2 = (int (*)()) dlsym(handle2, "${us}fred"); -- if(!fred1 || !fred2) exit(1); -- exit((*fred1)() != 42 || (*fred2)() != 69); -+ if(!fred1 || !fred2) return(1); -+ return((*fred1)() != 42 || (*fred2)() != 69); - } - ]])],[zsh_cv_sys_dynamic_clash_ok=yes], - [zsh_cv_sys_dynamic_clash_ok=no], -@@ -276,7 +276,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS - AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) && - AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ --#include - #ifdef HPUX10DYNAMIC - #include - #define RTLD_LAZY BIND_DEFERRED -@@ -304,17 +303,18 @@ char *zsh_gl_sym_addr ; - #define RTLD_GLOBAL 0 - #endif - -+int - main() - { - void *handle; - int (*barneysym)(); - handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle) exit(1); -+ if(!handle) return(1); - handle = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle) exit(1); -+ if(!handle) return(1); - barneysym = (int (*)()) dlsym(handle, "${us}barney"); -- if(!barneysym) exit(1); -- exit((*barneysym)() != 69); -+ if(!barneysym) return(1); -+ return((*barneysym)() != 69); - } - ]])],[zsh_cv_sys_dynamic_rtld_global=yes], - [zsh_cv_sys_dynamic_rtld_global=no], -@@ -346,7 +346,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS - save_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ --#include - #ifdef HPUX10DYNAMIC - #include - #define RTLD_LAZY BIND_DEFERRED -@@ -374,15 +373,16 @@ char *zsh_gl_sym_addr ; - #define RTLD_GLOBAL 0 - #endif - -+int - main() - { - void *handle; - int (*barneysym)(); - handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle) exit(1); -+ if(!handle) return(1); - barneysym = (int (*)()) dlsym(handle, "${us}barney"); -- if(!barneysym) exit(1); -- exit((*barneysym)() != 69); -+ if(!barneysym) return(1); -+ return((*barneysym)() != 69); - } - - int fred () { return 42; } -@@ -420,7 +420,6 @@ elif - save_ldflags=$LDFLAGS - LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -s" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ --#include - #ifdef HPUX10DYNAMIC - #include - #define RTLD_LAZY BIND_DEFERRED -@@ -448,15 +447,16 @@ char *zsh_gl_sym_addr ; - #define RTLD_GLOBAL 0 - #endif - -+int - main() - { - void *handle; - int (*barneysym)(); - handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle) exit(1); -+ if(!handle) return(1); - barneysym = (int (*)()) dlsym(handle, "${us}barney"); -- if(!barneysym) exit(1); -- exit((*barneysym)() != 69); -+ if(!barneysym) return(1); -+ return((*barneysym)() != 69); - } - - int fred () { return 42; } -@@ -488,7 +488,6 @@ echo 'int fred () { return 42; }' > conftest1.c - if AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&AS_MESSAGE_LOG_FD) && - AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS -s conftest1.o $LIBS 1>&AS_MESSAGE_LOG_FD); then - AC_RUN_IFELSE([AC_LANG_SOURCE([[ --#include - #ifdef HPUX10DYNAMIC - #include - #define RTLD_LAZY BIND_DEFERRED -@@ -516,15 +515,16 @@ char *zsh_gl_sym_addr ; - #define RTLD_GLOBAL 0 - #endif - -+int - main() - { - void *handle; - int (*fredsym)(); - handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -- if(!handle) exit(1); -+ if(!handle) return(1); - fredsym = (int (*)()) dlsym(handle, "${us}fred"); -- if(!fredsym) exit(1); -- exit((*fredsym)() != 42); -+ if(!fredsym) return(1); -+ return((*fredsym)() != 42); - } - ]])],[zsh_cv_sys_dynamic_strip_lib=yes], - [zsh_cv_sys_dynamic_strip_lib=no], -diff --git a/configure.ac b/configure.ac -index 890ef8dd2..074141d38 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -585,7 +585,7 @@ fi - dnl Checking if compiler correctly cast signed to unsigned. - AC_CACHE_CHECK(if signed to unsigned casting is broken, - zsh_cv_c_broken_signed_to_unsigned_casting, --[AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])]) -+[AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])]) - AH_TEMPLATE([BROKEN_SIGNED_TO_UNSIGNED_CASTING], - [Define to 1 if compiler incorrectly cast signed to unsigned.]) - if test x$zsh_cv_c_broken_signed_to_unsigned_casting = xyes; then -@@ -1046,7 +1046,7 @@ else - [AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - --main() { return sizeof(off_t) < 8; } -+int main() { return sizeof(off_t) < 8; } - ]])],[zsh_cv_off_t_is_64_bit=yes],[zsh_cv_off_t_is_64_bit=no],[zsh_cv_off_t_is_64_bit=no])]) - if test x$zsh_cv_off_t_is_64_bit = xyes; then - AC_DEFINE(OFF_T_IS_64_BIT) -@@ -1056,7 +1056,7 @@ main() { return sizeof(off_t) < 8; } - [AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - --main() { return sizeof(ino_t) < 8; } -+int main() { return sizeof(ino_t) < 8; } - ]])],[zsh_cv_ino_t_is_64_bit=yes],[zsh_cv_ino_t_is_64_bit=no],[zsh_cv_ino_t_is_64_bit=no])]) - if test x$zsh_cv_ino_t_is_64_bit = xyes; then - AC_DEFINE(INO_T_IS_64_BIT) -@@ -1369,7 +1369,7 @@ zsh_cv_func_realpath_accepts_null, - #include - #include - ],[ --exit(!realpath("/", (char*)0)); -+return(!realpath("/", (char*)0)); - ])], - [zsh_cv_func_realpath_accepts_null=yes], - [zsh_cv_func_realpath_accepts_null=no], -@@ -1393,10 +1393,9 @@ AC_CACHE_CHECK(if tgetent accepts NULL, - zsh_cv_func_tgetent_accepts_null, - [AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include --#include - int tgetent(char *, char *); - char *tgetstr(char *, char **); --main() -+int main() - { - char buf[4096]; - int r1 = tgetent(buf, "vt100"); -@@ -1407,7 +1406,7 @@ main() - tgetstr("cl", &u); - creat("conftest.tgetent", 0640); - } -- exit((r1 != r2) || r2 == -1); -+ return((r1 != r2) || r2 == -1); - } - ]])],[if test -f conftest.tgetent; then - zsh_cv_func_tgetent_accepts_null=yes -@@ -1421,10 +1420,9 @@ AC_CACHE_CHECK(if tgetent returns 0 on success, - zsh_cv_func_tgetent_zero_success, - [AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include --#include - int tgetent(char *, char*); - char *tgetstr(char *, char **); --main() -+int main() - { - char buf[4096]; - int r1 = tgetent(buf, "!@#$%^&*"); -@@ -1435,7 +1433,7 @@ main() - tgetstr("cl", &u); - creat("conftest.tgetent0", 0640); - } -- exit(r1 == r2); -+ return(r1 == r2); - } - ]])],[if test -f conftest.tgetent0; then - zsh_cv_func_tgetent_zero_success=yes -@@ -1869,8 +1867,7 @@ zsh_cv_rlim_t_is_longer, - #include - #endif - #include --#include --main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])]) -+int main(){struct rlimit r;return(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])]) - if test x$zsh_cv_rlim_t_is_longer = xyes; then - AC_CACHE_CHECK(if rlim_t is a quad, - zsh_cv_rlim_t_is_quad_t, -@@ -1880,13 +1877,12 @@ if test x$zsh_cv_rlim_t_is_longer = xyes; then - #endif - #include - #include --#include --main() { -+int main() { - struct rlimit r; - char buf[20]; - r.rlim_cur = 0; - sprintf(buf, "%qd", r.rlim_cur); -- exit(strcmp(buf, "0")); -+ return(strcmp(buf, "0")); - }]])],[zsh_cv_rlim_t_is_quad_t=yes],[zsh_cv_rlim_t_is_quad_t=no],[zsh_cv_rlim_t_is_quad_t=no])]) - if test x$zsh_cv_rlim_t_is_quad_t = xyes; then - AC_DEFINE(RLIM_T_IS_QUAD_T) -@@ -1903,8 +1899,7 @@ else - #include - #endif - #include --#include -- main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])]) -+ int main(){struct rlimit r;r.rlim_cur=-1;return(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])]) - if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then - AC_DEFINE(RLIM_T_IS_UNSIGNED) - DEFAULT_RLIM_T="unsigned $DEFAULT_RLIM_T" -@@ -2187,9 +2182,8 @@ zsh_cv_sys_fifo, - #include - #include - #include --#include - #include --main() -+int main() - { - char c; - int fd; -@@ -2200,18 +2194,18 @@ main() - #else - if(mknod("/tmp/fifo$$", 0010600, 0) < 0) - #endif -- exit(1); -+ return(1); - pid = fork(); - if(pid < 0) -- exit(1); -+ return(1); - if(pid) { - fd = open("/tmp/fifo$$", O_RDONLY); -- exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x'); -+ return(fd < 0 || read(fd, &c, 1) != 1 || c != 'x'); - } - fd = open("/tmp/fifo$$", O_WRONLY); - ret = (fd < 0 || write(fd, "x", 1) < 1); - unlink("/tmp/fifo$$"); -- exit(ret); -+ return(ret); - } - ]])],[zsh_cv_sys_fifo=yes],[zsh_cv_sys_fifo=no],[zsh_cv_sys_fifo=yes]) - ]) -@@ -2289,8 +2283,7 @@ zsh_cv_sys_link, - [AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include --#include --main() -+int main() - { - int ret; - char *tmpfile, *newfile; -@@ -2299,11 +2292,11 @@ main() - unlink(tmpfile); - unlink(newfile); - if(creat(tmpfile, 0644) < 0) -- exit(1); -+ return(1); - ret = link(tmpfile, newfile); - unlink(tmpfile); - unlink(newfile); -- exit(ret<0); -+ return(ret<0); - } - ]])],[zsh_cv_sys_link=yes],[zsh_cv_sys_link=no],[zsh_cv_sys_link=yes])]) - AH_TEMPLATE([HAVE_LINK], -@@ -2322,12 +2315,11 @@ zsh_cv_sys_killesrch, - #include - #include - #include --#include --main() -+int main() - { - int pid = (getpid() + 10000) & 0xffffff; - while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1; -- exit(errno!=ESRCH); -+ return(errno!=ESRCH); - } - ]])],[zsh_cv_sys_killesrch=yes],[zsh_cv_sys_killesrch=no],[zsh_cv_sys_killesrch=yes])]) - AH_TEMPLATE([BROKEN_KILL_ESRCH], -@@ -2348,12 +2340,11 @@ if test x$signals_style = xPOSIX_SIGNALS; then - [AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include - #include --#include - int child=0; - void handler(sig) - int sig; - {if(sig==SIGCHLD) child=1;} --main() { -+int main() { - struct sigaction act; - sigset_t set; - int pid, ret; -@@ -2368,7 +2359,7 @@ main() { - if(pid>0) { - sigemptyset(&set); - ret=sigsuspend(&set); -- exit(child==0); -+ return(child==0); - } - } - ]])],[zsh_cv_sys_sigsuspend=yes],[zsh_cv_sys_sigsuspend=no],[zsh_cv_sys_sigsuspend=yes])]) -@@ -2400,15 +2391,14 @@ case "x$zsh_working_tcsetpgrp" in - #include - #include - #include --#include --main() { -+int main() { - int fd; - int ret; - fd=open("/dev/tty", O_RDWR); -- if (fd < 0) exit(2); -+ if (fd < 0) return(2); - ret=tcsetpgrp(fd, tcgetpgrp(fd)); -- if (ret < 0) exit(1); -- exit(0); -+ if (ret < 0) return(1); -+ return(0); - } - ]])],[zsh_cv_sys_tcsetpgrp=yes],[ - case $? in -@@ -2448,7 +2438,7 @@ if test x$ac_cv_func_getpwnam = xyes; then - #include - #include - #include --main() { -+int main() { - struct passwd *pw1, *pw2; - char buf[1024], name[1024]; - sprintf(buf, "%d:%d", getpid(), rand()); -@@ -2456,7 +2446,7 @@ main() { - if (pw1) strcpy(name, pw1->pw_name); - sprintf(buf, "%d:%d", rand(), getpid()); - pw2=getpwnam(buf); -- exit(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name)); -+ return(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name)); - } - ]])],[zsh_cv_sys_getpwnam_faked=no],[zsh_cv_sys_getpwnam_faked=yes],[zsh_cv_sys_getpwnam_faked=no])]) - if test x$zsh_cv_sys_getpwnam_faked = xyes; then -@@ -2775,20 +2765,17 @@ elif test "x$dynamic" = xyes; then - zsh_cv_sys_elf, - [AC_RUN_IFELSE([AC_LANG_SOURCE([[/* Test for whether ELF binaries are produced */ - #include --#include - #include --main(argc, argv) --int argc; --char *argv[]; -+int main(int argc, char *argv[]) - { - char b[4]; - int i = open(argv[0],O_RDONLY); - if(i == -1) -- exit(1); /* fail */ -+ return(1); /* fail */ - if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') -- exit(0); /* succeed (yes, it's ELF) */ -+ return(0); /* succeed (yes, it's ELF) */ - else -- exit(1); /* fail */ -+ return(1); /* fail */ - }]])],[zsh_cv_sys_elf=yes],[zsh_cv_sys_elf=no],[zsh_cv_sys_elf=yes])]) - - # We use [0-9]* in case statements, so need to change quoting -@@ -2924,13 +2911,12 @@ LDFLAGS="$old_LDFLAGS") - AC_CACHE_CHECK(if your dlsym() needs a leading underscore, - zsh_cv_func_dlsym_needs_underscore, - [echo failed >conftestval && cat >conftest.c <&AS_MESSAGE_LOG_FD) && - AC_TRY_COMMAND($DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&AS_MESSAGE_LOG_FD) && - AC_RUN_IFELSE([AC_LANG_SOURCE([[ - #include --#include - #ifdef HPUX10DYNAMIC - #include - #define RTLD_LAZY BIND_DEFERRED -@@ -2957,16 +2943,16 @@ char *zsh_gl_sym_addr ; - - extern int fred() ; - --main() -+int main() - { - void * handle ; - void * symbol ; - FILE *f=fopen("conftestval", "w"); -- if (!f) exit(1); -+ if (!f) return(1); - handle = dlopen("./conftest.$DL_EXT", RTLD_LAZY) ; - if (handle == NULL) { - fprintf (f, "dlopen failed") ; -- exit(1); -+ return(1); - } - symbol = dlsym(handle, "fred") ; - if (symbol == NULL) { -@@ -2974,13 +2960,13 @@ main() - symbol = dlsym(handle, "_fred") ; - if (symbol == NULL) { - fprintf (f, "dlsym failed") ; -- exit(1); -+ return(1); - } - fprintf (f, "yes") ; - } - else - fprintf (f, "no") ; -- exit(0); -+ return(0); - }]])],[zsh_cv_func_dlsym_needs_underscore=`cat conftestval`],[zsh_cv_func_dlsym_needs_underscore=failed - dynamic=no],[zsh_cv_func_dlsym_needs_underscore=no])]) - if test "x$zsh_cv_func_dlsym_needs_underscore" = xyes; then diff --git a/0004-zsh-enable-PCRE-locale-switching.patch b/0004-zsh-enable-PCRE-locale-switching.patch deleted file mode 100644 index a6f03bf..0000000 --- a/0004-zsh-enable-PCRE-locale-switching.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 1b421e4978440234fb73117c8505dad1ccc68d46 Mon Sep 17 00:00:00 2001 -From: Jun-ichi Takimoto -Date: Mon, 26 Sep 2022 10:52:50 +0900 -Subject: [PATCH] 50658 + test: Enable to switch between C/UTF-8 locales in - PCRE - ---- - Src/Modules/pcre.c | 10 ++-------- - Test/V07pcre.ztst | 11 +++++++++++ - 2 files changed, 13 insertions(+), 8 deletions(-) - -diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c -index 6289e003e..46875a59b 100644 ---- a/Src/Modules/pcre.c -+++ b/Src/Modules/pcre.c -@@ -47,8 +47,6 @@ zpcre_utf8_enabled(void) - #if defined(MULTIBYTE_SUPPORT) && defined(HAVE_NL_LANGINFO) && defined(CODESET) - static int have_utf8_pcre = -1; - -- /* value can toggle based on MULTIBYTE, so don't -- * be too eager with caching */ - if (have_utf8_pcre < -1) - return 0; - -@@ -56,15 +54,11 @@ zpcre_utf8_enabled(void) - return 0; - - if ((have_utf8_pcre == -1) && -- (!strcmp(nl_langinfo(CODESET), "UTF-8"))) { -- -- if (pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre)) -+ (pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre))) { - have_utf8_pcre = -2; /* erk, failed to ask */ - } - -- if (have_utf8_pcre < 0) -- return 0; -- return have_utf8_pcre; -+ return (have_utf8_pcre == 1) && (!strcmp(nl_langinfo(CODESET), "UTF-8")); - - #else - return 0; -diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst -index ca13419e5..22a0b64c7 100644 ---- a/Test/V07pcre.ztst -+++ b/Test/V07pcre.ztst -@@ -162,3 +162,14 @@ - echo $match[2] ) - 0:regression for segmentation fault, workers/38307 - >test -+ -+ LANG_SAVE=$LANG -+ [[ é =~ '^.\z' ]]; echo $? -+ LANG=C -+ [[ é =~ '^..\z' ]]; echo $? -+ LANG=$LANG_SAVE -+ [[ é =~ '^.\z' ]]; echo $? -+0:swich between C/UTF-8 locales -+>0 -+>0 -+>0 --- -2.41.0 - diff --git a/0005-zsh-port-to-pcre2.patch b/0005-zsh-port-to-pcre2.patch deleted file mode 100644 index fd8ea0e..0000000 --- a/0005-zsh-port-to-pcre2.patch +++ /dev/null @@ -1,641 +0,0 @@ -From b62e911341c8ec7446378b477c47da4256053dc0 Mon Sep 17 00:00:00 2001 -From: Oliver Kiddle -Date: Sat, 13 May 2023 00:53:32 +0200 -Subject: [PATCH] 51723: migrate pcre module to pcre2 - - Cherry-picked-by: Lukáš Zaoral ---- - Src/Modules/pcre.c | 223 ++++++++++++++++++--------------------------- - Test/V07pcre.ztst | 13 ++- - configure.ac | 20 ++-- - 3 files changed, 109 insertions(+), 149 deletions(-) - -diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c -index 46875a59b..079ecc2c5 100644 ---- a/Src/Modules/pcre.c -+++ b/Src/Modules/pcre.c -@@ -34,11 +34,11 @@ - #define CPCRE_PLAIN 0 - - /**/ --#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC) --#include -+#if defined(HAVE_PCRE2_COMPILE_8) && defined(HAVE_PCRE2_H) -+#define PCRE2_CODE_UNIT_WIDTH 8 -+#include - --static pcre *pcre_pattern; --static pcre_extra *pcre_hints; -+static pcre2_code *pcre_pattern; - - /**/ - static int -@@ -54,8 +54,8 @@ zpcre_utf8_enabled(void) - return 0; - - if ((have_utf8_pcre == -1) && -- (pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre))) { -- have_utf8_pcre = -2; /* erk, failed to ask */ -+ (pcre2_config(PCRE2_CONFIG_UNICODE, &have_utf8_pcre))) { -+ have_utf8_pcre = -2; /* erk, failed to ask */ - } - - return (have_utf8_pcre == 1) && (!strcmp(nl_langinfo(CODESET), "UTF-8")); -@@ -69,115 +69,87 @@ zpcre_utf8_enabled(void) - static int - bin_pcre_compile(char *nam, char **args, Options ops, UNUSED(int func)) - { -- int pcre_opts = 0, pcre_errptr, target_len; -- const char *pcre_error; -+ uint32_t pcre_opts = 0; -+ int target_len; -+ int pcre_error; -+ PCRE2_SIZE pcre_offset; - char *target; - -- if(OPT_ISSET(ops,'a')) pcre_opts |= PCRE_ANCHORED; -- if(OPT_ISSET(ops,'i')) pcre_opts |= PCRE_CASELESS; -- if(OPT_ISSET(ops,'m')) pcre_opts |= PCRE_MULTILINE; -- if(OPT_ISSET(ops,'x')) pcre_opts |= PCRE_EXTENDED; -- if(OPT_ISSET(ops,'s')) pcre_opts |= PCRE_DOTALL; -+ if (OPT_ISSET(ops, 'a')) pcre_opts |= PCRE2_ANCHORED; -+ if (OPT_ISSET(ops, 'i')) pcre_opts |= PCRE2_CASELESS; -+ if (OPT_ISSET(ops, 'm')) pcre_opts |= PCRE2_MULTILINE; -+ if (OPT_ISSET(ops, 'x')) pcre_opts |= PCRE2_EXTENDED; -+ if (OPT_ISSET(ops, 's')) pcre_opts |= PCRE2_DOTALL; - - if (zpcre_utf8_enabled()) -- pcre_opts |= PCRE_UTF8; -- --#ifdef HAVE_PCRE_STUDY -- if (pcre_hints) --#ifdef PCRE_CONFIG_JIT -- pcre_free_study(pcre_hints); --#else -- pcre_free(pcre_hints); --#endif -- pcre_hints = NULL; --#endif -+ pcre_opts |= PCRE2_UTF; - - if (pcre_pattern) -- pcre_free(pcre_pattern); -+ pcre2_code_free(pcre_pattern); - pcre_pattern = NULL; - - target = ztrdup(*args); - unmetafy(target, &target_len); - -- if ((int)strlen(target) != target_len) { -- zwarnnam(nam, "embedded NULs in PCRE pattern terminate pattern"); -- } -- -- pcre_pattern = pcre_compile(target, pcre_opts, &pcre_error, &pcre_errptr, NULL); -+ pcre_pattern = pcre2_compile((PCRE2_SPTR) target, (PCRE2_SIZE) target_len, -+ pcre_opts, &pcre_error, &pcre_offset, NULL); - - free(target); - - if (pcre_pattern == NULL) - { -- zwarnnam(nam, "error in regex: %s", pcre_error); -+ PCRE2_UCHAR buffer[256]; -+ pcre2_get_error_message(pcre_error, buffer, sizeof(buffer)); -+ zwarnnam(nam, "error in regex: %s", buffer); - return 1; - } - - return 0; - } - --/**/ --#ifdef HAVE_PCRE_STUDY -- - /**/ - static int - bin_pcre_study(char *nam, UNUSED(char **args), UNUSED(Options ops), UNUSED(int func)) - { -- const char *pcre_error; -- - if (pcre_pattern == NULL) - { - zwarnnam(nam, "no pattern has been compiled for study"); - return 1; - } -- -- if (pcre_hints) --#ifdef PCRE_CONFIG_JIT -- pcre_free_study(pcre_hints); --#else -- pcre_free(pcre_hints); --#endif -- pcre_hints = NULL; - -- pcre_hints = pcre_study(pcre_pattern, 0, &pcre_error); -- if (pcre_error != NULL) -- { -- zwarnnam(nam, "error while studying regex: %s", pcre_error); -- return 1; -+ int jit = 0; -+ if (!pcre2_config(PCRE2_CONFIG_JIT, &jit) && jit) { -+ if (pcre2_jit_compile(pcre_pattern, PCRE2_JIT_COMPLETE) < 0) { -+ zwarnnam(nam, "error while studying regex"); -+ return 1; -+ } - } - - return 0; - } - --/**/ --#else /* !HAVE_PCRE_STUDY */ -- --# define bin_pcre_study bin_notavail -- --/**/ --#endif /* !HAVE_PCRE_STUDY */ -- --/**/ - static int --zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, -- char *substravar, int want_offset_pair, int matchedinarr, -- int want_begin_end) -+zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count, -+ char *matchvar, char *substravar, int want_offset_pair, -+ int matchedinarr, int want_begin_end) - { -- char **captures, *match_all, **matches; -+ PCRE2_SIZE *ovec; -+ char *match_all, **matches; - char offset_all[50]; - int capture_start = 1; - - if (matchedinarr) { -- /* bash-style captures[0] entire-matched string in the array */ -+ /* bash-style ovec[0] entire-matched string in the array */ - capture_start = 0; - } - -- /* captures[0] will be entire matched string, [1] first substring */ -- if (!pcre_get_substring_list(arg, ovec, captured_count, (const char ***)&captures)) { -- int nelem = arrlen(captures)-1; -+ /* ovec[0] will be entire matched string, [1] first substring */ -+ ovec = pcre2_get_ovector_pointer(mdata); -+ if (ovec) { -+ int nelem = captured_count - 1; - /* Set to the offsets of the complete match */ - if (want_offset_pair) { -- sprintf(offset_all, "%d %d", ovec[0], ovec[1]); -+ sprintf(offset_all, "%ld %ld", ovec[0], ovec[1]); - setsparam("ZPCRE_OP", ztrdup(offset_all)); - } - /* -@@ -186,7 +158,7 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, - * ovec is length 2*(1+capture_list_length) - */ - if (matchvar) { -- match_all = metafy(captures[0], ovec[1] - ovec[0], META_DUP); -+ match_all = metafy(arg + ovec[0], ovec[1] - ovec[0], META_DUP); - setsparam(matchvar, match_all); - } - /* -@@ -201,16 +173,12 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, - */ - if (substravar && - (!want_begin_end || nelem)) { -- char **x, **y; -+ char **x; - int vec_off, i; -- y = &captures[capture_start]; - matches = x = (char **) zalloc(sizeof(char *) * (captured_count+1-capture_start)); -- for (i = capture_start; i < captured_count; i++, y++) { -+ for (i = capture_start; i < captured_count; i++) { - vec_off = 2*i; -- if (*y) -- *x++ = metafy(*y, ovec[vec_off+1]-ovec[vec_off], META_DUP); -- else -- *x++ = NULL; -+ *x++ = metafy(arg + ovec[vec_off], ovec[vec_off+1]-ovec[vec_off], META_DUP); - } - *x = NULL; - setaparam(substravar, matches); -@@ -247,7 +215,8 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, - setiparam("MEND", offs + !isset(KSHARRAYS) - 1); - if (nelem) { - char **mbegin, **mend, **bptr, **eptr; -- int i, *ipair; -+ int i; -+ size_t *ipair; - - bptr = mbegin = zalloc(sizeof(char*)*(nelem+1)); - eptr = mend = zalloc(sizeof(char*)*(nelem+1)); -@@ -287,8 +256,6 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar, - setaparam("mend", mend); - } - } -- -- pcre_free_substring_list((const char **)captures); - } - - return 0; -@@ -314,7 +281,8 @@ getposint(char *instr, char *nam) - static int - bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) - { -- int ret, capcount, *ovec, ovecsize, c; -+ int ret, c; -+ pcre2_match_data *pcre_mdata = NULL; - char *matched_portion = NULL; - char *plaintext = NULL; - char *receptacle = NULL; -@@ -344,36 +312,30 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) - /* For the entire match, 'Return' the offset byte positions instead of the matched string */ - if(OPT_ISSET(ops,'b')) want_offset_pair = 1; - -- if ((ret = pcre_fullinfo(pcre_pattern, pcre_hints, PCRE_INFO_CAPTURECOUNT, &capcount))) -- { -- zwarnnam(nam, "error %d in fullinfo", ret); -- return 1; -- } -- -- ovecsize = (capcount+1)*3; -- ovec = zalloc(ovecsize*sizeof(int)); -- - plaintext = ztrdup(*args); - unmetafy(plaintext, &subject_len); - - if (offset_start > 0 && offset_start >= subject_len) -- ret = PCRE_ERROR_NOMATCH; -- else -- ret = pcre_exec(pcre_pattern, pcre_hints, plaintext, subject_len, offset_start, 0, ovec, ovecsize); -+ ret = PCRE2_ERROR_NOMATCH; -+ else { -+ pcre_mdata = pcre2_match_data_create_from_pattern(pcre_pattern, NULL); -+ ret = pcre2_match(pcre_pattern, (PCRE2_SPTR) plaintext, subject_len, -+ offset_start, 0, pcre_mdata, NULL); -+ } - - if (ret==0) return_value = 0; -- else if (ret==PCRE_ERROR_NOMATCH) /* no match */; -+ else if (ret == PCRE2_ERROR_NOMATCH) /* no match */; - else if (ret>0) { -- zpcre_get_substrings(plaintext, ovec, ret, matched_portion, receptacle, -+ zpcre_get_substrings(plaintext, pcre_mdata, ret, matched_portion, receptacle, - want_offset_pair, 0, 0); - return_value = 0; - } - else { -- zwarnnam(nam, "error in pcre_exec [%d]", ret); -+ zwarnnam(nam, "error in pcre2_match [%d]", ret); - } - -- if (ovec) -- zfree(ovec, ovecsize*sizeof(int)); -+ if (pcre_mdata) -+ pcre2_match_data_free(pcre_mdata); - zsfree(plaintext); - - return return_value; -@@ -383,17 +345,19 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func)) - static int - cond_pcre_match(char **a, int id) - { -- pcre *pcre_pat; -- const char *pcre_err; -+ pcre2_code *pcre_pat = NULL; -+ int pcre_err; -+ PCRE2_SIZE pcre_erroff; - char *lhstr, *rhre, *lhstr_plain, *rhre_plain, *avar, *svar; -- int r = 0, pcre_opts = 0, pcre_errptr, capcnt, *ov, ovsize; -+ int r = 0, pcre_opts = 0; -+ pcre2_match_data *pcre_mdata = NULL; - int lhstr_plain_len, rhre_plain_len; - int return_value = 0; - - if (zpcre_utf8_enabled()) -- pcre_opts |= PCRE_UTF8; -+ pcre_opts |= PCRE2_UTF; - if (isset(REMATCHPCRE) && !isset(CASEMATCH)) -- pcre_opts |= PCRE_CASELESS; -+ pcre_opts |= PCRE2_CASELESS; - - lhstr = cond_str(a,0,0); - rhre = cond_str(a,1,0); -@@ -401,9 +365,6 @@ cond_pcre_match(char **a, int id) - rhre_plain = ztrdup(rhre); - unmetafy(lhstr_plain, &lhstr_plain_len); - unmetafy(rhre_plain, &rhre_plain_len); -- pcre_pat = NULL; -- ov = NULL; -- ovsize = 0; - - if (isset(BASHREMATCH)) { - svar = NULL; -@@ -415,27 +376,27 @@ cond_pcre_match(char **a, int id) - - switch(id) { - case CPCRE_PLAIN: -- if ((int)strlen(rhre_plain) != rhre_plain_len) { -- zwarn("embedded NULs in PCRE pattern terminate pattern"); -- } -- pcre_pat = pcre_compile(rhre_plain, pcre_opts, &pcre_err, &pcre_errptr, NULL); -- if (pcre_pat == NULL) { -- zwarn("failed to compile regexp /%s/: %s", rhre, pcre_err); -+ if (!(pcre_pat = pcre2_compile((PCRE2_SPTR) rhre_plain, -+ (PCRE2_SIZE) rhre_plain_len, pcre_opts, -+ &pcre_err, &pcre_erroff, NULL))) -+ { -+ PCRE2_UCHAR buffer[256]; -+ pcre2_get_error_message(pcre_err, buffer, sizeof(buffer)); -+ zwarn("failed to compile regexp /%s/: %s", rhre, buffer); - break; - } -- pcre_fullinfo(pcre_pat, NULL, PCRE_INFO_CAPTURECOUNT, &capcnt); -- ovsize = (capcnt+1)*3; -- ov = zalloc(ovsize*sizeof(int)); -- r = pcre_exec(pcre_pat, NULL, lhstr_plain, lhstr_plain_len, 0, 0, ov, ovsize); -- /* r < 0 => error; r==0 match but not enough size in ov -+ pcre_mdata = pcre2_match_data_create_from_pattern(pcre_pat, NULL); -+ r = pcre2_match(pcre_pat, (PCRE2_SPTR8) lhstr_plain, lhstr_plain_len, -+ 0, 0, pcre_mdata, NULL); -+ /* r < 0 => error; r==0 match but not enough size in match data - * r > 0 => (r-1) substrings found; r==1 => no substrings - */ - if (r==0) { -- zwarn("reportable zsh problem: pcre_exec() returned 0"); -+ zwarn("reportable zsh problem: pcre2_match() returned 0"); - return_value = 1; - break; - } -- else if (r==PCRE_ERROR_NOMATCH) { -+ else if (r == PCRE2_ERROR_NOMATCH) { - return_value = 0; /* no match */ - break; - } -@@ -444,7 +405,7 @@ cond_pcre_match(char **a, int id) - break; - } - else if (r>0) { -- zpcre_get_substrings(lhstr_plain, ov, r, svar, avar, 0, -+ zpcre_get_substrings(lhstr_plain, pcre_mdata, r, svar, avar, 0, - isset(BASHREMATCH), - !isset(BASHREMATCH)); - return_value = 1; -@@ -457,10 +418,10 @@ cond_pcre_match(char **a, int id) - free(lhstr_plain); - if(rhre_plain) - free(rhre_plain); -+ if (pcre_mdata) -+ pcre2_match_data_free(pcre_mdata); - if (pcre_pat) -- pcre_free(pcre_pat); -- if (ov) -- zfree(ov, ovsize*sizeof(int)); -+ pcre2_code_free(pcre_pat); - - return return_value; - } -@@ -489,11 +450,11 @@ static struct builtin bintab[] = { - - static struct features module_features = { - bintab, sizeof(bintab)/sizeof(*bintab), --#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC) -+#if defined(HAVE_PCRE2_COMPILE_8) && defined(HAVE_PCRE2_H) - cotab, sizeof(cotab)/sizeof(*cotab), --#else /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */ -+#else /* !(HAVE_PCRE2_COMPILE_8 && HAVE_PCRE2_H) */ - NULL, 0, --#endif /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */ -+#endif /* !(HAVE_PCRE2_COMPILE_8 && HAVE_PCRE2_H) */ - NULL, 0, - NULL, 0, - 0 -@@ -540,19 +501,9 @@ cleanup_(Module m) - int - finish_(UNUSED(Module m)) - { --#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC) --#ifdef HAVE_PCRE_STUDY -- if (pcre_hints) --#ifdef PCRE_CONFIG_JIT -- pcre_free_study(pcre_hints); --#else -- pcre_free(pcre_hints); --#endif -- pcre_hints = NULL; --#endif -- -+#if defined(HAVE_PCRE2_COMPILE_8) && defined(HAVE_PCRE2_H) - if (pcre_pattern) -- pcre_free(pcre_pattern); -+ pcre2_code_free(pcre_pattern); - pcre_pattern = NULL; - #endif - -diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst -index 22a0b64c7..6eb366964 100644 ---- a/Test/V07pcre.ztst -+++ b/Test/V07pcre.ztst -@@ -117,12 +117,17 @@ - >78884; ZPCRE_OP: 25 30 - >90210; ZPCRE_OP: 31 36 - --# Embedded NULs allowed in plaintext, but not in RE (although \0 as two-chars allowed) -+# Embedded NULs allowed in plaintext, in RE, pcre supports \0 as two-chars - [[ $'a\0bc\0d' =~ '^(a\0.)(.+)$' ]] - print "${#MATCH}; ${#match[1]}; ${#match[2]}" - 0:ensure ASCII NUL passes in and out of matched plaintext - >6; 3; 3 - -+# PCRE2 supports NULs also in the RE -+ [[ $'a\0b\0c' =~ $'^(.\0)+' ]] && print "${#MATCH}; ${#match[1]}" -+0:ensure ASCII NUL works also in the regex -+>4; 2 -+ - # Ensure the long-form infix operator works - [[ foo -pcre-match ^f..$ ]] - print $? -@@ -169,7 +174,11 @@ - [[ é =~ '^..\z' ]]; echo $? - LANG=$LANG_SAVE - [[ é =~ '^.\z' ]]; echo $? --0:swich between C/UTF-8 locales -+0:switch between C/UTF-8 locales - >0 - >0 - >0 -+ -+ [[ abc =~ 'a(d*)bc' ]] && print "$#MATCH; $#match; ${#match[1]}" -+0:empty capture -+>3; 1; 0 -diff --git a/configure.ac b/configure.ac -index d8a17791a..4710d1659 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -438,7 +438,7 @@ fi], - - dnl Do you want to look for pcre support? - AC_ARG_ENABLE(pcre, --AS_HELP_STRING([--enable-pcre],[enable the search for the pcre library (may create run-time library dependencies)])) -+AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library (may create run-time library dependencies)])) - - dnl Do you want to look for capability support? - AC_ARG_ENABLE(cap, -@@ -652,13 +652,12 @@ AC_HEADER_SYS_WAIT - - oldcflags="$CFLAGS" - if test x$enable_pcre = xyes; then --AC_CHECK_PROG([PCRECONF], pcre-config, pcre-config) --dnl Typically (meaning on this single RedHat 9 box in front of me) --dnl pcre-config --cflags produces a -I output which needs to go into -+AC_CHECK_PROG([PCRECONF], pcre2-config, pcre2-config) -+dnl pcre2-config --cflags may produce a -I output which needs to go into - dnl CPPFLAGS else configure's preprocessor tests don't pick it up, - dnl producing a warning. --if test "x$ac_cv_prog_PCRECONF" = xpcre-config; then -- CPPFLAGS="$CPPFLAGS `pcre-config --cflags`" -+if test "x$ac_cv_prog_PCRECONF" = xpcre2-config; then -+ CPPFLAGS="$CPPFLAGS `pcre2-config --cflags`" - fi - fi - -@@ -668,9 +667,10 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \ - locale.h errno.h stdio.h stdarg.h varargs.h stdlib.h \ - unistd.h sys/capability.h \ - utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \ -- netinet/in_systm.h pcre.h langinfo.h wchar.h stddef.h \ -+ netinet/in_systm.h langinfo.h wchar.h stddef.h \ - sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \ - ncurses/ncurses.h) -+AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8]) - if test x$dynamic = xyes; then - AC_CHECK_HEADERS(dlfcn.h) - AC_CHECK_HEADERS(dl.h) -@@ -948,9 +948,7 @@ if test "x$ac_found_iconv" = "xyes"; then - fi - - if test x$enable_pcre = xyes; then --dnl pcre-config should probably be employed here --dnl AC_SEARCH_LIBS(pcre_compile, pcre) -- LIBS="`$ac_cv_prog_PCRECONF --libs` $LIBS" -+ LIBS="`$ac_cv_prog_PCRECONF --libs8` $LIBS" - fi - - dnl --------------------- -@@ -1313,7 +1311,7 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \ - pathconf sysconf \ - tgetent tigetflag tigetnum tigetstr setupterm initscr resize_term \ - getcchar setcchar waddwstr wget_wch win_wch use_default_colors \ -- pcre_compile pcre_study pcre_exec \ -+ pcre2_compile_8 \ - nl_langinfo \ - erand48 open_memstream \ - posix_openpt \ --- -2.41.0 - -From 10bdbd8b5b0b43445aff23dcd412f25cf6aa328a Mon Sep 17 00:00:00 2001 -From: Jun-ichi Takimoto -Date: Tue, 20 Jun 2023 18:14:27 +0900 -Subject: [PATCH] 51877: do not build pcre module if pcre2-config is not found - - Cherry-picked-by: Lukáš Zaoral ---- - Src/Modules/pcre.mdd | 2 +- - configure.ac | 31 +++++++++++++++++++------------ - 2 files changed, 20 insertions(+), 13 deletions(-) - -diff --git a/Src/Modules/pcre.mdd b/Src/Modules/pcre.mdd -index 6eb3c691b..3e1579117 100644 ---- a/Src/Modules/pcre.mdd -+++ b/Src/Modules/pcre.mdd -@@ -1,5 +1,5 @@ - name=zsh/pcre --link=`if test x$enable_pcre = xyes && (pcre-config --version >/dev/null 2>/dev/null); then echo dynamic; else echo no; fi` -+link=`if test x$enable_pcre = xyes; then echo dynamic; else echo no; fi` - load=no - - autofeatures="b:pcre_compile b:pcre_study b:pcre_match" -diff --git a/configure.ac b/configure.ac -index ba76f9a60..c5263035e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -440,6 +440,17 @@ dnl Do you want to look for pcre support? - AC_ARG_ENABLE(pcre, - AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library (may create run-time library dependencies)])) - -+AC_ARG_VAR(PCRE_CONFIG, [pathname of pcre2-config if it is not in PATH]) -+if test "x$enable_pcre" = xyes; then -+ AC_CHECK_PROG([PCRE_CONFIG], pcre2-config, pcre2-config) -+ if test "x$PCRE_CONFIG" = x; then -+ enable_pcre=no -+ AC_MSG_WARN([pcre2-config not found: pcre module is disabled.]) -+ AC_MSG_NOTICE( -+ [Set PCRE_CONFIG to pathname of pcre2-config if it is not in PATH.]) -+ fi -+fi -+ - dnl Do you want to look for capability support? - AC_ARG_ENABLE(cap, - AS_HELP_STRING([--enable-cap],[enable the search for POSIX capabilities (may require additional headers to be added by hand)])) -@@ -655,15 +666,12 @@ AC_HEADER_DIRENT - AC_HEADER_STAT - AC_HEADER_SYS_WAIT - --oldcflags="$CFLAGS" --if test x$enable_pcre = xyes; then --AC_CHECK_PROG([PCRECONF], pcre2-config, pcre2-config) - dnl pcre2-config --cflags may produce a -I output which needs to go into - dnl CPPFLAGS else configure's preprocessor tests don't pick it up, - dnl producing a warning. --if test "x$ac_cv_prog_PCRECONF" = xpcre2-config; then -- CPPFLAGS="$CPPFLAGS `pcre2-config --cflags`" --fi -+if test "x$enable_pcre" = xyes; then -+ CPPFLAGS="`$PCRE_CONFIG --cflags` $CPPFLAGS" -+ AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8]) - fi - - AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \ -@@ -675,7 +683,6 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \ - netinet/in_systm.h langinfo.h wchar.h stddef.h \ - sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \ - ncurses/ncurses.h) --AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8]) - if test x$dynamic = xyes; then - AC_CHECK_HEADERS(dlfcn.h) - AC_CHECK_HEADERS(dl.h) -@@ -952,10 +959,6 @@ if test "x$ac_found_iconv" = "xyes"; then - [Define as const if the declaration of iconv() needs const.]) - fi - --if test x$enable_pcre = xyes; then -- LIBS="`$ac_cv_prog_PCRECONF --libs8` $LIBS" --fi -- - dnl --------------------- - dnl CHECK TERMCAP LIBRARY - dnl --------------------- -@@ -1316,7 +1319,6 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \ - pathconf sysconf \ - tgetent tigetflag tigetnum tigetstr setupterm initscr resize_term \ - getcchar setcchar waddwstr wget_wch win_wch use_default_colors \ -- pcre2_compile_8 \ - nl_langinfo \ - erand48 open_memstream \ - posix_openpt \ -@@ -1371,6 +1373,11 @@ if test x$zsh_cv_func_realpath_accepts_null = xyes; then - AC_DEFINE(REALPATH_ACCEPTS_NULL) - fi - -+if test x$enable_pcre = xyes; then -+ LIBS="`$PCRE_CONFIG --libs8` $LIBS" -+ AC_CHECK_FUNCS(pcre2_compile_8) -+fi -+ - if test x$enable_cap = xyes; then - AC_CHECK_FUNCS(cap_get_proc) - fi --- -2.42.0 - diff --git a/0006-zsh-support-texinfo-7.0.patch b/0006-zsh-support-texinfo-7.0.patch deleted file mode 100644 index c68bd26..0000000 --- a/0006-zsh-support-texinfo-7.0.patch +++ /dev/null @@ -1,53 +0,0 @@ -From ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 Mon Sep 17 00:00:00 2001 -From: Jun-ichi Takimoto -Date: Mon, 19 Jun 2023 11:19:25 +0900 -Subject: [PATCH] 51862: support texinfo-7.0 - -Upstream-commit: ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 -Cherry-picked-by: Lukáš Zaoral ---- - Doc/Makefile.in | 3 ++- - configure.ac | 5 +++++ - 2 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/Doc/Makefile.in b/Doc/Makefile.in -index 136b080d6..dabe11fe3 100644 ---- a/Doc/Makefile.in -+++ b/Doc/Makefile.in -@@ -43,6 +43,7 @@ TEXI2DVI = @TEXI2DVI@ - DVIPS = dvips - TEXI2PDF = @TEXI2PDF@ - TEXI2HTML = @TEXI2HTML@ -+SET_TEXI2ANY_VAR = @SET_TEXI2ANY_VAR@ - PAPERSIZE = @PAPERSIZE@ - - .SUFFIXES: .yo .1 -@@ -266,7 +267,7 @@ texi2html.conf: $(sdir_top)/Config/version.mk - d=`echo $(VERSION_DATE)`; \ - v="Zsh version $(VERSION), released on $$d."; \ - case '$(TEXI2HTML)' in \ -- *texi2any*) echo "set_from_init_file('PRE_BODY_CLOSE','$$v');" ;; \ -+ *texi2any*) echo "$(SET_TEXI2ANY_VAR)('PRE_BODY_CLOSE','$$v');" ;; \ - *) echo "\$$PRE_BODY_CLOSE = '$$v';" ;; \ - esac > $@ - -diff --git a/configure.ac b/configure.ac -index 4710d1659..ba76f9a60 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -623,7 +623,12 @@ fi - - if test x"$TEXI2HTML" = xtexi2any; then - TEXI2HTML='texi2any -c TEXI2HTML=1' -+ case `texi2any --version 2>/dev/null | sed -e 's/^.*) *//' -e 1q` in -+ [[1-6]].*) SET_TEXI2ANY_VAR=set_from_init_file ;; -+ *) SET_TEXI2ANY_VAR=texinfo_set_from_init_file ;; -+ esac - fi -+AC_SUBST(SET_TEXI2ANY_VAR) - - case "$LC_PAPER" in - ??_US*) PAPERSIZE=us ;; --- -2.42.0 - diff --git a/0007-zsh-configure-c99.patch b/0007-zsh-configure-c99.patch deleted file mode 100644 index c4b3623..0000000 --- a/0007-zsh-configure-c99.patch +++ /dev/null @@ -1,44 +0,0 @@ -Avoid incompatible pointer types in terminfo global variable checks. -Some compilers reject these incompatible pointer types, causing the -checks to always fail, when these variables are in fact available. - -Submitted upstream: - -diff --git a/configure.ac b/configure.ac -index a58242f453b4a8f3..5534f42df14eb28c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1769,27 +1769,27 @@ if test x$zsh_cv_path_term_header != xnone; then - fi - - AC_MSG_CHECKING(if boolcodes is available) -- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no]) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no]) - AC_MSG_RESULT($boolcodes) - - AC_MSG_CHECKING(if numcodes is available) -- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no]) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no]) - AC_MSG_RESULT($numcodes) - - AC_MSG_CHECKING(if strcodes is available) -- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no]) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no]) - AC_MSG_RESULT($strcodes) - - AC_MSG_CHECKING(if boolnames is available) -- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no]) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no]) - AC_MSG_RESULT($boolnames) - - AC_MSG_CHECKING(if numnames is available) -- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no]) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no]) - AC_MSG_RESULT($numnames) - - AC_MSG_CHECKING(if strnames is available) -- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no]) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no]) - AC_MSG_RESULT($strnames) - - dnl There are apparently defective terminal library headers on some diff --git a/0008-zsh-deletefilelist-segfault.patch b/0008-zsh-deletefilelist-segfault.patch deleted file mode 100644 index 8abaab1..0000000 --- a/0008-zsh-deletefilelist-segfault.patch +++ /dev/null @@ -1,42 +0,0 @@ -From d3edf318306e37d2d96c4e4ea442d10207722e94 Mon Sep 17 00:00:00 2001 -From: Bart Schaefer -Date: Sun, 12 Feb 2023 09:52:39 -0800 -Subject: [PATCH] 51404: Nullify filelist after deleting (fix segfault) - -Cherry-picked-by: Lukáš Zaoral -Upstream-commit: d3edf318306e37d2d96c4e4ea442d10207722e94 ---- - Src/jobs.c | 8 ++++++-- - 1 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/Src/jobs.c b/Src/jobs.c -index 4863962b9..59ddd952e 100644 ---- a/Src/jobs.c -+++ b/Src/jobs.c -@@ -1372,8 +1372,10 @@ cleanfilelists(void) - - DPUTS(shell_exiting >= 0, "BUG: cleanfilelists() before exit"); - -- for (i = 1; i <= maxjob; i++) -+ for (i = 1; i <= maxjob; i++) { - deletefilelist(jobtab[i].filelist, 0); -+ jobtab[i].filelist = 0; -+ } - } - - /**/ -@@ -1531,8 +1533,10 @@ havefiles(void) - int i; - - for (i = 1; i <= maxjob; i++) -- if (jobtab[i].stat && jobtab[i].filelist) -+ if (jobtab[i].stat && jobtab[i].filelist && -+ peekfirst(jobtab[i].filelist)) { - return 1; -+ } - return 0; - - } --- -2.43.0 - diff --git a/0009-zsh-support-dnf5.patch b/0009-zsh-support-dnf5.patch deleted file mode 100644 index 8e55aa0..0000000 --- a/0009-zsh-support-dnf5.patch +++ /dev/null @@ -1,846 +0,0 @@ -commit b70b241cc5ca88cc129ff9ba14f8af2e889b90e6 -Author: Jun-ichi Takimoto -Date: Thu Nov 21 12:26:51 2024 +0900 - - 53238 (+53239 Mikael): support dnf5 - - some options etc for dnf4 are also updated - -diff --git a/Completion/Redhat/Command/_dnf b/Completion/Redhat/Command/_dnf -index a5edf8564..c41795adf 100644 ---- a/Completion/Redhat/Command/_dnf -+++ b/Completion/Redhat/Command/_dnf -@@ -1,7 +1,11 @@ --#compdef dnf dnf-2 dnf-3 --# --# based on dnf-4.2.18 --# -+#compdef dnf dnf-2 dnf-3 dnf4 -+# based on dnf-4.21.1 -+ -+# avoid 'dnf --version' since it's rather slow for dnf4 -+if [[ $service = dnf && $commands[dnf]:P = */dnf5 ]]; then -+ _dnf5 "$@" && return 0 -+ return 1 -+fi - - _dnf_helper() { - # Get the pathname of the python executable from the 1st line of dnf-2/dnf-3. -@@ -68,25 +72,23 @@ _dnf_packages_or_rpms() { - fi - } - --_dnf_groups_caching_policy() { -- # TODO: Are there any reliable ways to validate the cache? -- local -a newer=( "$1"(Nmw-1) ) # rebuild if more than a week old -- return $#newer --} -- - _dnf_groups() { -- local package_groups update_policy expl -- zstyle -s ":completion:${curcontext}:" cache-policy update_policy -- if [[ -z "$update_policy" ]]; then -- zstyle ":completion:${curcontext}:" cache-policy _dnf_groups_caching_policy -- fi -- if _cache_invalid dnf-groups || ! _retrieve_cache dnf-groups; then -- # this can be very slow -- package_groups=( ${${${(M)${(f)"$(_call_program package-groups \ -- $service group list -v 2>/dev/null)"}:# *}#*\(}%\)*} ) -- _store_cache dnf-groups package_groups -- fi -- _wanted package-groups expl 'package group' compadd "$@" -a package_groups -+ # optional option: -T (available|installed) -+ local selected line groups section=none -+ zparseopts -D -E - T:=selected -+ selected=$selected[2] -+ [[ -z $selected ]] && selected=all -+ # XXX hidden groups are not included. -+ # --installed and --available can't be specified with --hidden -+ for line in ${(f)"$(_call_program package-groups -+ $service group list --$selected -qCv 2>/dev/null)"}; do -+ # a line for each group is of the following form: -+ # ' description of the group (group-id)' -+ if [[ $line = \ ##(#b)(*)\(([-_[:alnum:]]#)\) ]]; then -+ groups+=( "${match[2]}:${match[1]}" ) -+ fi -+ done -+ _describe -t groups "$selected group" groups - } - - _dnf_repoquery() { -@@ -194,7 +196,7 @@ _dnf_repository_packages() { - fi - } - --_dnf() { -+_dnf4() { - local cache_file="/var/cache/dnf/packages.db" - local -a opts=( - '(-6)-4[resolve to IPv4 addresses only]' -@@ -226,7 +228,7 @@ _dnf() { - '*'{-x+,--exclude=}'[exclude specified packages]: : _sequence _dnf_packages -T all' - '--forcearch=[force the use of the specified arch]:arch: ' - '(-)'{-h,--help}'[show the help message]' -- '--installroot=[set install root]:directory:_files -/' -+ '--installroot=[set install root]:directory:_files -/ -g "/*"' - '--newpackage[include newpackage relevant packages]' - '--noautoremove[disable removal of dependencies that are no longer used]' - '--nobest[do not limit transactions to best candidates]' -@@ -289,18 +291,21 @@ _dnf_command() { - if (( CURRENT == 1 )); then - _describe -t dnf-commands 'dnf command' dnf_cmds - else -- local curcontext=$curcontext cur=$words[CURRENT] cmd tmp expl ret=1 -+ local cur=$words[CURRENT] cmd=$words[1] tmp expl ret=1 - # Deal with aliases (not comprehensive) -- case $words[1] in -+ case $cmd in - check-updgrade) cmd=check-update;; - distrosync|dsync) cmd=distro-sync;; - dg) cmd=downgrade;; -+ dsync) cmd=distro-sync;; - erase|rm) cmd=remove;; - groups|grp) cmd=group;; - hist) cmd=history;; - in) cmd=install;; -+ if) cmd=info;; -+ ls) cmd=list;; - mc) cmd=makecache;; -- prov|whatprovides) cmd=provides;; -+ prov|whatprovides|wp) cmd=provides;; - rei) cmd=reinstall;; - repoinfo) cmd=repolist;; - rq) cmd=repoquery;; -@@ -308,9 +313,9 @@ _dnf_command() { - sh) cmd=shell;; - update|up) cmd=upgrade;; - update-minimal|up-min) cmd=upgrade-minimal;; -- *) cmd="${${dnf_cmds[(r)$words[1]:*]%%:*}}";; -+ upif) cmd=updateinfo;; - esac -- (( $#cmd )) && curcontext="${curcontext%:*:*}:dnf-${cmd}:" -+ local curcontext="${curcontext%:*:*}:dnf-${cmd}:" - - case $cmd in - alias) -@@ -337,11 +342,9 @@ _dnf_command() { - _describe -t options 'option' tmp && ret=0 - ;; - check-update) -- if [[ $cur = -* ]]; then -- _wanted options expl 'option' compadd - --changelogs && ret=0 -- else -- _dnf_packages -T installed && ret=0 -- fi -+ _arguments : \ -+ '--changelogs[also print changelog delta of packages]' \ -+ '*: :_dnf_packages -T installed' && ret=0 - ;; - clean) - tmp=( -@@ -368,23 +371,38 @@ _dnf_command() { - "mark:mark a group for installation or removal" - ) - _describe -t subcommands 'subcommand' tmp && ret=0 -- elif (( CURRENT == 3 )) && [[ $cur = -* ]]; then -- if [[ $words[2] == install ]]; then -- _wanted options expl 'option' compadd - --with-optional && ret=0 -- elif [[ $words[2] == list ]]; then -- tmp=( -- '--available:show only available groups' -- '--installed:show only installed groups' -- '--hidden:show also hidden groups' -- '--ids:show also ID of groups' -- ) -- _describe -t options 'option' tmp && ret=0 -- fi -- elif (( CURRENT == 3 )) && [[ $words[2] == mark ]]; then -- _wanted subcommands expl 'subcommand' \ -- compadd - install remove && ret=0 - else -- _dnf_groups && ret=0 -+ case $words[2] in -+ summary) -+ _arguments : '--hidden' '2: :_dnf_groups' && ret=0 -+ ;; -+ info) -+ _dnf_groups && ret=0 -+ ;; -+ install) -+ _arguments : '--with-optional[also include optional packages]' \ -+ '*: :_dnf_groups -T available' && ret=0 -+ ;; -+ list) -+ _arguments : \ -+ '(--installed)--available[show only available groups]' \ -+ '(--available)--installed[show only installed groups]' \ -+ '--hidden[show also hidden groups]' \ -+ {--ids,-v}'[show also ID of groups]' \ -+ '*: :_dnf_groups' && ret=0 -+ ;; -+ remove|upgrade) -+ _dnf_groups -T installed && ret=0 -+ ;; -+ mark) -+ if (( CURRENT == 3 )); then -+ _wanted subcommands expl 'subcommand' \ -+ compadd - install remove && ret=0 -+ else -+ _dnf_groups && ret=0 -+ fi -+ ;; -+ esac - fi - ;; - help) -@@ -399,13 +417,32 @@ _dnf_command() { - "list:list transactions" - "info:describe the given transactions" - "redo:repeat the specified transaction" -+ "replay:replay transaction stored in the specified file" - "rollback:undo all since the given transaction" -+ "store:store the specified transaction in file" - "undo:undo transactions" - "userinstalled:list all packages installed by users" - ) - _describe -t subcommands 'subcommand' tmp && ret=0 -- elif [[ $words[2] != userinstalled ]]; then -- _message 'transaction' && ret=0 -+ else -+ case $words[2] in -+ list) -+ _arguments : '--reverse[output history in reverse order]' \ -+ '*:transaction ID or ID..ID: ' && ret=0 ;; -+ info) -+ _message 'transaction ID or ID..ID' && ret=0 ;; -+ redo|rollback|undo) -+ _message 'transaction or package' && ret=0 ;; -+ replay) -+ _arguments : \ -+ "--ignore-installed[don't check for installed packages being in the same state as recorded in transaction]" \ -+ "--ignore-extras[don't check for extra packages pulled into the transaction on the target system]" \ -+ '--skip-unavailable[skip packages that are in transaction but not in target system]' \ -+ '2:transaction file:_files' && ret=0 ;; -+ store) -+ _arguments : {-o+,--output=}'[store in specified file]: :_files' \ -+ '2:transaction: ' && ret=0 ;; -+ esac - fi - ;; - info|list) -@@ -413,7 +450,7 @@ _dnf_command() { - if [[ $cur = -* ]]; then - tmp=( --all --available --installed --extras - --obsoletes --upgrades --autoremove --recent ) -- _wanted options expl 'option' compadd -a tmp -+ _wanted options expl 'option' compadd -a tmp && ret=0 - else - _dnf_packages -T all && ret=0 - fi -@@ -449,6 +486,7 @@ _dnf_command() { - tmp=( - 'install:install a module profile including its packages' - 'update:update packages associated with an active module stream' -+ 'switch-to:switch to a module stream and change versions of installed packages' - 'remove:remove installed module profiles and their packages' - 'enable:enable a module stream' - 'disable:disable a module with all its streams' -@@ -502,7 +540,7 @@ _dnf_command() { - _dnf_repoquery && ret=0 - ;; - repository-packages) -- _dnf_repository_packages -+ _dnf_repository_packages && ret=0 - ;; - search) - if [[ $cur = -* ]]; then -@@ -531,6 +569,7 @@ _dnf_command() { - '--list[display list of advisories]' - '--info[display detailed information of advisories]' - + '(availability)' -+ '-all[include advisories about any versions of installed packages]' - '--available[limit to advisories about newer versions of installed packages]' - '--installed[limit to advisories about equal or older versions of installed packages]' - '--updates[limit to advisories about newer and available versions of installed packages]' -@@ -548,4 +587,4 @@ _dnf_command() { - fi - } - --_dnf "$@" -+_dnf4 "$@" -diff --git a/Completion/Redhat/Command/_dnf5 b/Completion/Redhat/Command/_dnf5 -new file mode 100644 -index 000000000..e194dd5a7 ---- /dev/null -+++ b/Completion/Redhat/Command/_dnf5 -@@ -0,0 +1,570 @@ -+#compdef dnf5 -+# based on dnf-5.2.6.2 -+ -+# utility functions -+ -+_dnf5_helper() { -+ _call_program specs $service "${(q-)@}" "${(q-)PREFIX}\*" \ -+ -qC --assumeno --nogpgcheck 2>/dev/null command' '*:: :->cmd_args' && ret=0 -+ -+ case $state in -+ command) _dnf5_commands && ret=0 ;; -+ cmd_args) _dnf5_subcmds_opts && ret=0 ;; -+ esac -+ return ret -+} -+ -+_dnf5 "$@" diff --git a/0010-zsh-fix-dnf5-completion-with-rpm-files.patch b/0010-zsh-fix-dnf5-completion-with-rpm-files.patch deleted file mode 100644 index eacb810..0000000 --- a/0010-zsh-fix-dnf5-completion-with-rpm-files.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit 071e325c826a89b792056c3faf0c400b8c0c5738 -Author: Christoph Erhardt -Date: Tue Sep 30 08:47:15 2025 +0900 - - 53981: _dnf5: fix completion of local rpm files - -diff --git a/Completion/Redhat/Command/_dnf5 b/Completion/Redhat/Command/_dnf5 -index e194dd5a7..9cbf451a8 100644 ---- a/Completion/Redhat/Command/_dnf5 -+++ b/Completion/Redhat/Command/_dnf5 -@@ -38,7 +38,7 @@ _dnf5_rpm_files() { - - _dnf5_packages_or_rpms() { - if [[ "$words[CURRENT]" = (*/*|\~*) ]]; then # if looks like a path name -- _dnf_rpm_files -+ _dnf5_rpm_files - else - _dnf5_packages "$@" - fi diff --git a/sources b/sources index 747480c..bd494a5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zsh-5.9.tar.xz) = d9138b7f379ad942a5f46819d2dd52d31f3a1129f2a0d1b53d4c5cd43c318b60396da6d37c57c477b8e958fb750209aca0ae93f8c9dd42ac958de006a0ff067e -SHA512 (zsh-5.9.tar.xz.asc) = b6a72f8dfd2ed9c25e4afa5b3d13b23c1bf0bceacfce3ad0fadf24a9df91382914f7322ef4ed8bfb4b68818fb18fe3973d22154a6cc638b46f02e30bafd93fcb +SHA512 (zsh-5.9.1.tar.xz) = e16c13559262577e725b290c35ce6598d58c2acdd204eac619e8ed9b6a918bce39bfbf9d3ef4c5eb877af7d3279c8a4b15439eba6a38c4e4d47d5555d5f79872 +SHA512 (zsh-5.9.1.tar.xz.asc) = 8c9fb393de9b9ff84353ed35f812c8e05e6131c238fd233a2f6e3aa02b0644c7afd597a8b4e7a737152e4478d0d4dae7a5e42559047f100eb536049c4490ceeb diff --git a/zsh-keyring.asc b/zsh-keyring.asc new file mode 100644 index 0000000..da4b17f --- /dev/null +++ b/zsh-keyring.asc @@ -0,0 +1,269 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQENBFwswugBCADdkzua9HwC8Ip5zh7Z0/nJGKbMyq+cobXArhHos40taeidn0+v +HRES5y6PHR+h56c9TpmJEp/bLCHP5pLvcSz/ETz7+Kk82pld63pOHejSxAQCu7Wv +1NwrTu6TyKlZsNG1oZBxx2LkEN6k8Wy+88DlQqZoXOXafmhF+Sms6gv9DXa029sv +B07EehAx02T+b02QwVVG/Pq9austmsTd9EcNcVNRDneD2LcdxCllbS5IamjVa+NW +oeKZVqbsO71uUolwBvshFSBLPsSY8EZdGApjazQcY0lgkaRA/QlMOisyq2mjV6FY +JXHrlI3WWWK2vROjb35AHiHEE/EVgb5RVpxxABEBAAG0E2RhbmEgPGRhbmFAZGFu +YS5pcz6JAU4EEwEIADgWIQR8p+yq8GIWuQ+JQUas+BRsroy7xAUCXCzC6AIbAwUL +CQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRCs+BRsroy7xA5XB/93EQqzs0as07U+ +gmPDpvE7JwIY4TrcvAS7RHgJ4sE+arR5uTziHixiHBQQMedbfV51Jxgws6WL0Ko8 +7K8h9sN2UGnXIc1lWuQ2FDshrcpSHZvLxL4Z7WC3Rj/Dq3/nuZZyljWQNHxg4BlO +EJqe67F5kT2OI591oxB6L1E6F8sVsgxD7gBCPVl/8CsyZ7wkyW/gMRqrlYolJhpS +B5C1zKJzvULQJKXDCh9DUyi7cKFtPyYfYtRWfWhKGz5Dhtt9qvBlxJzZufZ9QNQt +oPhNGF34QaLWTCLRbtoVbNq2NlxalZ5Byhg/0pBcQc2w4C70jSxF3c+2oMEGQIbc +5GJFgLpZuQENBFwswugBCAD5rIYdlLWHOMw+stWTRNquu3SZr+v7RRzreV9fOKN+ +lUiqwicU2uCX39s/q+2wtF536r+IS/53DrMAW8sxf8eroK+MBnJYtP3U8BnB3mag +bTJXMjng2ZqZXvxzetXLyXR+38f+6WbJtV0ByDeFQQJYsFxOag3r6etxrzpwRFm0 +PL440fc0nxOxhxWWJcR0RKTMX87ymipi9mETYeZi7h9B3cDw8aIUz2O3s45TtNlA +NI1MNMU4sAsc5i+w0zJON9gT+rWDYFj6BiEqnRoSK2XDm+WaJa3FwgW1WnHPTe+E +RJFGT58DICU3ta6cCQPavZz/KALyj8GBJ+PydelIAv2rABEBAAGJATYEGAEIACAW +IQR8p+yq8GIWuQ+JQUas+BRsroy7xAUCXCzC6AIbDAAKCRCs+BRsroy7xOgxB/40 +sp9xFq8L/59yRTeXSskOsGk3aUlSnACofcRCGgDSXV5GwWJ/G0O8krhHOISJKuxc +vA0wLFq0WB/EafrKAPTSkrnxmq8noT3c8MpnFRSXHq3sOXkB4nqVEmUu/AAA0TbC +HcwhFQExvK7O+funxIGU5vqHFeQGJ0VcgC/KZUEMNtVV8aZGvn7JzSxEIwHVXGLu +5H7TnNWzLzkzIDVY9IJpTutsc6RMvv6BV8ooWBHSgzmh0MTqEjwNarHAMuffrAjE +zIO3qi0YCaxSDVf2jrWyYpB2QntplmUoubB9s/ngCqVb4A3B7JxPmJuL/0XMUThn +WZLWFpbLimyoUCfHoehZ +=dR/Y +-----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQGNBFG3TRkBDADMoFASLIMP9faxKf/R/rOrZKbBT7ExMXQT9cVjlQLBcjOtb3uv +63NNTbj/fBDoHbgAal4jOrKYQVPa0LDyT7K9mgj+WBhNZObPeDbmbUwCsrwC6y46 +CJokUc0JwtL0Qm1d8dvMgZ6TzO2J/ZRBAB+Bv+W5pVkV+3BifS8mhHLrwWaJD6s3 +Axxl9PPACG1NB5mlItUci7BK+JTI2Bw7whe+gtyuCn/aat4ny6NYgc74PtLz0uS/ +hG+4hFMKvZrPsflEY/H14GK1AutW8DFSjW6A+etnV9OBUemGz+0WoFOjE+AGHbuY +FQZYUcj/WZSVcxyK0GJbTa3/KbcOwqLd+xdIWLBybSboP0TAUelyok+1PLORlZnd +dwvE9cp1hEcEJj/hlmugR7aseG0Fb0txU9x3OnwYaiWbsjk7oLVynlcQGzGe58ID +SfdsA2ywhkuQO6q397QzNDPRnP92g++HZRm+bGl3U0ffk8Asqef5TLMZvURRMy// +8OQFjeMWaYCXlf0AEQEAAbQjRGFuaWVsIFNoYWhhZiA8ZGFuaWVsc2hAYXBhY2hl +Lm9yZz6JAhwEEAEKAAYFAlfjTwAACgkQ3+aRrjMbo9tB/A/6A9EjezO5C8mS5WJa +lz+dZWEeJF/75npCpRsuCO5wuTMY4ac5VlDR0HqBD7JJnR+vfz4Z26ErtyyMZmuu +xxj72efT2y4XiVAWXMrQfSR3pIxyTlnrR65QoOIUXU81+1jDgn/UvKZFDa5uipw7 +fNiNqgQ6OXL1O4kLsbLP9Pr8hreD1Pw0N+FC93La537qDP1bFLPC8Ygie55+YyAE +kWoPg0+6eSm+PI97qqA4roPPHC/srGjDZ9DG4xTwmBu9l3jZWnh9vwzKl15Ai1T4 +rJ5ipH6giR7/uhglBWl0CoqlGuHdyb4eQ6s3lpjHkxTT21vlvji2p0m1C0FB9JLd +lghqqLSCBLm40adJWyBes6bXv45UQK3sYubETCCXnM/c2AtshK+yZRv01Bung53X +aKdqAaPTZyE/HyLemwRCZHOb6WKfXIQdX8bTyoKk9MGllbxKBxs2x5oJG8JHocTN +zBVyUv+BJbgmSn64s+NuCf7XwRRMORmS79oLoykuCHe4D4CD7ZiqBz1ymqyWRUPG +lc8C5T5L/0YNa+5UacFwzphWwt6v2nVkl/wb2UVAt0WIu1Xqzq1ahc2FAnj9qAiS +PEfyGi5oSHzLAP1kQv5tq5MDyi02ZpWgAJGepxSMlj6NREiTf1r50FLk2hJLov+6 +mIYPm8KYy8vLDLOuwEEWJi77PHSJAb0EEwEKACcCGwMCHgECF4AFCwkIBwMFFQoJ +CAsFFgIDAQAFAls530kFCQ1E+SsACgkQpf7uOseTdESZwgv/U5ErAMH2LPM9z8QQ +WaUk4ZNQ3Ll3m+pwQ5/llXraws/9lDlX4Q21MR0e6JEZOUPxBsCQ2/qaAEN3jbWd +pyQX7xuCY+PmTUOOx3c0XTNAB64monM1ZxKYa5sEP6JPqURPEW5tyhoAYUKASuBd +j+ocK6t0IXGCGuF+gNt74qUi6R6L3gyiexMZAtMCpNFd5Nq8zn5E+oEpLIdUnzoi +zCemknlrqZfbSafEjhwp0ye6ci4M5FO+IGQBwuyhfybCNlrUWga19DTaPOFIbs/D +/8pyg3Boc5AhRISqWY0X3xfN/XX45B9iaAzp9gVW3v/NV5pQ7elwEXixChCWbWlG +p7cw3BGisocdpykOpeKuSGurdMfRolfV4QaFJhj+JVsqlduFjJEBnhrqQ3rliGy3 +Jw0igAKYuZWth8acYMpJab18oHNLPQGLvZHziw+0+R5MZbq37GYQ8IpdzcbNMUXY +YrRPRsUmEtFpZ5QjhfTworVo9NHGEHhf3li0nUNMlGfuIzQXiQG9BBMBCgAnAhsD +Ah4BAheABQsJCAcDBRUKCQgLBRYCAwEABQJeNT7NBQkQF3o0AAoJEKX+7jrHk3RE +TZcL/RcoE737pkUWzU+Bv4qvGcwK+EQ3WPWEb9cmCsmBqZ4LRaLP1UZJ7kzuba54 +3QDMuwIm7xy4Gy5Jty3zOEXKzPjKyXIGUTbfADs65QtkOyJOOygbq2i9k0TydCES +v6mMP3HNyUPr9Kxna0dFbHZ69iZGmIBzw3/2NzyNOhh7DLnaVdmRf7QqzpZYsNGC +ADDjyhmPUm46VmsE2EqE/hF26U6A5V6VHIqe2XLGZPrr4FWbE9rc/i1n8pVRoe5e +KYlcAUxjlQ4BxRVsEZwuwznjLprxOUjyM68cJOE8BrpnIAcEU/88HZYsO8DALigy +NxOHkTWO7m5JI+fX9h4+6qAKVKWpa7qWZ85IEaGoWmiTgXdf2P9N8/9cTzEzB53V +ASSZl5z+xQsTx6kn3LKja7OtUDKLGBvfjsDSw1XTmAcFhj1ELQRRXfq38FgBB+Rq +e/qOGW46+c+bSMid02HNCkNipW/klo77LB5qnPKj/yElH49I/P1x4vUYxpUMPgGY ++crstLQmRGFuaWVsIFNoYWhhZiA8ZC5zQGRhbmllbC5zaGFoYWYubmFtZT6JAhwE +EAEKAAYFAlfjTvgACgkQ3+aRrjMbo9tpghAAuik/KT+YThdyNrVq2mz2c9rkzgNJ +bwkt6XQ42AumalTa1WdpvPqisEC88F6xpR/k9uA4nh/C/PLuwDtlSc9ZhBrrlJE5 +uPrkpBKcKiGWYdRFTGtyqxzLBt2MqWb1eWOtBBRjiQkDBoP1h+tHIJHvkr64uoJE +biSlM3CUjK/00bO7oiiZCKyd45tk1FEIZUnyGW2/JdwN9G0XWt7sdcfBxrccCTor +36hrYH0bNKSgwbSlraYdB00lnMRqQIFI6J+rGIHqWPgJn9ZdW8heD7BeYDP3TFPg +ADhvpP5BI7ATi2EBoAHDWyIiFjSXsllmIBq075O23jyfLaLiIY+sGzSs29d2HACA +NyobCqCx9iTufKgayXMO6bk//ic37ACs0cubEVLqHeGUy9PeFxjJPD4iXVbqEuNo +wAmyHtXplNLKGZuAfBcYfhlxcG+yTXQzxb711LI7iA8Ox41GBVToQCgpi8XNlgzZ +Y4e6sP/3uFRNLUm5zbH8KaQFy/HgNfYHWb7i8y8eSu3QGaPv4jiG9eLo2j/iDF26 +3JJeOw777CWNFvcMXwTP4novzVcF9gYnjOcxDojjn3Dxk3kRMEjG5u64t+SiGsTP +j/1fIbK+EX9PdwUH0FWFrq1K0F/4lPYIIUPuxAgN/nEdpURLDQzZ9XjICAZz50A5 +amSZ1f43AbciEVSJAb0EEwEKACcCGwMCHgECF4AFCwkIBwMFFQoJCAsFFgIDAQAF +Als530QFCQ1E+SsACgkQpf7uOseTdETg7wv+MnjKLG+J6mls4SV7dMFakHj4juqv +41tLZj/N6n5dO8Kev9rTU5WCP4vnAPIhL5254qL+tch8md/ztwc5ixj5jIVTVC7N +jZB8lYQx2y+g71Y2JqclzzfeA2rZ7G1CQJMU9DU4gtW9T5rRukk1FfQGXXAs4Ru8 +3aXRYOfEk6lNWtS5bnAbOSP++3tz8y35TxWgVnwqkpu8S9lmSciY/k2NgRtjATmR +9xHFJleHQK8tmJnbUIroN5Hd4wM541m4zl0lQG3fMw8m434IUVLA4v797/Sn1av5 +m23eyXArvTneNGHqkBG0WGuVffEk07KzujV986saCB01nJv+gHQ1OeLSGMRa5zwJ +Q7qkEw8BslfPDR6rkhC5i6B8i/vQENxnDSWeBMQ1gIdi/GpPyHqSssEJSZkT62Kg +94oljDMNEDPjrlSc0bBaHgiArdSdFh5fwLV3zlh/m2yWIqg52ZA2t7AezUpTJH5B +sywDpha2WtDs1BMcM6TdVEpRU/ZKn/MR+jgRiQG9BBMBCgAnAhsDAh4BAheABQsJ +CAcDBRUKCQgLBRYCAwEABQJeNT7TBQkQF3o0AAoJEKX+7jrHk3REBH0L/i+3ZwpV +5Ncju0iV36qCzhqgRyFu/PseNFDD19qc5/JfW3Ts+NriFNGfdR82ocTi3d8RM2XS +crT+lYQXOd72p5OGjmg1LlUb3gqGh3sIw16kJIli/5gs/HwhXrvums7rbJO0eg2q +7uDhGItMlE0DmWOyn+HHWX2WWArlDgQPbncgGXEg92ooLKmy5n/Xr7rK/pvQMlh0 +KEjCxrVtCxntfwdrWjNOIHc9O4NEc2+IZ1DApKlj4FUmHPdSIpAUpqWZt18pTemx +FzU3vO1aArqa7VKnuC6IsqX1fuI3Pn1ofyQclUSi3XjGd/5SEdE61ustCN7vw9gQ +48XFc5Odeefte0Ff0KtOt69w37OxpsUZliZfg1BD27RAGm7lJ1x1nFzXsFl/NHjT +F+t6lwMvtbiyCQNJYiIkHeTYe5npIG73qO5NNdNK8FdwRvJ3yyBqTYtY19xugOtG +iOqKA6fvm4Qdyei3qm/ecmcs319NpoYsLv/6BKlmUvmnMZ3tjXGG7n4EwbkBjQRR +t00ZAQwAt+YcRrbLSY4cZO+T1Z78kb+wtUptyYdsUTjMNa+RqFEginvGWXJi3t9x +HZD2IdwjFWUmnjeTdx8bdikpUedTlG3JrFurPX0xMgkgbC/BELF+4Suj3qHYTBr+ +iMMcZZEaGFMJ4IAHml11Ryka+p9rMVG8bHsCoTRPYyPctNS0b1YG13ZN6qdug+1x +WrgTBBJntQEsnuCw51HZOFAOQTPkLSTpVHTvcbkEbjotXFWx30ysvVHoZpo1gxt5 +XQtPJASDgkofUdHXgcrjCTDTx7AoOSnNArgJUpdKYzaX62PA+jwWKhfQ1+PY+wUC +7iGpmj40FMndzVbtaVKRdlEboTAOGOtDb7o4f02RBK53vJY5ZGtKq6chBE3CzBaW +JcuSd7z6yazx0W5oLptmgGHl1xI5mw1qYE58bK6NoXgLlzki0abyUpng17mMyWnR +kWUi2bAirAaHUkhEG4SeOcd5dvZB4KQWkmGjTGu4513NxAw/uNpXRCu/GUPeS/4d +3ugLUbvJABEBAAGJAaUEGAECAA8CGwwFAl41PtsFCRAXekIACgkQpf7uOseTdER8 +Xgv/SsCCMdABAfNzW9ig+IqaYDej/f1vWkDmJ7segJ+TNOKV7a6tva5/Ao+5M9Dn +U0DIVkOL4jp2h2F+sTS83zgoObb6NJ19NAH2pRiobIdlpbj0rIvQOgp6YpgDlP3d +RQKwqnPSKqpzwDKUXApCUyAQw3xAp2avnVayJHIbm5IiVg8FoS/0YWZwKup+p7qE +CwsAXftRUhYolejz65ZDMz/rxljFPvpBxBZsPZDqFaZzLr+PS7uvcdC8QFMAA9Cv +fLzzhHPmX4Ogu8iKkSmyV+pbxdLxcg13zGz7GTOx4+VXgaA3WNDlU8oj51GX5bXI +ny1jf8GFELDo/b/fog6HrcsGihE5MZzuJZ+ZBXjR2nbWTQoj85jnxqeUlJ0WuXu+ +mdIoCHvEB3Vu+r2Bn2np9w7askduYgk+6afOK06itGUNabLLtAa5M/gK/WOGop6x +O9nQmdz6VoZ5NdA89MlHTV/A+qahGqC23m6Jeto0jPePZkP9RLZLrevm8PtDey3c +eRf9uQIFBFlTfpsBD8C1vBhjCGSYTVxTiRWTENGUgmqDWbUqU2TXkvq3331w90Fr +/S4Jt+v0UQ5p9L0WA9PadKlWF3MjpedttbBYPfXl68B/0hiNnX8PkgP3/I4peX6/ +23AkSJ8mXBTsv+YnzCc0GFqm1Qaf6ZsxQWHpSoNYILTH+Q+7p4dJblpzf51w+UfQ +60iA1yO4Wov3FHZsWrkr2T1akn7dVMvVrrvSHCWG90VHXGB2WQkBkhCN3BhaSMUV +l9K8+XSx4I4rOC1FezItMHgBfW4QyD1HVsF+dZ0sVipqzwbAbJ0jFoX1a3AVEtAW +74dB2KSEd5UsAJ/ZUJV5K3vmfaudWobf8s6/YEdRIow4zphpif/UrxL+I9+RAGF2 +PpY3m3GpJP3sEnL9yXlqp0Kbr+xVuz/ewPWWJR6XJJhMCo8o3lXPFh+sVmc0fdb3 +lceiOJ0Au6lySP4/aZ5HkuRZAaJaLAlep2n5eLwPlNEWzWs+C9StdWNv0phuRumf +DNrqZwPeatydfrCwPCxxe62PzpbTfnvvQ9bVDA6rsW4VyTNVNGskuG5WAlw0GREm +eVtIW5bX864wQruAehyh9JFuM1JrS4FlBitHjN9Wx80eVIqRyqIzVqmYVclUhGHA +lKxGkbsh564FzSxKTaq8wzZNaWiLK3mdJnrXGl5LRbsBrSTCaZsAEQEAAYkDvAQY +AQIADwIbAgUCXjU+4QUJCHtIxgIhwVUgBBkBAgAGBQJZU36bAAoJENsn6ZdCmvIM +cdgPviW9GD4+Ta3+0nSOyYyFmFYET+MjKVShL3xOvpHsa1p9OpiuKKkoAx9o8CqW +dPPFMZJ95QRHeTLQrgt2ytQ3L0e54Qx4goiYKGmDlcq701qUwvPys8/jA3IwS9el +2GBBcpIExrIG+I9h6qDf7IXAkmRAjxI/KgGgEOUDcs5HFRblK+/bEaHjU6BnPvK+ +gB7y0vx1ZCCloW0zPGb9AmsHU9x3NfdrJgrVWchjFA4tGllQbXMzm3aOOgFDZ0qD +K9Hx0a8lrGPksBW7foJrifhTzMcLO14BSPTv/inAl8NpSW6LRpouX66nJhy5KXlK +C/n55LiiKU9+6lV3ba8KcDSzgt/my3tD7myJBh5HOv8fvXhSfmxcFLIZa22eQfGJ +eInu86E9Y0MHzYJ+te9qCaNC0Vay4VdmsC0MoOALacEz3GBvLIyD06cWQjb4ARXs +j6YPW/cp8pzakxerAA+gFDmu7J+RgH+BDVDRu0Uk53gCsnCxaAIWVU5lLAy8/aRp +G3zUPnEwZFT3gCkLkV/2nKlakPupaM2wb9ItIvA4nwYiqk6SAJPKwh5pdqNu3cRD +00RLfFS8OpEzMCi3qWdrTXXvtcutZnyBJeYaS5ORhyR/PNzNkLjNQrO4QxpQGRvK +TFLP8d23YMoXjogCZrW1yHq7ShjdQAZyALRmMQkQpf7uOseTdETSTAv+Jcyg59uI +4b+GjxYhokVfCZN0aBNBd/OrWAk0GOfJsNg20AUm7BTnb76p2pj6MwLvbeBZfQ0j +IMb1NbpJZ9B8faJzbRfBBhs45z9ff2UvyLxfjOjU7rRN3m63yBxMZJLRPgJw1k9n +0AspkkoWqQJwTOC/2VL9xxJZcfG747xBW04k4QeY7Va0HFB8T3nrYf2wWR/KhYSG +JLF8+2HxBGULa6L4rwyUZB3vROgzej3i6zYj5vpDsbDXv87AO6DeiQfn33EEQN3x +TIQxZX7J2ICwD4lZm5xK+IvmIjnQdoByNTO8JQ6Eykg4z5mEwsBjtu5n2QkCOf9S +Q9UodOHwQWZj/N5kEdY/KoygApWbctXrue2VOeFf5MsSWCpnWHsIXOELe8QvSwlD +WPTmUZs0gN/VQjzifiVOQZBYXAInpKak6xIwltBF1gfh/a8byPD84X7BDLxUnFKY +Ew4Gue8eao0HmXpIUm9vWdnFAU0NqLbvVfbqkrzyTRNzNopC44CUfwzR +=KiyE +-----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQGNBGBzXzkBDACjRXUOZGdF/dFBPYxbdX17touhN3T1d00HH73LEpYNny5mY97h +NTE5lQWFQ+eNn7Tx79PZMDepv26mRHMQR6ezI2ahd2TxDCngNGlPcuhsTKgcNRiu +i0nbgB8ssqm/q8YoW+FWJLWfGwTfH38VMP3s3022wUXAMA/gz2FVx1uEFTavC92i +Mhrlg/+4Y9uzq4w4OMIA8QJ5cWIqBH0SzaGEZtthnZRnLRoKh9oXpgMZ4Bv+ofxT +a1qsZ6tNb4n8Wbscv/vYZqn1yOj5XI8ut27ocKuxnoATXOuK3ac54gZYSyI9YFyh +mjLHIMs4qpeDyhMZZRWAp6gfQP4gSAvDGZ/77o7qwV+r3kUbZFlxwz0C96Ul4CGU +SwRJT+PGFy44PAsvUudqLAhr6ndchMN4HM3vBAtngJIEz4YKngtq5OyAZEVEFMDr +H1WJ3/9NEq7jcqmlhEKd5t13FPIE4hfYX2cwLV4BAgcqB4uOKCP/0Ihg14Kd1FoX +I+jgqByM92IQeQ0AEQEAAbQYbGx1YSBsbHVhIDxsbHVhQGdteC5jb20+iQHUBBMB +CAA+FiEEKQALqIepMZD3K20A+1LjaLcLJVkFAmBzXzkCGwMFCQPCZwAFCwkIBwIG +FQoJCAsCBBYCAwECHgECF4AACgkQ+1LjaLcLJVkrZgv+OglxzCYf9dNu3gHlZ0AC +VzwJIrCZoS3IG36iiLsx+d2jYgdTfR3y4jH294mCVsGfoAoava6lun27Q94sMCaH +Ng0fcZfW5uwrn8jW+H+F7mCShpQNUDHDlZx/bkC4JX2jhEZCrqQRRZUYTlteVQpu +44ToiFq78iLs9fz9HFczDzmMmTvKp4r84+6AiFwQy2OGAVbON4EnxIZjEJdVKMqR +8XH3tWuGeqDnBBqXrrS6g7SAh9idlA8JfifkBNFSDM4SiNXJXk1/TumR3w008Dj3 +6gq3W1P0b91gY2VwYAUBeOciSJ02hcT0Sywa1NAkytQA0djECe+wl4Y8Z2nwO4u3 +ZCCNCKVWjtjoo1QUwCyUcQl2vEt7cJdEAfbzr0VH9oaL0trjXz7V7Y0oqkI/XOSI +wa/aTTrvybSKTEIvMIfC9IVjTwn6KMh9x66eiN1CmF6abfnwr7cTn3mbrJ2z0nMV +1OiuU6KahncXixo2XkrUOyZ6OxsVNVGmd/ttn1IVqpvMuQGNBGBzXzkBDAC7puuc +xUyEuxWhwYGuYCQXNeh7mHnYRhd5nFuM8hosaZx+w65RSzJ5UWKIPr6vt1vC8JK3 +r7emy1rPIeuwWCVVpzIcW6kTS+Jd/ZDDYKUdko9rm/rbmHScJF1LsiS1yvVP3l9P +0OE2db+IDqDItDvGcHSWgygR1G1hgPl5cKz14352R+cRYQDacCMlYhg8dFL08eoQ +96ZlLpiRLox0X3HFWih8ZyhQF/uO5cKjzEaeRnrL9vVne3BNVTaNTsUoHPvVQUJf +H/X8CR/L8B6E1sDa2KWcRhObhTaTeUUFsjqmWkiOIDRdd29JELDCD0O+tR28w+WK +8XwV+/2bV/49g9DVCWCHD6KxscTzOgspUKaNM2y5I5FZQVT3UYpu6GCJL46QVsJZ +j342tGuSzEKH8MHNikJC0vg2r7MnH8ogkcJ7MVEvF5aVy+WC4f0Ciz1Tjl+RShit +e71PeswQ6r5lFtWvanDQgB/UBfvKTwwA3qHQXe6sr0nvJO28QdD2Bo5NaIkAEQEA +AYkBvAQYAQgAJhYhBCkAC6iHqTGQ9yttAPtS42i3CyVZBQJgc185AhsMBQkDwmcA +AAoJEPtS42i3CyVZ6qQL/AqvaxPKKPfUQynDlWt313rqzCAls3MD1L8B9Ya/L/4Q +JgaEsJAwW9SkSkUneB4HT6H4zqZC7NF7iXGt3akm+tGMsgQ1t41X7Ac8p9nEtNfW +SX2SvtGgyFhi3qCJI1v2eEEI06e4m0K/O1l+w6UCwDFgMkxUsP6yRYJ5o6N0MalA +OElJQkND6rni4rBDUo4Q7RDfgNVRMAXEcKXV08I4veykfmk5sAD+Trb2bYSfp+uA +Dve7V9AzwlV7cSfaA4otJKk3uIt/M8xTc3cgh48Jg3ppywntiBWmzIL2JPS/0kBZ +id3Mu8a7Yz3cjv5sY7OksjsjuIxTCHycxFZbi0QxT/QtW6CItGDrKuCKr674Q9wO +cwnwDI6nW1zHsTjDFzaBYcFu7PHIqXd2aZkNWnc9iOQOHxLatTYKyDvzRyXuOAQa +APc+Fy/7VI7pJk64rkoRqzAhp0Bh/8DXmKXmA7CuWTY8wiFA0YlCLQnVebgZ/ALm +0mWkrhYxYrQKM6kywpFS6JkBjQRn++XUAQwAvRy/Pg/FrWnzF2Ch024gwdP9bcdt +FMc7KaTTgSHI+11axQ6IcgCaL7fNYQAk/f3zzhVcVWha72K+4/vDcl/jSDrBAiMD +V0ylwvz6iwowpXX6A427SSSl1FpeR/sV0RxSTsxVwROh3oiYWbmW5J5P0rtBhuxd +6oS6xP2OSYjOEbharxiSu9TyvhVuOadlF23VsaQyeZk4EB8+9Uf7uJsOuov5GUT3 +eDYnWgKoLofx/vzJupN7qhqoPVMDQO3n/L10SFuRiiXbvxRHvvD02hhnyjX+CUIN +L/lr1lIvoP0aKE1mJNilcBmnSpMkUS58Ip6XGBuwBiTv+CQQFHYefrDaBRgKXPyS +Zhi4RQAIUaGFFiGFdwtPgciPPt1fPHjERLhXwjwDa0fr5awtdlHm9k4wQOl/8uS1 +Lr07kns3NgHBfUGX8N5/D9PnKsgI1MuBl6ivLbOZOq3MvfdPkxBkWeYX4Rbp3bib +Iy2jR3os8h+X2+xCIEPgrLm1hO3zd++5UlYHABEBAAG0J0VyaWMgQ29vayA8aWxs +dWFAdXNlcnMuc291cmNlZm9yZ2UubmV0PokB0QQTAQgAOxYhBAqpRa0v2M873QkW +7iOJmTGQ3bLOBQJn++XUAhsDBQsJCAcCAiICBhUKCQgLAgQWAgMBAh4HAheAAAoJ +ECOJmTGQ3bLOHY0L/02/2/N6+LAAAX2A2/JhFqMlPlempsZDhQg4sgaUpwZqlSnx +ZFUkOpNFG7UiGKZ3Za2lj+WbwSaVWgQhsuuhURel4m2SWy14yi6GFEnW6z2vW82c +lpEt2cDvG3q8wWFLJzZNIwoyuhhKNUx4HvEWZpzP02Nd0desv0/a+fjQk2Gq+kFn +U3g/YR2jr3FvTtregGBvafqEnDkLA52o6P9i6d+jarSX6fWtAM4/32aMNqe4KIxU +GYVlXdGe4C52SGwe7tvzBFjz+NX7FQnGbPsE/4IzX/wAK0JR2/OdlaK6YYdBT5VF +c8BIDmADu08DUjE9EdzumNKYArlrhl/AoXPkuagYZm9dmx9nf/3PdDEq6Y+gC+F3 +831+9hrAmeuANHFUCmYV+flm9Pgob5Dd3kc50dOJgeuuu9ki/iEOu3kgvC53Ng9R +aJQabsMAxG7FoKohQGFFcZn4UW/0iTq1ObG2KU6A4TJoirfyjRO+e9yRUIqvAH4j +e4JrCMvYHwSyO4SBGbQYRXJpYyBDb29rIDxsbHVhQGdteC5jb20+iQHRBBMBCAA7 +FiEECqlFrS/YzzvdCRbuI4mZMZDdss4FAmgRg9ECGwMFCwkIBwICIgIGFQoJCAsC +BBYCAwECHgcCF4AACgkQI4mZMZDdss6YXQv9H8cKyrdT+xuPwcTbosxElFkl7IP0 +fM5P7GwOBgm6EjoUDqIgAYPyHPhvpRX7m6+4chqqG/glJ03T4MhgyY47X8+gyW2C +GmYKK0UGhxOGUuxphrw09KwdPpZ33sknkr55gfs0ZNhk38aVYhigtbTW7Y5b1U6k +phNTAkAywbNLkSyainYKmFPncHWxd+FBvRzKjmtV90GlAFENVPyQm6AofBkPsxNI +GlbESZZUe887J+GTWW+2go28bJwaWkDoUUMw8cNIuucztfa4Iyn5K0G0bzNEeaoF +a6J+cwdHGQKiScyEzU+5wN+WFlclhg0FiKM0ca/r1KUJaGC5vuB5jH6pnVjF8TtN +OWyV7UazPSOU87AMv7I/N9Z9dSOPSp30u7R/LyzcbGjFJv0BSJFx9veuh57Yof6c +m7IM2AytEudhCwyuSIwM5DFKSFqxXwHA4c0PM735sGvFTzU6cRaq5/ghJFNb8q0O +K6+XyVGlYnVaSKT45gjDEzIZufcRxi5j6gOUuQGNBGf75dQBDADxDCI9E8MqlyJr +PSQenIjeI1hGnQHXxnKMbfX32QjTPu9+BkM0Szv9yZIQ5txTMTOwA62BQUiJWxn5 +4iYGDHOIuOy86kZ+frgFgrYi7ie6s+zv41I6yNTu/VmUVwOvVaCLPIQ7PA5UeXGE +qbPtG2BegyJLN9wlI1/inZYee/D2Sv9AsnMO3+Xfag6U+LWd+WDt0itiZsIahHHX +wyQBTPJKtDi+F0J+D07Yxv9bnI88h6FQlXTnS8N+vaJtcNUE91qWCoLzu4eC7QxO +nf1BaUrpXiQXUGyQwGem7i7ESjFAEFXVKHDmLOk0LzTymT6zWW09ywjaoPbzfpgC +XGHIT4wpb0+szSrZaoADB5hNMgtpZXi65a4C+N55qd/QgZdgTRVlfNot5y9+mKq7 +UreAgh/STkNzZMm4c6hE5SohYPAXvVe47Iu5vPoXYWjNWftxS3xYexiLwEWGsKDc +gGzE1z0a3vP/75Jwei+1VPS+yYub6xb2fhcJ/OMIWgJKqsQ2e3MAEQEAAYkBtgQY +AQgAIBYhBAqpRa0v2M873QkW7iOJmTGQ3bLOBQJn++XUAhsMAAoJECOJmTGQ3bLO +aWQL/R4uQ2rXyQK2xHbgH8UfT5AaGXwnPkGzRRxNd6crNl3QpCyvk+rpNuszRHeI +1D0HK4wtupROB0kYwjVbGZ0kaj7ZLCLwAdAI43eO/V6MEpo08TdPay/3S0yF4HsL +YEnGEMjvxhLFi5PsBwejtv9hMaWj84oBHAW8w9a5jPPupQhlNjazLAooUP4+neBY +/cuzNda+3ujOB4En6Md4FamDUDuYEbLxw1bJbvxCLErCMtYwktHZ/Fq7L/Ys02V1 +Jbhi0SAspNn6c09FVT2F1quItIuruoG6dNeFxuVV0p1/QBstU5EXS3paJm0rZnym +a4xv79sJ7ZCxcJ0yfpT0EP6LKyJ9nL9koiWDMWYRjTlNzIaWgsXV6Ka86ZJm139i +IB2RgqMrnQy45DIFgevvsXuFX5Ey8mCYu+YyqosZZGuPIU8hrcm0zoLjyuDsSOzu +Ay+pen1zbjyXGQZVN9tvRxizAa/3qL7AdilnlZNJKOiCXTGEiSGaKGibfseTWoWs +Qg719Q== +=+Fbc +-----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQENBFZWC4cBCADgb7/oPoCs9SE+/jrzmDT7L+PbYLCygCExxp4mt3CsSzn5xefq +NGU+aBJnvyongcsYrW173GumDjXCG3GBtnmqs3dFeoqnEsSZFMYiQ4ctmWh48P+W +uQVQOWuh0CVS2OCFn37b5F9dy3oF6gJFdqbwOXJSgWMA/+StMGSkslTYFlG/JwZ1 +csk9jSwQw/yKDlTiFaqMwIwSXTK5fItSn3F0R+usgMhwRPu8gvK23tmEhnnwgmlR +xfEwJCLqGnvlW74dRkCjY349GAG1IN2felFfHn0ok/Lbx7coKRoEvHaCVbmtPSmX +Ps9axAV97wk37wS1dhEXcjxLb9GIZgptgo7DABEBAAG0LlBldGVyIFN0ZXBoZW5z +b24gPHAudy5zdGVwaGVuc29uQG50bHdvcmxkLmNvbT6JATcEEwEIACEFAlZWC4cC +GwMFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQpx2anUvbJ7NtaQf/RQ/RLvOG +iI4XJp/C9JIVHfHL7I801uT8V3y/d2+DehFasR9T+6B/Mf5y22NI31i5XBQuK0Wo +Zsi7F3bhNHyeVgO/p5JLBmxohByjL9f7B+k9Tt/DyWh66AVaCoam4ACR8TBOlNkD +p/8U0zzrxE9fQrjjK/PzhpVe97LKScEAu2Zc/qUFp4eTAnlqyosTqvU64+n1PrNC +CtZVYPnL17GCC4+S7yrh34Kllx+fkoHimTL/cUG+6+7sbmpUImpP+pgNEnL1IzBB +ajZRl1581McMGhIH1TBYrEVnIhononoOO7qr1eahUCEhVvanyVTnSeTTVR0VgK4s +joYLwDLM4XidgrkBDQRWVguHAQgA7JTI0botnBMfTAGff4Duoor5m0PuExQFCHcJ +/df5SyUUskycMlGR73+IbcT2D/zBIFDv5ZhCdOdmIW3CHICK+Ws7N5+KSzlzC+Vf +2LMmXuyJLhXeTqXI1ta6bIGjXeh5VA9Jd7B8dRQhCn1OrGbFhwtJSGejTmcWiLJW ++2GV9s44e9MlscMHvAk9QAvqrSUJoAkN3OCdgjcpDNVT8ek3NnjCD4xrBTxCcI1n +KsJeOgNHPkbou9+eHY80amkAkRn2ZSI9n25WjhKAp9QGDNL5wqHLjgHP6WiEwumN +DWPnPd+5FQHQXy1GHgH2BozfT1KZJ012T0Keuk/hnZJ/TVe4gwARAQABiQEfBBgB +CAAJBQJWVguHAhsMAAoJEKcdmp1L2yez1T0H/jitvgACci+5PQG1djYwioQIui4J +1nSg4HxW+4SCpSwlmH2LkKaF3WbjpPTRhYeMZ5zdOvGnjPUZCjGtWkWx0p+Jrpe/ +QIC3CNXerX9fpkr0K7+knqkb1RsjHU/YSsYTDDVJpL3BQOZzVocOjPa1YPTfTBU5 +tsQdA4RORi15LyAWcEAmR+X3qH2JM5pGP23hhOKnrFSSnfBP6ef1/jjRbfK5yItZ +5DOf6i3WS40zxB67dlBlHZwOQuYA3Sr01hEz4CeAkpV7lQ1gKelm1ZmcFQI6yqcR +PmVjIuxE1A/gTFe6LaAfCGA6/H1H6LLwWQ/rnUi/seMJ6aRkz/05dg7j5+E= +=wOVS +-----END PGP PUBLIC KEY BLOCK----- diff --git a/zsh.spec b/zsh.spec index 82a14a3..a705f04 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,49 +1,36 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.9 -Release: 20%{?dist} +Version: 5.9.1 +Release: 1%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ -Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz -Source1: zlogin.rhs -Source2: zlogout.rhs -Source3: zprofile.rhs -Source4: zshrc.rhs -Source5: zshenv.rhs -Source6: dotzshrc -Source7: dotzprofile -# do not use egrep in tests to make them pass again -Patch1: 0001-zsh-5.9-do-not-use-egrep-in-tests.patch -# Upstream commit ab4d62eb975a4c4c51dd35822665050e2ddc6918 -Patch2: 0002-zsh-Use-int-main-in-test-c-codes.patch +Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz +Source1: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz.asc +Source2: zsh-keyring.asc + +Source3: zlogin.rhs +Source4: zlogout.rhs +Source5: zprofile.rhs +Source6: zshrc.rhs +Source7: zshenv.rhs +Source8: dotzshrc +Source9: dotzprofile + # upstream commit a84fdd7c8f77935ecce99ff2b0bdba738821ed79 -Patch3: 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch -# upstream commit 1b421e4978440234fb73117c8505dad1ccc68d46 -Patch4: 0004-zsh-enable-PCRE-locale-switching.patch -# upstream commit b62e911341c8ec7446378b477c47da4256053dc0 and 10bdbd8b5b0b43445aff23dcd412f25cf6aa328a -Patch5: 0005-zsh-port-to-pcre2.patch -# upstream commit ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 -Patch6: 0006-zsh-support-texinfo-7.0.patch -# upstream commit 4c89849c98172c951a9def3690e8647dae76308f -Patch7: 0007-zsh-configure-c99.patch -# upstream commit d3edf318306e37d2d96c4e4ea442d10207722e94 -Patch8: 0008-zsh-deletefilelist-segfault.patch -# upstream commit b70b241cc5ca88cc129ff9ba14f8af2e889b90e6 -Patch9: 0009-zsh-support-dnf5.patch -# upstream commit 071e325c826a89b792056c3faf0c400b8c0c5738 -Patch10: 0010-zsh-fix-dnf5-completion-with-rpm-files.patch +Patch1: 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch # downstream patch for rhbz#2449939 # already fixed upstream in a major refactor of term color attribute handling Patch100: 0100-zsh-_IO_putc-SIGSEGV.patch -BuildRequires: autoconf BuildRequires: coreutils BuildRequires: gawk BuildRequires: gcc -BuildRequires: gdbm-devel BuildRequires: glibc-langpack-ja +BuildRequires: gpgverify +BuildRequires: groff +BuildRequires: hostname BuildRequires: libcap-devel BuildRequires: make BuildRequires: ncurses-devel @@ -54,14 +41,6 @@ BuildRequires: texinfo Requires(post): grep Requires(postun): coreutils grep -# the hostname package is not available on RHEL-6 -%if 12 < 0%{?fedora} || 6 < 0%{?rhel} -BuildRequires: hostname -%else -# /bin and /usr/bin are separate directories on RHEL-6 -%define _bindir /bin -%endif - Provides: /bin/zsh %description @@ -87,8 +66,8 @@ mechanism, and more. This package contains the Zsh manual in html format. %prep +%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}' %autosetup -p1 -autoreconf -fiv # enable parallel build sed -e 's|^\.NOTPARALLEL|#.NOTPARALLEL|' -i 'Config/defs.mk.in' @@ -131,13 +110,13 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/zsh-%{version} rm -f $RPM_BUILD_ROOT%{_infodir}/dir mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir} -for i in %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} %{SOURCE5}; do +for i in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do install -m 644 $i $RPM_BUILD_ROOT%{_sysconfdir}/"$(basename $i .rhs)" done mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/skel -install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zshrc -install -m 644 %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zprofile +install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zshrc +install -m 644 %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/skel/.zprofile # This is just here to shut up rpmlint, and is very annoying. # Note that we can't chmod everything as then rpmlint will complain about @@ -182,6 +161,9 @@ fi %doc Doc/*.html %changelog +* Thu Jun 04 2026 Lukáš Zaoral - 5.9.1-1 +- rebase to the latest upstream release (rhbz#2483668) + * Tue Mar 24 2026 Lukáš Zaoral - 5.9-20 - fix segfault in _IO_putc (rhbz#2449939) From b7e65312fa16d741d3244e4c1307fc61dba7fe8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Mon, 13 Jul 2026 12:15:06 +0200 Subject: [PATCH 72/74] rebase to the latest upstream release Resolves: rhbz#2499540 --- ...dule-loading-problem-with-full-RELRO.patch | 69 ------------------- 0100-zsh-_IO_putc-SIGSEGV.patch | 25 ------- sources | 4 +- zsh.spec | 12 ++-- 4 files changed, 6 insertions(+), 104 deletions(-) delete mode 100644 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch delete mode 100644 0100-zsh-_IO_putc-SIGSEGV.patch diff --git a/0003-zsh-fix-module-loading-problem-with-full-RELRO.patch b/0003-zsh-fix-module-loading-problem-with-full-RELRO.patch deleted file mode 100644 index 2ca953b..0000000 --- a/0003-zsh-fix-module-loading-problem-with-full-RELRO.patch +++ /dev/null @@ -1,69 +0,0 @@ -From a84fdd7c8f77935ecce99ff2b0bdba738821ed79 Mon Sep 17 00:00:00 2001 -From: Jun-ichi Takimoto -Date: Mon, 26 Jun 2023 17:13:04 +0900 -Subject: [PATCH] 51889: fix module loading problem with full RELRO - -If full RELRO (relocation read-only, one of the security enhancement -methods for ELF-based systems) is used when building zsh (as in binary -packages of most Linuxes), loading a module (e.g. zsh/zftp) fails unless -all the modules it depends on are already loaded. With this patch the -necessary modules are automatically loaded. - -Upstream-commit: a84fdd7c8f77935ecce99ff2b0bdba738821ed79 -Signed-off-by: Lukáš Zaoral ---- - Src/Modules/zftp.c | 2 +- - Src/mkbltnmlst.sh | 24 ++++++++++++++++++++++++ - 2 files changed, 25 insertions(+), 1 deletion(-) - -diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c -index 49b3ffa89..47a5e9de9 100644 ---- a/Src/Modules/zftp.c -+++ b/Src/Modules/zftp.c -@@ -3172,7 +3172,7 @@ static struct features module_features = { - int - setup_(UNUSED(Module m)) - { -- return (require_module("zsh/net/tcp", NULL, 0) == 1); -+ return 0; - } - - /**/ -diff --git a/Src/mkbltnmlst.sh b/Src/mkbltnmlst.sh -index c4611d8b3..067ecdaf9 100644 ---- a/Src/mkbltnmlst.sh -+++ b/Src/mkbltnmlst.sh -@@ -76,6 +76,30 @@ for x_mod in $x_mods; do - test "x$linked" = xno && echo "#endif" - done - -+# if dynamic module 'mod' with load=no has moddeps in its .mdd, -+# then output add_dep(mod, dep) for each 'dep' in moddeps. -+dyn_mods="`grep ' link=dynamic .* load=no ' $CFMOD | \ -+ sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`" -+ -+for mod in $dyn_mods; do -+ modfile="`grep '^name='$mod' ' $CFMOD | \ -+ sed -e 's/^.* modfile=//' -e 's/ .*//'`" -+ if test "x$modfile" = x; then -+ echo >&2 "WARNING: no name for \`$mod' in $CFMOD (ignored)" -+ continue -+ fi -+ unset moddeps -+ . $srcdir/../$modfile -+ if test -n "$moddeps"; then -+ echo '#ifdef DYNAMIC' -+ echo "/* non-linked-in known module \`$mod' */" -+ for dep in $moddeps; do -+ echo " add_dep(\"$mod\", \"$dep\");" -+ done -+ echo '#endif' -+ fi -+done -+ - echo - done_mods=" " - for bin_mod in $bin_mods; do --- -2.41.0 - diff --git a/0100-zsh-_IO_putc-SIGSEGV.patch b/0100-zsh-_IO_putc-SIGSEGV.patch deleted file mode 100644 index 3adf849..0000000 --- a/0100-zsh-_IO_putc-SIGSEGV.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c -index 8f32c68e3..bd4a67cee 100644 ---- a/Src/Zle/zle_tricky.c -+++ b/Src/Zle/zle_tricky.c -@@ -2490,15 +2490,17 @@ printfmt(char *fmt, int n, int dopr, int doesc) - p--; - } else - atr = match_colour(NULL, is_fg, arg); -- if (atr != TXT_ERROR) -+ if (atr != TXT_ERROR && dopr) - set_colour_attribute(atr, is_fg ? COL_SEQ_FG : - COL_SEQ_BG, 0); - break; - case 'f': -- set_colour_attribute(TXTNOFGCOLOUR, COL_SEQ_FG, 0); -+ if (dopr) -+ set_colour_attribute(TXTNOFGCOLOUR, COL_SEQ_FG, 0); - break; - case 'k': -- set_colour_attribute(TXTNOBGCOLOUR, COL_SEQ_BG, 0); -+ if (dopr) -+ set_colour_attribute(TXTNOBGCOLOUR, COL_SEQ_BG, 0); - break; - case '{': - if (arg) diff --git a/sources b/sources index bd494a5..e248084 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (zsh-5.9.1.tar.xz) = e16c13559262577e725b290c35ce6598d58c2acdd204eac619e8ed9b6a918bce39bfbf9d3ef4c5eb877af7d3279c8a4b15439eba6a38c4e4d47d5555d5f79872 -SHA512 (zsh-5.9.1.tar.xz.asc) = 8c9fb393de9b9ff84353ed35f812c8e05e6131c238fd233a2f6e3aa02b0644c7afd597a8b4e7a737152e4478d0d4dae7a5e42559047f100eb536049c4490ceeb +SHA512 (zsh-5.9.2.tar.xz) = 40bb5eb2cf217e6bcff342fcc9314f082a5d8975abcb56897e86eba5839ddf0ec1ac3feed1e797d4c68cea22228197342916f14bb87309bbcc026a87622bc015 +SHA512 (zsh-5.9.2.tar.xz.asc) = 9657c8fef30124e4ea1b4ab41c80b471990c52c362e53f40c9bcca1be1b48af5d19437ecf6a645dbe9ea328d82cc43f9d88ad3835d23d76e482969017a956bf6 diff --git a/zsh.spec b/zsh.spec index a705f04..c60fd6f 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,6 +1,6 @@ Summary: Powerful interactive shell Name: zsh -Version: 5.9.1 +Version: 5.9.2 Release: 1%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ @@ -17,13 +17,6 @@ Source7: zshenv.rhs Source8: dotzshrc Source9: dotzprofile -# upstream commit a84fdd7c8f77935ecce99ff2b0bdba738821ed79 -Patch1: 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch - -# downstream patch for rhbz#2449939 -# already fixed upstream in a major refactor of term color attribute handling -Patch100: 0100-zsh-_IO_putc-SIGSEGV.patch - BuildRequires: coreutils BuildRequires: gawk BuildRequires: gcc @@ -161,6 +154,9 @@ fi %doc Doc/*.html %changelog +* Mon Jul 13 2026 Lukáš Zaoral - 5.9.2-1 +- rebase to the latest upstream release (rhbz#2499540) + * Thu Jun 04 2026 Lukáš Zaoral - 5.9.1-1 - rebase to the latest upstream release (rhbz#2483668) From 05dc358b1a49ce5f15812aa3293b189c707dd9e4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 09:43:40 +0000 Subject: [PATCH 73/74] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- zsh.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh.spec b/zsh.spec index c60fd6f..97033ac 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9.2 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ @@ -154,6 +154,9 @@ fi %doc Doc/*.html %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 5.9.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Mon Jul 13 2026 Lukáš Zaoral - 5.9.2-1 - rebase to the latest upstream release (rhbz#2499540) From 4a2d5294300503e84cb349010b8358b9bb1dee7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Wed, 22 Jul 2026 16:16:15 +0200 Subject: [PATCH 74/74] fix crash with bracketed-paste-magic and undo Resolves: rhbz#2484692 --- zsh-memcpy-sigsegv-bracketed-paste.patch | 83 ++++++++++++++++++++++++ zsh.spec | 11 +++- 2 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 zsh-memcpy-sigsegv-bracketed-paste.patch diff --git a/zsh-memcpy-sigsegv-bracketed-paste.patch b/zsh-memcpy-sigsegv-bracketed-paste.patch new file mode 100644 index 0000000..5310b19 --- /dev/null +++ b/zsh-memcpy-sigsegv-bracketed-paste.patch @@ -0,0 +1,83 @@ +From b258cb7816323050d7e485171c92ad3f1046799e Mon Sep 17 00:00:00 2001 +From: Mikael Magnusson +Date: Fri, 17 Jul 2026 22:53:21 +0200 +Subject: [PATCH] 54985: fix crash with bracketed-paste-magic and undo + +In particular, fc -P/-p didn't interact well with undo. Make sure we +store/restore histline across those calls. + +(cherry-picked from commit 7708d466dfab8dd29f9ae5de12c74af37bf99a4d) +--- + Src/Zle/zle_main.c | 8 ++++++++ + Src/hist.c | 7 ++++++- + Src/zsh.h | 3 ++- + 3 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c +index 44ee63d..817e605 100644 +--- a/Src/Zle/zle_main.c ++++ b/Src/Zle/zle_main.c +@@ -2168,6 +2168,14 @@ zle_main_entry(int cmd, va_list ap) + break; + } + ++ case ZLE_CMD_GET_HIST_LINE: ++ { ++ zlong *p = va_arg(ap, zlong *); ++ *p = histline; ++ ++ break; ++ } ++ + default: + #ifdef DEBUG + dputs("Bad command %d in zle_main_entry", cmd); +diff --git a/Src/hist.c b/Src/hist.c +index f58db23..85f329c 100644 +--- a/Src/hist.c ++++ b/Src/hist.c +@@ -226,6 +226,7 @@ static struct histsave { + HashTable histtab; + Histent hist_ring; + zlong curhist; ++ zlong histline; + zlong histlinect; + zlong histsiz; + zlong savehistsiz; +@@ -3846,6 +3847,10 @@ pushhiststack(char *hf, zlong hs, zlong shs, int level) + h->histsiz = histsiz; + h->savehistsiz = savehistsiz; + h->locallevel = level; ++ if (zleactive) ++ zleentry(ZLE_CMD_GET_HIST_LINE, &h->histline); ++ else ++ h->histline = 0; + + memset(&lasthist, 0, sizeof lasthist); + if (hf) { +@@ -3898,7 +3903,7 @@ pophiststack(void) + hist_ring = h->hist_ring; + curhist = h->curhist; + if (zleactive) +- zleentry(ZLE_CMD_SET_HIST_LINE, curhist); ++ zleentry(ZLE_CMD_SET_HIST_LINE, h->histline); + histlinect = h->histlinect; + histsiz = h->histsiz; + savehistsiz = h->savehistsiz; +diff --git a/Src/zsh.h b/Src/zsh.h +index 8fab0eb..32302ec 100644 +--- a/Src/zsh.h ++++ b/Src/zsh.h +@@ -3244,7 +3244,8 @@ enum { + ZLE_CMD_REFRESH, + ZLE_CMD_SET_KEYMAP, + ZLE_CMD_GET_KEY, +- ZLE_CMD_SET_HIST_LINE ++ ZLE_CMD_SET_HIST_LINE, ++ ZLE_CMD_GET_HIST_LINE, + }; + + /***************************************/ +-- +2.55.0 + diff --git a/zsh.spec b/zsh.spec index 97033ac..8ceb62f 100644 --- a/zsh.spec +++ b/zsh.spec @@ -1,7 +1,7 @@ Summary: Powerful interactive shell Name: zsh Version: 5.9.2 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT-Modern-Variant AND ISC AND GPL-2.0-only URL: http://zsh.sourceforge.net/ @@ -17,6 +17,10 @@ Source7: zshenv.rhs Source8: dotzshrc Source9: dotzprofile +# https://sourceforge.net/p/zsh/code/ci/7708d466dfab8dd29f9ae5de12c74af37bf99a4d/ +# fix crash with bracketed-paste-magic and undo (rhbz#2484692) +Patch: zsh-memcpy-sigsegv-bracketed-paste.patch + BuildRequires: coreutils BuildRequires: gawk BuildRequires: gcc @@ -46,7 +50,7 @@ mechanism, and more. %package html Summary: Zsh shell manual in html format -BuildArch: noarch +BuildArch: noarch %description html The zsh shell is a command interpreter usable as an interactive login @@ -154,6 +158,9 @@ fi %doc Doc/*.html %changelog +* Wed Jul 22 2026 Lukáš Zaoral - 5.9.2-3 +- fix crash with bracketed-paste-magic and undo (rhbz#2484692) + * Fri Jul 17 2026 Fedora Release Engineering - 5.9.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild