Bug 1222140

Summary: Not all utilities are called with full path in /etc/profile and /etc/profile.d/colorls.sh
Product: Red Hat Enterprise Linux 6 Reporter: Yoshifumi Kinoshita <ykinoshi>
Component: coreutilsAssignee: Ondrej Vasik <ovasik>
Status: CLOSED ERRATA QA Contact: Branislav Blaškovič <bblaskov>
Severity: low Docs Contact:
Priority: low    
Version: 6.6CC: bblaskov, psklenar, wburrows
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: coreutils-8.4-42.el6 Doc Type: Bug Fix
Doc Text:
Cause: ls colorizations scripts used just utility names. Consequence: When some mountpoint in the PATH envvar is not yet mounted, these scripts take long time to complete. Fix: Utilities are called with full paths. Result: Unavailable mountpoints no longer affect time of completion of these basic scripts.
Story Points: ---
Clone Of:
: 1222223 (view as bug list) Environment:
Last Closed: 2016-05-11 00:31:02 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: 1172231, 1222223, 1254457    

Comment 2 Ondrej Vasik 2015-05-16 16:44:14 UTC
Customer can modify their $PATH variables, to have /usr/bin , /bin, /sbin and /usr/sbin earlier than /usr/local (which is mounted via NFS). 

Btw. /usr/local is supposed to be used for LOCAL installation of software - and therefore NFS mounting is dangerous - it may break more stuff than just root login ( http://www.pathname.com/fhs/pub/fhs-2.3.pdf ). Maybe /opt is more suitable there.

However, can be adjusted in next coreutils update - although I tend to say this is not really a bug, full path is safer.

Comment 3 Ondrej Vasik 2015-05-16 16:51:22 UTC
(although it is frequently used for sharing applications through NFS, of course - but as I said, with adjustment of PATH, root login delay should not happen)

Comment 4 Ondrej Vasik 2015-06-04 08:39:11 UTC
Can you please file separate bug report for /etc/profile ? This one file is from setup package, not from coreutils - therefore I can't cover it with one bug report.

Comment 5 Yoshifumi Kinoshita 2015-06-04 14:32:37 UTC
Ondrej,
I posted Bug #1228282.

Comment 15 Branislav Blaškovič 2016-02-16 09:45:45 UTC
All utilities from /etc/profile.d/ dir which belongs to coreutils package are typed with absolute path now.

Using package: coreutils-8.4-42.el6.x86_64

# egrep --color=always '(id|tty|tput|dircolors|grep)' -r $(rpm -ql coreutils | grep '/etc/profile.d/')
/etc/profile.d/colorls.csh:     #when USER_LS_COLORS defined do not override user
/etc/profile.d/colorls.csh:    if ( "`/usr/bin/tput colors`" == "256" ) then
/etc/profile.d/colorls.csh:if ( -f ~/.dircolors ) set COLORS=~/.dircolors
/etc/profile.d/colorls.csh:  if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
/etc/profile.d/colorls.csh:eval "`/usr/bin/dircolors -c $COLORS`"
/etc/profile.d/colorls.sh:#when USER_LS_COLORS defined do not override user LS_COLORS, but use them.
/etc/profile.d/colorls.sh:  for colors in "$HOME/.dir_colors.$TERM" "$HOME/.dircolors.$TERM" \
/etc/profile.d/colorls.sh:      "$HOME/.dir_colors" "$HOME/.dircolors"; do
/etc/profile.d/colorls.sh:      [ "x`/usr/bin/tty -s && /usr/bin/tput colors 2>/dev/null`" = "x256" ] && \
/etc/profile.d/colorls.sh:  eval "`/usr/bin/dircolors --sh "$COLORS" 2>/dev/null`"
/etc/profile.d/colorls.sh:  /usr/bin/grep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return


Old package coreutils-8.4-37.el6.x86_64:
# egrep --color=always '(id|tty|tput|dircolors|grep)' -r $(rpm -ql coreutils | grep '/etc/profile.d/')
/etc/profile.d/colorls.csh:     #when USER_LS_COLORS defined do not override user
/etc/profile.d/colorls.csh:    if ( "`tput colors`" == "256" ) then
/etc/profile.d/colorls.csh:if ( -f ~/.dircolors ) set COLORS=~/.dircolors
/etc/profile.d/colorls.csh:  if ( -f ~/.dircolors."$TERM" ) set COLORS=~/.dircolors."$TERM"
/etc/profile.d/colorls.csh:eval "`dircolors -c $COLORS`"
/etc/profile.d/colorls.sh:#when USER_LS_COLORS defined do not override user LS_COLORS, but use them.
/etc/profile.d/colorls.sh:  for colors in "$HOME/.dir_colors.$TERM" "$HOME/.dircolors.$TERM" \
/etc/profile.d/colorls.sh:      "$HOME/.dir_colors" "$HOME/.dircolors"; do
/etc/profile.d/colorls.sh:      [ "x`tty -s && tput colors 2>/dev/null`" = "x256" ] && \
/etc/profile.d/colorls.sh:  eval "`dircolors --sh "$COLORS" 2>/dev/null`"
/etc/profile.d/colorls.sh:  grep -qi "^COLOR.*none" $COLORS >/dev/null 2>/dev/null && return

Comment 17 errata-xmlrpc 2016-05-11 00:31:02 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-2016-0906.html