Bug 1144652 - Using the wrong lens to parse /etc/sysconfig/iptables.save
Summary: Using the wrong lens to parse /etc/sysconfig/iptables.save
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: augeas
Version: 6.6
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Dominic Cleal
QA Contact: Virtualization Bugs
Depends On: 1144651
TreeView+ depends on / blocked
Reported: 2014-09-20 05:42 UTC by Lingfei Kong
Modified: 2015-07-22 05:40 UTC (History)
5 users (show)

Fixed In Version: augeas-1.0.0-8.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 1144651
Last Closed: 2015-07-22 05:40:57 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1256 0 normal SHIPPED_LIVE augeas bug fix and enhancement update 2015-07-20 17:50:00 UTC

Description Lingfei Kong 2014-09-20 05:42:17 UTC
+++ This bug was initially created as a clone of Bug #1144651 +++

Description of problem:
/etc/sysconfig/iptables.save should be parsed by /usr/share/augeas/lenses/dist/iptables.aug, but in augeas-1.1.0-13.el7 it parsed by /usr/share/augeas/lenses/dist/shellvars.aug. /etc/sysconfig/iptables.save should be excl from shellvars.aug and incl in iptables.aug.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. # service iptables save
# service iptables save
2. #augtool print /augeas/files/etc/sysconfig/iptables.save
/augeas/files/etc/sysconfig/iptables.save/path = "/files/etc/sysconfig/iptables.save"
/augeas/files/etc/sysconfig/iptables.save/mtime = "1411189178"
/augeas/files/etc/sysconfig/iptables.save/lens = "@Shellvars"
/augeas/files/etc/sysconfig/iptables.save/lens/info = "/usr/share/augeas/lenses/dist/shellvars.aug:181.12-.56:"
/augeas/files/etc/sysconfig/iptables.save/error = "parse_failed"
/augeas/files/etc/sysconfig/iptables.save/error/pos = "65"
/augeas/files/etc/sysconfig/iptables.save/error/line = "2"
/augeas/files/etc/sysconfig/iptables.save/error/char = "0"
/augeas/files/etc/sysconfig/iptables.save/error/lens = "/usr/share/augeas/lenses/dist/shellvars.aug:181.12-.56:

Actual results:
At step 2, can find line /augeas/files/etc/sysconfig/iptables.save/error = "parse_failed"

Expected results:
#augtool print /augeas/files/etc/sysconfig/iptables.save
/augeas/files/etc/sysconfig/iptables.save/path = "/files/etc/sysconfig/iptables.save"
/augeas/files/etc/sysconfig/iptables.save/mtime = "1411189178"
/augeas/files/etc/sysconfig/iptables.save/lens = "@Iptables"
/augeas/files/etc/sysconfig/iptables.save/lens/info = "/usr/share/augeas/lenses/dist/iptables.aug:84.10-.32:"

Additional info:

Comment 2 Dominic Cleal 2014-11-26 08:51:51 UTC
Fixed in 7830adc, 69eb611, 85904f7.  (Or d9ad720 is the el7 backport.)

Comment 4 Hu Zhang 2015-03-04 01:59:31 UTC
Reproduced with augeas-1.0.0-7.el6.x86_64.

Verified with the package:

Steps to verify:
1. # service iptables save

2. # augtool print /augeas/files/etc/sysconfig/iptables.save
/augeas/files/etc/sysconfig/iptables.save/path = "/files/etc/sysconfig/iptables.save"
/augeas/files/etc/sysconfig/iptables.save/mtime = "1425434080"
/augeas/files/etc/sysconfig/iptables.save/lens = "@Iptables"
/augeas/files/etc/sysconfig/iptables.save/lens/info = "/usr/share/augeas/lenses/dist/iptables.aug:84.10-.32:"

2. # augtool print /files/etc/sysconfig/iptables.save
/files/etc/sysconfig/iptables.save/#comment[1] = "Generated by iptables-save v1.4.7 on Tue Mar  3 18:56:24 2015"
/files/etc/sysconfig/iptables.save/table = "filter"
/files/etc/sysconfig/iptables.save/table/chain[1] = "INPUT"
/files/etc/sysconfig/iptables.save/table/chain[1]/policy = "ACCEPT"
/files/etc/sysconfig/iptables.save/table/chain[2] = "FORWARD"
/files/etc/sysconfig/iptables.save/table/chain[2]/policy = "ACCEPT"
/files/etc/sysconfig/iptables.save/table/chain[3] = "OUTPUT"
/files/etc/sysconfig/iptables.save/table/chain[3]/policy = "ACCEPT"
/files/etc/sysconfig/iptables.save/table/append = "INPUT"
/files/etc/sysconfig/iptables.save/table/append/protocol = "tcp"
/files/etc/sysconfig/iptables.save/table/append/match = "tcp"
/files/etc/sysconfig/iptables.save/table/append/dport = "22"
/files/etc/sysconfig/iptables.save/table/append/jump = "ACCEPT"

No parse error returned.
So verified.

Comment 7 errata-xmlrpc 2015-07-22 05:40:57 UTC
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.


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