Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 650998 - The dot command may misdirect output
The dot command may misdirect output
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ksh (Show other bugs)
5.6
Unspecified Unspecified
low Severity medium
: rc
: ---
Assigned To: Michal Hlavinka
qe-baseos-tools
:
Depends On:
Blocks: 651888
  Show dependency treegraph
 
Reported: 2010-11-08 10:57 EST by Tomas Smetana
Modified: 2012-02-21 00:50 EST (History)
4 users (show)

See Also:
Fixed In Version: ksh-20100621-1.el5
Doc Type: Bug Fix
Doc Text:
Previously, ksh did not restore file handles after executing a sourced script. If an output stream or an error stream was redirected in the sourced script, the respective stream remained redirected in the parent script as well. With this update, file handles are restored after execution of sourced scripts so a parent script is not affected by sourced script redirections.
Story Points: ---
Clone Of:
: 651888 (view as bug list)
Environment:
Last Closed: 2012-02-21 00:50:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Proposed patch (475 bytes, patch)
2010-11-08 10:58 EST, Tomas Smetana
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0159 normal SHIPPED_LIVE ksh bug fix and enhancement update 2012-02-20 09:53:47 EST

  None (edit)
Description Tomas Smetana 2010-11-08 10:57:12 EST
Description of problem:
ksh does not restore file handles after execution of a sourced script. If output or error stream is redirected in the sourced script, the respective stream remains redirected in the parent script as well.

Version-Release number of selected component (if applicable):
ksh-20100202-1.el5_5.1

How reproducible:
always

Steps to Reproduce:
1. Prepare 3 scripts:

$ cat > 1.ksh
. ./2.ksh
echo "STDOUT"

$ cat > 2.ksh
echo "STDERR" >&2

cat > run.ksh
. ./1.ksh

2.  And then execute run.ksh with standard output redirected to /dev/null:

$ ksh ksh.ksh > /dev/null

3.
  
Actual results:
STDERR
STDOUT


Expected results:
STDERR

Additional info:
This bug has been fixed in the latest upstream beta version (ksh-2010-10-10).
Comment 1 Tomas Smetana 2010-11-08 10:58:02 EST
Created attachment 458785 [details]
Proposed patch

Backport from ksh-2010-10-10
Comment 2 Michal Hlavinka 2010-11-10 09:53:13 EST
reproducible
Comment 3 RHEL Product and Program Management 2011-01-11 15:20:57 EST
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 4 RHEL Product and Program Management 2011-01-11 17:45:20 EST
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.
Comment 5 Martin Prpič 2011-03-16 11:58:42 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Previously, ksh did not restore file handles after executing a sourced script. If an output stream or an error stream was redirected in the sourced script, the respective stream remained redirected in the parent script as well. With this update, file handles are restored after execution of sourced scripts so a parent script is not affected by sourced script redirections.
Comment 6 RHEL Product and Program Management 2011-05-31 09:19:42 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 9 errata-xmlrpc 2012-02-21 00:50:25 EST
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-0159.html

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