Bug 834

Summary: EBNF on sudoers(5) man page wrong
Product: Sudo Reporter: Phil Dumont <phil>
Component: DocumentationAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.6   
Hardware: All   
OS: All   

Description Phil Dumont 2018-05-11 09:48:27 MDT
There are problems with the EBNF on the sudoers man page.

Without loss of generality, I'll describe the problem with the User_Alias symbol, but analogous problems exist for all aliases.

The production for the User_Alias symbol makes it clear that the symbol represents the *definition* of a user alias, not the *name* for a user alias...

    User_Alias ::= NAME ’=’ User_List

But then the symbol "User_Alias" is used in several contexts where it is clear that what is intended is the *name* for the user alias, not the *definition* of the user alias, e.g. ...

    User ::= ’!’* user name |
             ’!’* #uid |
             ’!’* %group |
             ’!’* %#gid |
             ’!’* +netgroup |
             ’!’* %:nonunix_group |
             ’!’* %:#nonunix_gid |
             ’!’* User_Alias

It would appear that another production is needed, perhaps something like...

    User_Alias_Name ::= NAME

And the new symbol "User_Alias_Name" could be used the fix the problem.  The production for User_Alias would become...

    User_Alias ::= User_Alias_Name '=' User_List

And then every reference to the "User_Alias" symbol -- except for the one use in the production for the "Alias" symbol -- would be changed to "User_Alias_Name".

Or, if you prefer, you could continue using the symbol "User_Alias" to represent the name, but change the symbol used for the alias definition...

    User_Alias ::= NAME
    User_Alias_Definition ::= NAME ’=’ User_List

    <Then change the "Alias" production to use "User_Alias_Definition">

I think I might like this alternative best.  But you decide.
Comment 1 Phil Dumont 2018-05-11 09:57:17 MDT
Oops.  In my description, that last production:

    User_Alias_Definition ::= NAME ’=’ User_List

...should be...

    User_Alias_Definition ::= User_Alias ’=’ User_List
Comment 2 Todd C. Miller 2018-08-07 10:03:50 MDT
Fixed by https://www.sudo.ws/repos/sudo/rev/06678d12306f
Comment 3 Todd C. Miller 2018-08-18 13:26:30 MDT
Fixed in sudo 1.8.24, available now.