Bug 202468 - less breaks if its startup script outputs anything
Summary: less breaks if its startup script outputs anything
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: setup
Version: 4.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Phil Knirsch
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 299221
TreeView+ depends on / blocked
 
Reported: 2006-08-14 17:35 UTC by Jakub Hrozek
Modified: 2015-03-05 01:17 UTC (History)
3 users (show)

Fixed In Version: RHBA-2008-0130
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-05 12:30:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch to fix non-interactive mod of tcsh (618 bytes, patch)
2007-11-21 12:16 UTC, Zdenek Prikryl
no flags Details | Diff
Patch to fix non-interactive mod of tcsh (and keep path definition processing) (547 bytes, patch)
2008-11-05 13:13 UTC, Ondrej Vasik
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0130 0 normal SHIPPED_LIVE setup bug fix and enhancement update 2008-07-23 21:57:38 UTC

Description Jakub Hrozek 2006-08-14 17:35:56 UTC
Description of problem:
This was initially raised by Jack Neely (jjneely, see bz #186931, 
comment #3) and verified to be present in RHEL 4.4

Version-Release number of selected component (if applicable):
less-382-4.rhel4.i386

How reproducible:
always

Steps to Reproduce:
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
  
Actual results:
You see the word "FOO" displayed rather than the text of /etc/hosts

Expected results:
the text of /etc/hosts

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

Comment 1 Zdenek Prikryl 2007-11-21 12:14:35 UTC
This is caused by a processing of scripts /etc/profile.d/* in non-interactive
mod of tcsh. When tcsh is executed, then all scripts in /etc/profile.d/*.csh are
executed too. Even in non-interactive mod. But in this mod, tcsh should not
execute those scripts. This bad behavior leads to problems, because a less is
confused. Then the less accepts as a input a text from echo instead a text from
/etc/hosts. The solution is to reflect non-interactive mod in /etc/csh.cshrc.
I'll attach a patch, which solve this.

Zdenek

Comment 2 Zdenek Prikryl 2007-11-21 12:16:33 UTC
Created attachment 265921 [details]
patch to fix non-interactive mod of tcsh

Comment 3 Phil Knirsch 2008-02-22 16:19:41 UTC
Very simple fix, proposing for RHEL-4.8 FasTrack.

Read ya, Phil

Comment 9 errata-xmlrpc 2008-03-05 12:30:44 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-2008-0130.html


Comment 10 Adam Tkac 2008-10-07 08:56:49 UTC
This fix caused regression - bug #464788. In my opinion fix should be reverted because it is impossible fix both #202468 and #464788.

Comment 11 Ondrej Vasik 2008-11-05 13:13:11 UTC
Created attachment 322565 [details]
Patch to fix non-interactive mod of tcsh (and keep path definition processing)

I guess both issues could be solved together by redirecting stdout and stderr to /dev/null for noninteractive shells ... tried following patch and it works for me in both cases.


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