Bug 804604 - Error in /etc/profile.d/colorls.csh
Summary: Error in /etc/profile.d/colorls.csh
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: coreutils
Version: 6.2
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Ondrej Vasik
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
: 808211 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-19 11:48 UTC by Nikhil AR
Modified: 2018-11-28 20:49 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-20 14:34:33 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0933 0 normal SHIPPED_LIVE coreutils bug fix and enhancement update 2012-06-19 20:45:56 UTC

Description Nikhil AR 2012-03-19 11:48:58 UTC
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 19:29:01 UTC
*** Bug 808211 has been marked as a duplicate of this bug. ***

Comment 7 errata-xmlrpc 2012-06-20 14:34:33 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.

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.