Bug 1033795
| Summary: | Augeas lens bug: shellvars and multivariable export lines | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Andrew Sanders <asanders> | ||||
| Component: | augeas | Assignee: | Dominic Cleal <dcleal> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 6.5 | CC: | huzhan, leiwang, lkong, wshi, yuliu | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | augeas-1.0.0-6.el6 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1043815 (view as bug list) | Environment: | |||||
| Last Closed: | 2014-10-14 07:15:21 UTC | Type: | Bug | ||||
| 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: | 1043815, 1056252 | ||||||
| Attachments: |
|
||||||
|
Description
Andrew Sanders
2013-11-22 23:17:47 UTC
Created attachment 828034 [details]
Diff of changes to shellvars.aug
Diff of changes to shellvars.aug to handle multiple variables on the same export line. However, this may break backwards compatibility because it needs to handle the structure differently.
We can include multiple exports within a single node to avoid breaking compatibility in 1.0.0, e.g. /files/u/test/test_single_export.shellvars/@export = "TestVar1 TestVar2" Retargeting to 6.6.0 as this is a 6.5 package. Can reproduce with augeas-1.0.0-5.el6, the same steps and results with 'Description' Steps to reproduce: 1. Create a script with multiple variables on a single export line: [host]#cat test.sh #!/bin/sh TestVar1="test1" TestVar2="test2" export TestVar1 TestVar2 2. Run "augtool --noautoload", load the file, and print the variables: [host]#augtool --noautoload augtool> set /augeas/load/test/lens "Shellvars.lns" augtool> set /augeas/load/test/incl /root/test.sh augtool> load augtool> print /files/root/test.sh augtool> Additional info: Exporting the variables on their own separate "export" line works: [host]#cat test.sh #!/bin/sh TestVar1="test1" TestVar2="test2" #export TestVar1 TestVar2 export TestVar1 export TestVar1 Run "augtool --noautoload", load the file, and print the variables: [host]#augtool --noautoload augtool> set /augeas/load/test/lens "Shellvars.lns" augtool> set /augeas/load/test/incl /root/test.sh augtool> load augtool> print /files/root/test.sh /files/root/test.sh /files/root/test.sh/#comment[1] = "!/bin/sh" /files/root/test.sh/TestVar1 = "\"test1\"" /files/root/test.sh/TestVar2 = "\"test2\"" /files/root/test.sh/#comment[2] = "export TestVar1 TestVar2" /files/root/test.sh/@export[1] = "TestVar1" /files/root/test.sh/@export[2] = "TestVar1" augtool> Verified with augeas-1.0.0-6.el6 Steps to verify: 1. Create a script with multiple variables on a single export line: #cat test.sh #!/bin/sh TestVar1="test1" TestVar2="test2" export TestVar1 TestVar2 2. Run "augtool --noautoload", load the file, and print the variables: #augtool --noautoload augtool> set /augeas/load/test/lens "Shellvars.lns" augtool> set /augeas/load/test/incl /root/test.sh augtool> load augtool> print /files/root/test.sh /files/root/test.sh /files/root/test.sh/#comment = "!/bin/sh" /files/root/test.sh/TestVar1 = "\"test1\"" /files/root/test.sh/TestVar2 = "\"test2\"" /files/root/test.sh/@export = "TestVar1 TestVar2" ------------------------------------------------- Exporting the variables on their own separate "export" line works: #cat test.sh #!/bin/sh TestVar1="test1" TestVar2="test2" #export TestVar1 TestVar2 export TestVar1 export TestVar1 Run "augtool --noautoload", load the file, and print the variables: #augtool --noautoload augtool> set /augeas/load/test/lens "Shellvars.lns" augtool> set /augeas/load/test/incl /root/test.sh augtool> load augtool> print /files/root/test.sh /files/root/test.sh /files/root/test.sh/#comment[1] = "!/bin/sh" /files/root/test.sh/TestVar1 = "\"test1\"" /files/root/test.sh/TestVar2 = "\"test2\"" /files/root/test.sh/#comment[2] = "export TestVar1 TestVar2" /files/root/test.sh/@export[1] = "TestVar1" /files/root/test.sh/@export[2] = "TestVar1" Augeas works well with the above two method, so this bug is fixed 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-2014-1517.html |