| Summary: | ( ) compound list is altering environment | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Wolf-Dietrich <wolf-dietrich> | ||||
| Component: | ksh | Assignee: | Michal Hlavinka <mhlavink> | ||||
| Status: | CLOSED ERRATA | QA Contact: | BaseOS QE - Apps <qe-baseos-apps> | ||||
| Severity: | urgent | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.0 | CC: | mfranc, ovasik, prc | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: |
Previously, a ( ) compound list did not always use a copy of the environment which caused the original environment to be altered. Scripts could behave unexpectedly because their variables could be changed. With this update, a copy of the environment is always used for a ( ) compound list; thus, the original environment is not affected by commands from the ( ) compound list.
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2011-05-19 13:50:27 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
|
Description
Wolf-Dietrich
2011-03-02 10:05:46 UTC
(In reply to comment #0) > ( . ./xx ) ##### first call modifies local environment > ( . ./xx ) ##### secon call core dump sigsev this is already fixed in new ksh package prepared for next rhel6 update > How reproducible: > unpack attachment (tar) > see Readme > call ksh and follow instructions from Readme the "y1" reproducer is not fixed yet, I'll look at it > Additional info: > works in redhat 5.5 > ubuntu all versions > SunOS 9,10 > .... it works there because they use older ksh versions which suffer from other bugs "y1" reproducer bug got introduced between 2010-03-09 (working) and 2010-05-27 (broken) simplified reproducers for "y1" bug:
a)
RET=$(ksh -c '( function fx { export X=123; } ; fx; ); echo $X')
[ -z "$RET" ] && echo "works fine" || echo "bug present"
b)
RET=$(ksh -c 'echo "/bin/true; function fx { export X=123; } ; fx;" >/tmp/kshtest; ( . /tmp/kshtest >/dev/null ); echo $X; rm -f /tmp/kshtest')
[ -z "$RET" ] && echo "works fine" || echo "bug present"
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, a ( ) compound list did not always use a copy of the environment which caused the original environment to be altered. Scripts could behave unexpectedly because their variables could be changed. With this update, a copy of the environment is always used for a ( ) compound list; thus, the original environment is not affected by commands from the ( ) compound list.
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 therefore 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-2011-0645.html |