[augeas-devel] Modifying a comma separated list in the postfix main.cf file - possible?

Graham Leggett minfrin at sharp.fm
Mon Nov 26 12:09:30 UTC 2012


On 26 Nov 2012, at 11:37 AM, Dominic Cleal <dcleal at redhat.com> wrote:

> It's a problem with the lens - it's too simplistic.  There's another
> report of it here:
> https://fedorahosted.org/augeas/ticket/265
> 
> The only way to get round it is to take the value of the node from the
> Augeas API, parse it yourself and set the value you want.  Unless the
> lens breaks apart a string into nodes, that's all you can do.  There are
> no helpers in the Augeas API for this, since it should be done in the lens.
> 
> As per the bug, there's a good argument for splitting lists up in the
> lens, despite it being a backwards-incompatible change.  I expect we'd
> welcome a patch to the lens to fix this.

I tried to come up with a patch but couldn't get the regexes right, what I was trying to do was detect a key value pair as an "entry", and a key with a value containing a comma as an array, but I had no luck with finding a non ambiguous regex.

What I did find was some convenience modules at http://augeas.net/docs/references/lenses/files/build-aug.html that allowed you to match key value pairs of various forms, but it stopped short of offering a key-value-array form that could be split over multiple lines. If we had that, we could crack the postfix config file.

Regards,
Graham
--

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4365 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20121126/e6e8d695/attachment.p7s>


More information about the augeas-devel mailing list