Bug 32478 - /etc/zshenv trashes environment
/etc/zshenv trashes environment
Product: Red Hat Linux
Classification: Retired
Component: zsh (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-03-20 20:17 EST by Cameron Simpson
Modified: 2007-04-18 12:32 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-03-20 20:17:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Cameron Simpson 2001-03-20 20:17:24 EST
The /etc/zshenv file gratuitously screws around with the shell environment.
For all users it gratuitously adds some path components to the end of the
path is not present (in a very inefficient fashion, too).

Worse, if you're root it throws away any PATH setting which may have
been set up. Yea, not only for interactive shells but for all shells.
So even the trivial

	export PATH=$PATH:/opt/sbin
	zsh some-zsh-script-expecting-/opt/sbin

will fail.

This is very very bad. The zshenv file MUST NOT trash the root environment
inherited from the zsh invoker. And it's gratuitous and performance
to muck with the PATH on _every_ zsh start, and inefficient to do it
with greps!

	replace the shipped /etc/zshenv with an empty file
or	don't make /etc/zshenv part of the RPM package
Comment 1 Trond Eivind Glomsrxd 2001-03-21 17:43:02 EST
Fixed in  zsh-4.0.1-0.2pre2, which someday will show up in Rawhide - and for a
limited time at http://people.redhat.com/~teg/

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