Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1164312

Summary: incorrect comment in default zshenv configuration file [RHEL-7]
Product: Red Hat Enterprise Linux 7 Reporter: Kamil Dudka <kdudka>
Component: zshAssignee: Kamil Dudka <kdudka>
Status: CLOSED ERRATA QA Contact: Jan Kepler <jkejda>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: jkejda, msvistun, ovasik
Target Milestone: rcKeywords: EasyFix
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: zsh-5.0.2-9.el7 Doc Type: Bug Fix
Doc Text:
Previously, the /etc/zshenv configuration file contained a comment stating that /etc/zshenv is not sourced if zsh is executed with the -f option, which is not true, because /etc/zshenv is always sourced. With this update, the comment has been replaced with a correct one and so no longer causes confusion.
Story Points: ---
Clone Of: 1103697
: 1164313 (view as bug list) Environment:
Last Closed: 2015-11-19 05:20:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1164313    
Bug Blocks: 1103697    

Description Kamil Dudka 2014-11-14 16:06:04 UTC
+++ This bug was initially created as a clone of Bug #1103697 +++

Description of problem:

Misleading comment in the /etc/zshenv file provided by zsh package. Specifically, it states that executing zsh with -f will cause the file to not be sourced, which is incorrect. The man page correctly notes that zshenv is always parsed.

The file is always sourced, and hence if you want to avoid having a particular section take effect with -f, you need to encapsulate it with an if statement.

Here is some output to demonstrate that /etc/zshenv is always sourced, even if zsh is launched with -f:

[root@localhost]/# rpm -q zsh
zsh-4.3.10-4.1.el6.x86_64

[root@localhost]/# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.2 (Santiago)

[root@localhost]/# cat /etc/zshenv
#
# /etc/zshenv is sourced on all invocations of the
# shell, unless the -f option is set.  It should
# contain commands to set the command search path,
# plus other important environment variables.
# .zshenv should not contain commands that produce
# output or assume the shell is attached to a tty.
#

[root@localhost]/# echo $EVBTEST

[root@localhost]/# echo 'EVBTEST=yep' >> /etc/zshenv
[root@localhost]/# zsh -f
[root@localhost]# echo $EVBTEST
yep


Version-Release number of selected component (if applicable):
zsh-4.3.10-4.1.el6.x86_64

How reproducible:
Everytime

Steps to Reproduce:

[root@localhost]/# echo $EVBTEST

[root@localhost]/# echo 'EVBTEST=yep' >> /etc/zshenv
[root@localhost]/# zsh -f
[root@localhost]# echo $EVBTEST
yep

Actual results:
The configuration file misinterprets it. 

Expected results:
The configuration file should provide the correct information.

Additional info:

--- Additional comment from Kamil Dudka on 2014-11-14 17:02:11 CET ---

This is a bug inherited from Fedora, where it still exists even in rawhide.

I proposed to replace the comment by the one that Ubuntu distributes:

# /etc/zsh/zshenv: system-wide .zshenv file for zsh(1).
#
# This file is sourced on all invocations of the shell.
# If the -f flag is present or if the NO_RCS option is
# set within this file, all other initialization files
# are skipped.
#
# This file should contain commands to set the command
# search path, plus other important environment variables.
# This file should not contain commands that produce
# output or assume the shell is attached to a tty.
#
# Global Order: zshenv, zprofile, zshrc, zlogin

Comment 7 errata-xmlrpc 2015-11-19 05:20:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2208.html