Bug 692

Summary: Manpage: Document more verbosely that wildcards are not regexes
Product: Sudo Reporter: Mateusz Jończyk <mat.jonczyk>
Component: DocumentationAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.13   
Hardware: All   
OS: All   

Description Mateusz Jończyk 2015-03-23 03:42:55 MDT
Hello,
Many people tend to think in terms of regexes, not in terms of wildcards. In man sudoers in section "Wildcards" it is written:
    "Note that these are not regular expressions." 
but this is not enough to shift some people's thinking.

Yesterday I decided to add a new stanza to my sudoers file and use regexes in it. I have read in the manual:
    "Note that these are not regular expressions." 
and understood that sentence but nevertheless I intuitively used regexes instead of wildcards in that stanza.

Therefore, the man page should pronounce more clearly that wildcards do not work as regexes. For example it could read:

"Note that wildcards in sudoers do not work like regexes. For example:
     [a-zA-Z]*
matches any string that begins with a letter, even if it contains spaces, tabs or other weird characters.
Furthermore, the following command specification
     /usr/bin/passwd [a-z]*
would match
     /usr/bin/passwd user1 -a -s root
so please be careful"
Comment 1 Todd C. Miller 2015-08-07 12:38:01 MDT
Added emphasis in http://www.sudo.ws/repos/sudo/rev/1e071810c4cb
Comment 2 Todd C. Miller 2015-11-01 15:29:44 MST
Fixed in sudo 1.8.15