Resolves: #1269883 - fix crash in ksh mode with -n and $HOME

This commit is contained in:
Kamil Dudka 2015-10-08 15:00:31 +02:00
parent 10ded2c11a
commit 01a2dcb2f4
2 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,45 @@
From 12914ffb8af4f850637ee92bc2997218de6a179c Mon Sep 17 00:00:00 2001
From: Peter Stephenson <pws@zsh.org>
Date: Tue, 6 Oct 2015 09:28:07 +0100
Subject: [PATCH] 36780: Fix crash in ksh mode with -n and $HOME.
If home variable is NULL ensure HOME is unset.
Upstream-commit: 83a175795a444e8169fcb592a110d4d15a09b907
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
Src/params.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Src/params.c b/Src/params.c
index de151a4..a8abb28 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -775,17 +775,18 @@ createparamtable(void)
#endif
opts[ALLEXPORT] = oae;
+ /*
+ * For native emulation we always set the variable home
+ * (see setupvals()).
+ */
+ pm = (Param) paramtab->getnode(paramtab, "HOME");
if (EMULATION(EMULATE_ZSH))
{
- /*
- * For native emulation we always set the variable home
- * (see setupvals()).
- */
- pm = (Param) paramtab->getnode(paramtab, "HOME");
pm->node.flags &= ~PM_UNSET;
if (!(pm->node.flags & PM_EXPORTED))
addenv(pm, home);
- }
+ } else if (!home)
+ pm->node.flags |= PM_UNSET;
pm = (Param) paramtab->getnode(paramtab, "LOGNAME");
if (!(pm->node.flags & PM_EXPORTED))
addenv(pm, pm->u.str);
--
2.5.2

View File

@ -3,7 +3,7 @@
Summary: Powerful interactive shell
Name: zsh
Version: 5.1.1
Release: 1%{?dist}
Release: 2%{?dist}
License: MIT
URL: http://zsh.sourceforge.net/
Group: System Environment/Shells
@ -21,6 +21,9 @@ Patch0: zsh-serial.patch
Patch1: zsh-4.3.6-8bit-prompts.patch
Patch2: zsh-test-C02-dev_fd-mock.patch
# fix crash in ksh mode with -n and $HOME (#1269883)
Patch3: zsh-5.1.1-ksh-n-home.patch
BuildRequires: coreutils sed ncurses-devel libcap-devel
BuildRequires: texinfo texi2html gawk hostname
Requires(post): info grep
@ -57,6 +60,7 @@ This package contains the Zsh manual in html format.
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
cp -p %SOURCE7 .
@ -159,6 +163,9 @@ fi
%doc Doc/*.html
%changelog
* Thu Oct 08 2015 Kamil Dudka <kdudka@redhat.com> - 5.1.1-2
- fix crash in ksh mode with -n and $HOME (#1269883)
* Mon Sep 14 2015 Kamil Dudka <kdudka@redhat.com> - 5.1.1-1
- Update to latest upstream release: Zsh 5.1.1