[augeas-devel] [PATCH] Add sudoers lens and associated test

David Lutterkort dlutter at redhat.com
Tue Aug 12 18:49:03 UTC 2008


On Tue, 2008-08-12 at 11:28 +0200, Raphael Pinson wrote: 
> # HG changeset patch
> # User Raphael Pinson <raphink at gmail.com>
> # Date 1218533244 -7200
> # Node ID fe8236ec9a82e500be65689abd79de394c253e8a
> # Parent  5697b74b2d7341f923ee889187a9d8d6276744ae
> Add sudoers lens and associated test

Very nice ... I had no idea Augeas could do all that ;) Having the
comments for the Sudo grammar in the file makes this very readable.

I have committed this after some reformatting - I really want to keep
lines to at most 80 characters (I usually stop at 78) I also put all the
'let's flush-left to get a few extra characters.

One question about this:

> +    (***********************************************************************************
> +    *  Parameter ::= Parameter '=' Value |
> +    *                Parameter '+=' Value |
> +    *                Parameter '-=' Value |
> +    *                '!'* Parameter
> +    ***********************************************************************************)
> +    let parameter        = [ label "parameter" . sto_to_com ]

What do you think about splitting the values from the parameter names in
the tree ?

Also, the above production is not what is actually processed there; it's
in the sudoers man page like that, but generates the empty language ;)

What they probably mean is 

Parameter ::= ParamName '=' Value |
              ParamName '+=' Value |
              ParamName '-=' Value |
              '!'* ParamName

though I don't really understand the manpage at that point.

David





More information about the augeas-devel mailing list