[Melbourne-pm] Parsing Sudoers Grammar

Daniel Pittman daniel at rimspace.net
Thu Apr 30 05:33:42 PDT 2009


Gerd Berner <gberner at intraspect.com.au> writes:

> I have been looking at a grammar parsing problem for a while now and I
> am interested to get some feedback on the direction that I am heading.
>
> I need to be able to parse a Unix Sudoers file.

Are you sure that augeus isn't a better tool for what you want to do,
since it already supports parsing and modification to the sudoers file?

> I have found a number of scripts on the web that do part of the job,
> but nothing that does the full grammar. The Sudoers grammar is
> specified in EBNF form in the manual

[...]

> Any advice or pointers to an existing work done in this area would be
> much appreciated.

I have generally found that Damien's Parse::RecDescent is a good general
purpose tool for the job; while it isn't EBNF the conversion is usually
simple enough that you could do the job fairly quickly.

Regards,
        Daniel


More information about the Melbourne-pm mailing list