Bug 503701
| Summary: | Cannot process scripts beyond an embedded NULL character when running in 'source' mode | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 5 | Reporter: | Tomas Smetana <tsmetana> | ||||||||
| Component: | bash | Assignee: | Roman Rakus <rrakus> | ||||||||
| Status: | CLOSED ERRATA | QA Contact: | BaseOS QE <qe-baseos-auto> | ||||||||
| Severity: | medium | Docs Contact: | |||||||||
| Priority: | medium | ||||||||||
| Version: | 5.3 | CC: | bnater, mhusnain, rvokal, tsmetana | ||||||||
| Target Milestone: | rc | ||||||||||
| Target Release: | --- | ||||||||||
| Hardware: | All | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Fixed In Version: | bash-3.2-27.el5 | Doc Type: | Bug Fix | ||||||||
| Doc Text: |
When Bash ran a shell script with an embedded null character, bash's source builtin parsed the script incorrectly. This is fixed and bash's source builtin correctly parses shell script null characters.
|
Story Points: | --- | ||||||||
| Clone Of: | |||||||||||
| : | 1647755 (view as bug list) | Environment: | |||||||||
| Last Closed: | 2011-07-21 10:37:19 UTC | Type: | --- | ||||||||
| Regression: | --- | Mount Type: | --- | ||||||||
| Documentation: | --- | CRM: | |||||||||
| Verified Versions: | Category: | --- | |||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||
| Embargoed: | |||||||||||
| Bug Depends On: | |||||||||||
| Bug Blocks: | 1647755 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Tomas Smetana
2009-06-02 09:54:28 UTC
Created attachment 346221 [details]
Shell script with NULL char at the place of a command
Created attachment 346222 [details]
Shell script with NULL char inside of a string
Created attachment 346223 [details]
Proposed patch
This is a bit hackish attempt to unify the behaviour -- the script is being checked in the source mode for a NULL character and if found, it's left out. Please consider this as a suggestion. It seemed to me as a simplest solution though.
Yep. Looks like simple, but I'm not sure, if it is good to left out any character. Better should be to count with length of string and not only with terminating \0. Let's see what upstream think about it. This request was evaluated by Red Hat Product Management for inclusion, but this component is not scheduled to be updated in the current Red Hat Enterprise Linux release. If you would like this request to be reviewed for the next minor release, ask your support representative to set the next rhel-x.y flag to "?". 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. Fixed in bash-3.2-27.el5 Bugfix was successfully verified on bash-3.2-29.el5 package no supported architectures. Sourcing and actual run of script gives same output now.
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:
When Bash ran a shell script with a null character embedded in it, bash's source builtin parsed the script incorrectly. This is now fixed and bash's source builtin is able to correctly parse null characters in a shell script.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Diffed Contents:
@@ -1 +1 @@
-When Bash ran a shell script with a null character embedded in it, bash's source builtin parsed the script incorrectly. This is now fixed and bash's source builtin is able to correctly parse null characters in a shell script.+When Bash ran a shell script with an embedded null character, bash's source builtin parsed the script incorrectly. This is now fixed and bash's source builtin is able to correctly parse null characters in a shell script.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
Diffed Contents:
@@ -1 +1 @@
-When Bash ran a shell script with an embedded null character, bash's source builtin parsed the script incorrectly. This is now fixed and bash's source builtin is able to correctly parse null characters in a shell script.+When Bash ran a shell script with an embedded null character, bash's source builtin parsed the script incorrectly. This is fixed and bash's source builtin correctly parses shell script null characters.
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/RHSA-2011-1073.html |