Bug 804604 - Error in /etc/profile.d/colorls.csh
Error in /etc/profile.d/colorls.csh
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: coreutils (Show other bugs)
6.2
All Linux
low Severity low
: rc
: ---
Assigned To: Ondrej Vasik
qe-baseos-daemons
:
: 808211 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-19 07:48 EDT by Nikhil AR
Modified: 2013-03-03 21:43 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 10:34:33 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Nikhil AR 2012-03-19 07:48:58 EDT
Description of problem:

/etc/profile.d/colorls.csh contains this (line 20):

  if ( "`tty -s && tput colors`" == "256" ) then

Csh is not short-circuiting the logical AND on this line, such that both "tty -s" and "tput colors" are executed. This causes an error "tput: No value for $TERM and no -T specified" when the SHELL has no TERM defined (via rsh for example).

Version-Release number of selected component (if applicable):
coreutils-8.4-16.el6.x86_64

How reproducible:
Always

Additional info:

Here is a suggested fix:

--- /etc/profile.d/colorls.csh 2010-04-28 08:58:35.000000000 -0600
+++ /tmp/colorls.csh 2012-03-12 11:04:19.971867964 -0600
@@ -16,8 +16,9 @@
      set COLORS="/etc/DIR_COLORS.$TERM"
   endif
 endif
+
 if ( -e "/etc/DIR_COLORS.256color" ) then
-  if ( "`tty -s && tput colors`" == "256" ) then
+  if ( "`tty -s` && tput colors" == "256" ) then
      set COLORS=/etc/DIR_COLORS.256color
   endif
 endif
Comment 1 Ondrej Vasik 2012-03-30 15:29:01 EDT
*** Bug 808211 has been marked as a duplicate of this bug. ***
Comment 7 errata-xmlrpc 2012-06-20 10:34:33 EDT
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.

http://rhn.redhat.com/errata/RHBA-2012-0933.html

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