Bug 1660884

Summary: augeas lens fails to parse rsyslog.conf when using ampersand selector
Product: Red Hat Enterprise Linux 8 Reporter: Pino Toscano <ptoscano>
Component: augeasAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: YongkuiGuo <yoguo>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: knoel, ptoscano, rjones, virt-bugs, xchen, yoguo
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: augeas-1.12.0-4.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1350218 Environment:
Last Closed: 2020-04-28 16:49:27 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:
Attachments:
Description Flags
rsyslog file none

Description Pino Toscano 2018-12-19 14:06:00 UTC
+++ This bug was initially created as a clone of Bug #1350218 +++

+++ This bug was initially created as a clone of Bug #1350217 +++

Cloning this bug for RHEL 8 (augeas-libs-1.10.1-8.el8)

Description of problem:
augeas lens fails to parse rsyslog.conf when using ampersand selector

Version-Release number of selected component (if applicable):
augeas-libs-1.0.0-10.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1] rsyslog.conf file with ampersand selector

$ vi /etc/rsyslog.conf(attached example file)
[...]
# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log
local3.err                                              /var/log/nfsen/nfsenlog
& /var/log/also.log


Actual results:
augeas lens fails to parse rsyslog.conf

Expected results:
augeas lens should parse rsyslog.conf

Additional info:
[root@localhost ~]# augtool 
augtool> ls /files/etc/rsyslog.conf
augtool> print /augeas//error
[..]
/augeas/files/etc/rsyslog.conf/error = "parse_failed"
/augeas/files/etc/rsyslog.conf/error/pos = "25"
/augeas/files/etc/rsyslog.conf/error/line = "2"
/augeas/files/etc/rsyslog.conf/error/char = "0"
/augeas/files/etc/rsyslog.conf/error/lens = "/usr/share/augeas/lenses/dist/rsyslog.aug:54.10-.57:"
/augeas/files/etc/rsyslog.conf/error/message = "Get did not match entire input"
augtool>

--- Additional comment from Xianghua Chen on 2016-10-28 10:05:43 CEST ---

Can reproduce it with :
augeas-libs-1.4.0-2.el7.x86_64

Steps:
1. rsyslog.conf file with ampersand selector
# vi /etc/rsyslog.conf
... ...
# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log
local3.err                                              /var/log/nfsen/nfsenlog
& /var/log/also.log

2. 
# augtool print /augeas/files/etc/rsyslog.conf
/augeas/files/etc/rsyslog.conf
/augeas/files/etc/rsyslog.conf/path = "/files/etc/rsyslog.conf"
/augeas/files/etc/rsyslog.conf/mtime = "1477639931"
/augeas/files/etc/rsyslog.conf/lens = "@Rsyslog"
/augeas/files/etc/rsyslog.conf/lens/info = "/usr/share/augeas/lenses/dist/rsyslog.aug:61.10-.57:"
/augeas/files/etc/rsyslog.conf/error = "parse_failed"
/augeas/files/etc/rsyslog.conf/error/pos = "3425"
/augeas/files/etc/rsyslog.conf/error/line = "96"
/augeas/files/etc/rsyslog.conf/error/char = "0"
/augeas/files/etc/rsyslog.conf/error/lens = "/usr/share/augeas/lenses/dist/rsyslog.aug:61.10-.57:"
/augeas/files/etc/rsyslog.conf/error/message = "Get did not match entire input"

Comment 1 Pino Toscano 2019-11-08 13:09:57 UTC
Created attachment 1634002 [details]
rsyslog file

Comment 2 Pino Toscano 2019-11-12 12:55:38 UTC
Fixed upstream with commit 5181105bae84dc7819a00886f068ad0bb4e6d05a.

Comment 4 YongkuiGuo 2019-11-15 09:53:08 UTC
Verified with package:
augeas-1.12.0-4.el8.x86_64

Steps:

1. /etc/rsyslog.conf file with ampersand selector
# vi /etc/rsyslog.conf
... 
# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log
local3.err                                              /var/log/nfsen/nfsenlog
& /var/log/also.log

2.
# augtool print /files/etc/rsyslog.conf
...
/files/etc/rsyslog.conf/entry[8]
/files/etc/rsyslog.conf/entry[8]/selector
/files/etc/rsyslog.conf/entry[8]/selector/facility = "local3"
/files/etc/rsyslog.conf/entry[8]/selector/level = "err"
/files/etc/rsyslog.conf/entry[8]/action[1]
/files/etc/rsyslog.conf/entry[8]/action[1]/file = "/var/log/nfsen/nfsenlog"
/files/etc/rsyslog.conf/entry[8]/action[2]
/files/etc/rsyslog.conf/entry[8]/action[2]/file = "/var/log/also.log"
...


The ampersand selector can be parsed in /etc/rsyslog.conf file. Verified it.

Comment 6 errata-xmlrpc 2020-04-28 16:49:27 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.

https://access.redhat.com/errata/RHBA-2020:1824