Bug 1625629

Summary: The /etc/csh.login expects environment variable PATH
Product: Red Hat Enterprise Linux 7 Reporter: Paulo Andrade <pandrade>
Component: setupAssignee: Pavel Zhukov <pzhukov>
Status: CLOSED ERRATA QA Contact: Petr Dancak <pdancak>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: bnater, pdancak, psklenar, thozza
Target Milestone: rcKeywords: Reproducer
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: setup-2.8.71-11.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1744104 (view as bug list) Environment:
Last Closed: 2020-03-31 20:03:20 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:    
Bug Blocks: 1660473, 1716960    

Description Paulo Andrade 2018-09-05 11:53:57 UTC
User was asked how the problem is triggered.
  But it is very easy to reproduce starting with *sh:

"""
[pcpa@rhel7 ~]$ unset PATH
bash: sed: No such file or directory
[pcpa@rhel7 ~]$ echo $PATH

bash: sed: No such file or directory
[pcpa@rhel7 ~]$ /bin/tcsh -l
PATH: Undefined variable.
[pcpa@rhel7 ~]$ echo $SHELL
/bin/bash
"""

  The problem started with
https://pagure.io/setup/c/78d62a2d107b61b043b712e30b0ce43cd7dcd3c0
and interestingly, setup.spec has this:

* Tue Oct 13 1998 Cristian Gafton <gafton>
- fix the csh.cshrc re: ${PATH} undefined

so, a variant of this issue likely happened before.

  The problem happens in recent Fedora and RHEL8 as well.

Comment 2 Paulo Andrade 2018-09-06 01:59:41 UTC
The problem is triggered with test a user used in development and
regression tests, where $PATH happens to not be set. It was not an
issue in RHEL6, but the changes in RHEL7 cause the problem.
For the moment, the user was told to use pam_env as a temporary
workaround.

Comment 3 David Kaspar // Dee'Kej 2018-09-07 09:33:29 UTC
[root@qeos-32 ~]# rpm -qf /etc/csh.login 
setup-2.8.71-10.el7.noarch

... It's actually setup package who owns that file. You can also see it from the commit you have posted here.

Comment 4 Martin Osvald 🛹 2019-06-20 12:31:53 UTC
I see the printing itself of "PATH: Undefined variable." as a cosmetic problem as tcsh interpreter simply prints it when a variable isn't defined.

What I see problematic is that previously it set PATH to some default value if undefined, but now does nothing, leaving it empty.

The mentioned patch:

https://pagure.io/setup/c/78d62a2d107b61b043b712e30b0ce43cd7dcd3c0

removes that behavior even it should have influenced PATH only in case when it is defined and not containing /usr/local/sbin /usr/sbin to add it so non-root user can start wireshark by clicking on a desktop icon.

We should fix this.

Comment 16 errata-xmlrpc 2020-03-31 20:03:20 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://access.redhat.com/errata/RHBA-2020:1120