[augeas-devel] Help regarding union.put overlap with INI-like format

Mol, Xavier (SCC) xavier.mol at kit.edu
Tue Nov 27 13:25:24 UTC 2018


Hi Pino.

> The lens (attached) seems to work fine, [...]
I don't think you attached the right file. Simplevars.aug is shipped with Augeas and your attachment looks identical to that. 
Semanage.aug, which caused the compilation error, is not attached, right?

Ciao,
Xavier.

-----Original Message-----
From: augeas-devel-bounces at redhat.com <augeas-devel-bounces at redhat.com> On Behalf Of Pino Toscano
Sent: Tuesday, November 27, 2018 1:49 PM
To: augeas-devel at redhat.com
Subject: [augeas-devel] Help regarding union.put overlap with INI-like format

Hi,

I'm writing a new lens to parse the configuration file /etc/selinux/semanage.conf, currently handled by the Simplevars lens.
The problem is that this file does not have anymore a simple foo=var syntax, and grew INI-like "groups" which Simplevars does not 
handle.

The syntax is like (attached there is the default file in Fedora):

foo=var
# comment
[name of group]
var = value
[end]  # yes, a group is ended like this

I tried to model a new lens that would return the very same structure that Simplevars exposed, just with the additional subtrees for 
the groups, to not break existing users.  The lens (attached) seems to work fine, although the typechecking with augparse shows 
union.put overlapping issues:

$ augparse --nostdinc -I lenses/ lenses/tests/test_semanage.aug Syntax error in lens definition lenses/semanage.aug:36.0-.27:Failed to 
compile lns
lenses/semanage.aug:36.10-.25:exception: overlapping lenses in tree union.put
    Example matched by both:  { "AA" }
    First lens: lenses/semanage.aug:30.12-31.17:
    Second lens: lenses/semanage.aug:34.13-.60:

lenses/tests/test_semanage.aug:16.5-.17:Could not load module Semanage for Semanage.lns 
lenses/tests/test_semanage.aug:16.5-.17:Undefined variable Semanage.lns lenses/tests/test_semanage.aug:25.5-.17:Undefined variable 
Semanage.lns lenses/tests/test_semanage.aug:30.5-.17:Undefined variable Semanage.lns lenses/tests/test_semanage.aug:56.5-.17:Undefined 
variable Semanage.lns

I tried to debug this a bit, and I understand (thanks to the
documentation!) what is the issue reported... although I do not get why actually augeas finds an overlap here. Any hints?

Thanks,
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 7544 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20181127/ad6af178/attachment.p7s>


More information about the augeas-devel mailing list