Bug 19968

Summary: /etc/profile can put /usr/X11R6/bin in path twice
Product: [Retired] Red Hat Linux Reporter: Jeff Norden <jeff>
Component: setupAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: medium    
Version: 7.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-28 21:43:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeff Norden 2000-10-28 21:43:51 UTC
/etc/profile has the line:

PATH="$PATH:/usr/X11R6/bin"

which unconditionally changes the path.  This is correct behavior if bash
is spawned directly by /bin/login, but in other situations it can put
/usr/X11R6/bin into the path twice. 

This happens is with an ssh login, since ssh doesn't use /bin/login unless
the UseLogin option is selected.  Another way to reproduce the problem is
to use 'su - foo' to change to the user foo.  The best fix, imho, is to
have /etc/profile do a check before modifying the path.  Here is one of
many ways this can be done (not the shortest way, but at least its not too
cryptic):

echo $PATH | /bin/grep --silent /usr/X11R6/bin
if [ $? -ne 0 ]; then
  PATH="$PATH:/usr/X11R6/bin"
fi

Comment 1 Bill Nottingham 2001-01-29 18:38:21 UTC
will be fixed in setup-2.3.7-1; thanks!