Bug 1389492 - zsh crash in --no-exec and emulation mode if accessing the HOME environment variable
Summary: zsh crash in --no-exec and emulation mode if accessing the HOME environment v...
Keywords:
Status: CLOSED DUPLICATE of bug 1267251
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: zsh
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Kamil Dudka
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-27 17:58 UTC by Paulo Andrade
Modified: 2019-12-16 07:15 UTC (History)
2 users (show)

Fixed In Version: zsh-5.0.2-17.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-10-31 12:35:43 UTC
Target Upstream Version:


Attachments (Terms of Use)
zsh-bz1389492.patch (1.41 KB, patch)
2016-10-28 11:59 UTC, Paulo Andrade
no flags Details | Diff

Description Paulo Andrade 2016-10-27 17:58:23 UTC
Simple reproducer:

"""
$ ln -sf /bin/zsh ksh
$ cat t.sh
# !/bin/sh
echo $HOME
$ ./ksh -n t.sh
"""

  Problem has also been reported to upstream, with
an initial possible patch:

"""
--- zsh-5.0.2/Src/init.c.orig	2016-10-27 15:36:29.210875166 -0200
+++ zsh-5.0.2/Src/init.c	2016-10-27 15:36:33.581867451 -0200
@@ -963,7 +963,7 @@ setupvals(void)
     if (EMULATION(EMULATE_ZSH))
 	ptr = home;
     else
-	ptr = zgetenv("HOME");
+	ptr = home = zgetenv("HOME");
     if (ptr && ispwd(ptr))
 	pwd = ztrdup(ptr);
     else if ((ptr = zgetenv("PWD")) && (strlen(ptr) < PATH_MAX) &&
"""

Comment 2 Paulo Andrade 2016-10-28 11:59:32 UTC
Created attachment 1214975 [details]
zsh-bz1389492.patch

Upstream patch. Needs edit as ChangeLog diff will not apply.

Comment 3 Kamil Dudka 2016-10-30 21:01:49 UTC
Please remember to report the exact NVR (Name-Version-Release) of the package you tested it with.  Is this a duplicate of bug #1267251?

Comment 4 Paulo Andrade 2016-10-31 11:56:45 UTC
It is indeed a duplicate of #1267251
Package was zsh-5.0.2-14.el7_2.2

Comment 5 Kamil Dudka 2016-10-31 12:35:43 UTC

*** This bug has been marked as a duplicate of bug 1267251 ***


Note You need to log in before you can comment on or make changes to this bug.