Bug 186931 - less breaks with tcsh's printexitvalue=1
Summary: less breaks with tcsh's printexitvalue=1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: less
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Ivana Varekova
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks: FAST4.5APPROVED
TreeView+ depends on / blocked
 
Reported: 2006-03-27 15:43 UTC by Bastien Nocera
Modified: 2010-10-20 11:26 UTC (History)
2 users (show)

Fixed In Version: RHBA-2006-0630
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 845527 (view as bug list)
Environment:
Last Closed: 2006-09-06 13:59:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
lesspipe-no-compressor-error.patch (321 bytes, patch)
2006-03-27 15:43 UTC, Bastien Nocera
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0630 0 normal SHIPPED_LIVE less bug fix update 2007-05-01 14:06:09 UTC

Description Bastien Nocera 2006-03-27 15:43:12 UTC
less-382-4

1. Create a new user with the tcsh shell as the default
useradd test1 -s /bin/tcsh
2. Set the printexitvalue as a default
echo "set printexitvalue=1" > ~test1/.cshrc
3. Login as test1
su - test1
4. Try to see with less a file that doesn't have a handler in lesspipe.sh
$ less /etc/hosts
Exit 127
/etc/hosts (END)

This is due to lesspipe.sh trying to launch "--" as the viewer command
($DECOMPRESSOR isn't set)
Attached patch fixes that

Comment 1 Bastien Nocera 2006-03-27 15:43:12 UTC
Created attachment 126827 [details]
lesspipe-no-compressor-error.patch

Comment 3 Jack Neely 2006-05-09 19:57:19 UTC
This is not specific to tcsh's printexitvalue=1.  

This bug happens if the tcsh's startup scripts create any output.

Test Case:

1. Create /etc/profile.d/test.csh that contains:
---
#!/bin/tcsh

echo "FOO"
---
2. Login as a user with tcsh as the default shell
3. Run: less /etc/hosts

Results: You see the word "FOO" displayed rather than the text of /etc/hosts

Cause: less does a popen("/bin/tcsh -c /usr/bin/lesspipe.sh /etc/hosts") where
the shell is gotten from the users default shell.  

Comment 10 Red Hat Bugzilla 2006-09-06 13:59:49 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0630.html



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