Bug 19968 - /etc/profile can put /usr/X11R6/bin in path twice
Summary: /etc/profile can put /usr/X11R6/bin in path twice
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: setup
Version: 7.0
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-10-28 21:43 UTC by Jeff Norden
Modified: 2014-03-17 02:17 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-10-28 21:43:53 UTC
Embargoed:


Attachments (Terms of Use)

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!


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