[Melbourne-pm] Parsing Sudoers Grammar

Gerd Berner gberner at intraspect.com.au
Thu Apr 30 04:25:15 PDT 2009

Hello All

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.  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 http://www.sudo.ws/sudo/man/sudoers.html.  I consulted CPAN and  
have been playing with a number of modules:

My first tinkering was with Parse::EBNF  which I used that to  
successfully parse the grammar, before realising there are no methods  
in the module to parse my rules.

I moved on to Parse::Stallion::EBNF appears to have all the required  
methods and I am currently trying to get my head around converting the  
Sudoers grammar into the rule format for Stallion.

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

Kind Regards


More information about the Melbourne-pm mailing list