<br><br><div class="gmail_quote">On Fri, Mar 20, 2009 at 2:26 PM, Frank Sweetser <span dir="ltr"><<a href="mailto:fs@wpi.edu">fs@wpi.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Robin Lee Powell wrote:<br>
<br>
> That means that augeas can't parse it.  Look under<br>
> "/augeas/files/etc/sudoers/" to see why, although I've gotta say<br>
> that Augeas' parse errors are generally entirely unhelpful:<br>
><br>
> augtool> ls /augeas/files/etc/sudoers/error/<br>
> pos = 2587<br>
> message = Short iteration<br>
<br>
</div>Okay, now we're getting somewhere!  I get a similar message with a different<br>
offset:<br>
<div class="im"><br>
augtool> ls /augeas/files/etc/sudoers/error/<br>
</div>pos = 1848<br>
<div class="im">message = Short iteration<br>
<br>
> It's the one thing I don't like about it.  At least give me a line<br>
> number.  :(<br>
<br>
</div>Sometimes the old tools are still the best ones =)<br>
<br>
[root@trapeze etc]# dd if=/etc/sudoers bs=1 skip=1848 | head -10<br>
Defaults    env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR \<br>
                   LS_COLORS MAIL PS1 PS2 QTDIR USERNAME \<br>
                   LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \<br>
                   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC \<br>
                   LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \<br>
                   _XKB_CHARSET XAUTHORITY"<br>
<br>
## Next comes the main part: which users can run what software on<br>
## which machines (the sudoers file can be shared between multiple<br>
## systems).<br>
<br>
If I remove the escapes and put it all on one line, everything works<br>
perfectly, so I guess that the lens can't handle the multiline string.<br>
</blockquote><div><br><br>That's right. I manage to get the lens to understand multiline configuration, but not multiline strings. The problem (from my understanding) lies in the fact that Augeas is not an imperative parser. Let me explain.<br>
<br>The official sudoers parser is imperative and removes "\\\n" before even trying to parse the file, so it doesn't even have to understand it. <br>The Augeas lens can't work this way, because it tries to parse the whole file as a big string and match it against a huge regexp which describes the sudoers format. The lens understands that "\\\n" can be used as a separator between fields, but it has no idea what to do with it inside fields. <br>
<br>I'm actually guessing that even something like<br><br>Def\<br>aults  env_k\<br>eep = "COLORS DISPLAY HOSTNAME"<br><br>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.<br>
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is this expected behaviour, or should I file a bug report?</blockquote><div><br>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.<br>
<br><br><br>Raphaël<br><br><br><br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<div class="im"><br>
--<br>
Frank Sweetser fs at <a href="http://wpi.edu" target="_blank">wpi.edu</a>  |  For every problem, there is a solution that<br>
WPI Senior Network Engineer   |  is simple, elegant, and wrong. - HL Mencken<br>
    GPG fingerprint = 6174 1257 129E 0D21 D8D4  E8A3 8E39 29E3 E2E8 8CEC<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">augeas-devel mailing list<br>
<a href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/augeas-devel" target="_blank">https://www.redhat.com/mailman/listinfo/augeas-devel</a><br>
</div></div></blockquote></div><br>