[augeas-devel] sudoers lens not working

David Lutterkort lutter at redhat.com
Fri Mar 20 18:07:12 UTC 2009


On Fri, 2009-03-20 at 17:29 +0100, Raphaël Pinson wrote:
> I'm actually guessing that even something like
> 
> Def\
> aults  env_k\
> eep = "COLORS DISPLAY HOSTNAME"
> 
> might work with the official parser, while Augeas has absolutely no
> way (at least as it is today) to understand that "Def\\\naults"
> actually stands for a multiline "Defaults" entry.

The problem with processing this is that we also have to be able to
write the file out exactly the way it was when we read it.

So if we allowed both 'Defaults' and 'Def\\\naults' to result in a tree
node with label 'Defaults' we'd have no way to know which of those
possibilities to write out.

>         Is this expected behaviour, or should I file a bug report?

Definitely file a bug for this.

> As it is, it is the expected behaviour of the lens because I found no
> workaround for this. You could file a bug, although there is
> absolutely no garantee that I can fix this. In the best situation I
> can think of, I could add "\" and "\n" as authorized characters within
> value fields, so they would appear as such in the value.

Another option would be to store such multiline strings as one line per
node, i.e. we can either do something like

        { "Defaults"
           { "env_keep" = "line1\\\nline2\\\n" } }
        
or

    { "Defaults"
       { "env_keep"
         { "line" = "line1" }
         { "line" = "line2" } } }

Any preferences for one or the other ? We could also special case
env_keep and parse it into something like this (completely obscuring
continuation lines):

   { "Defaults"
     { "env_keep"
       { "var" = "COLORS" }
       { "var" = "DISPLAY" }
       { "var" = "HOSTNAME" }
       ... } }

David






More information about the augeas-devel mailing list