<div dir="ltr"><br><br><div class="gmail_quote">On Tue, Aug 12, 2008 at 8:49 PM, David Lutterkort <span dir="ltr"><<a href="mailto:dlutter@redhat.com">dlutter@redhat.com</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="Ih2E3d">On Tue, 2008-08-12 at 11:28 +0200, Raphael Pinson wrote:<br>
> # HG changeset patch<br>
> # User Raphael Pinson <<a href="mailto:raphink@gmail.com">raphink@gmail.com</a>><br>
> # Date 1218533244 -7200<br>
> # Node ID fe8236ec9a82e500be65689abd79de394c253e8a<br>
> # Parent  5697b74b2d7341f923ee889187a9d8d6276744ae<br>
> Add sudoers lens and associated test<br>
<br>
</div>Very nice ... I had no idea Augeas could do all that ;) Having the<br>
comments for the Sudo grammar in the file makes this very readable.<br>
</blockquote><div><br>Yes. I'm not used to using boxes in comments really, but in this case it makes things clearer since there's so many comments. I think putting the specs from manpages helps understanding the code in the lens.<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;">I have committed this after some reformatting - I really want to keep<br>
lines to at most 80 characters (I usually stop at 78) I also put all the<br>
'let's flush-left to get a few extra characters.<br>
</blockquote><div><br>I agree with the 80 characters. It is a policy in Debian to cut all lines at 80 characters when packaging and I usually try to do it. I just didn't have the time to go through it today for this lens, so thanks for doing it. I think it could be part of the style guidelines we mentioned today.<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;">One question about this:<br>
<div class="Ih2E3d"><br>
> +    (***********************************************************************************<br>
> +    *  Parameter ::= Parameter '=' Value |<br>
> +    *                Parameter '+=' Value |<br>
> +    *                Parameter '-=' Value |<br>
> +    *                '!'* Parameter<br>
> +    ***********************************************************************************)<br>
> +    let parameter        = [ label "parameter" . sto_to_com ]<br>
<br>
</div>What do you think about splitting the values from the parameter names in<br>
the tree ?<br>
</blockquote><div><br>I thought about that, too. I stayed with a very simple description of it so far, because I'm not sure how to represent the different attributions. Something like:<br><br>Defaults param1="value1", param2+="value2", param3-="value3", !param4<br>
<br>could become<br><br>{ "Defaults"<br>    { "parameter"<br>        { "name" = "param1" }<br>        { "type"   = "=" }<br>        { "value"  = "value1" } }<br>
    { "parameter"<br>        { "name" = "param2" }<br>        { "type"   = "+=" }<br>        { "value"  = "value2" } }<br>    { "parameter"<br>
        { "name" = "param3" }<br>        { "type"   = "-=" }<br>        { "value"  = "value3" } }<br>    { "parameter"<br>        { "name" = "param4" }<br>
        { "negate" = "!" } } }<br><br><br>Somehow I'm not sure it's any easier to use than the way it currently is. It might even be confusing because there's different fields for key/value pairs and for flags. Not sure, really...<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;">Also, the above production is not what is actually processed there; it's<br>

in the sudoers man page like that, but generates the empty language ;)<br>
<br>
What they probably mean is<br>
<br>
Parameter ::= ParamName '=' Value |<br>
              ParamName '+=' Value |<br>
              ParamName '-=' Value |<br>
              '!'* ParamName<br>
</blockquote><div><br><br>Yes, there might be a few issues in the manpages (although they're still one of the best manpages I've ever used). I've mentionned the lack of spec on Defaults!Cmnd_List in the lens as well.<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;">
though I don't really understand the manpage at that point.<font color="#888888"><br>
</font></blockquote></div><br><br>Maybe you're talking about the '!'* part here. This is another thing that would be quite hard for us to parse, if even possible. The parameter can be preceded by any amount of '!', each overriding the other. an even amount of them will cancel the effect of it. It's really this kind of syntax that made me choose to stay away from analyzing what takes place inside the Parameter fields.<br>
<br><br>Raphael</div>