[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [augeas-devel] sudoers lens not working

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\
> 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" } }

    { "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" }
       ... } }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]