Bug 432

Summary: sudoers does not like comments like "#2" (or any other digit)
Product: Sudo Reporter: Andreas Koppenhoefer <andreas.koppenhoefer>
Component: VisudoAssignee: Todd C. Miller <Todd.Miller>
Status: ASSIGNED ---    
Severity: high CC: andreas.koppenhoefer
Priority: normal    
Version: 1.7.4   
Hardware: All   
OS: Solaris 2.x   

Description Andreas Koppenhoefer 2010-08-30 06:48:26 MDT
Comments in /etc/sudoers of the form
  "#" <digit> <any_char>*
result in a syntax error.
Example:
$ echo "#2" >/tmp/sudoers
$ visudo -c -f /tmp/sudoers
>>> /tmp/sudoers: syntax error near line 1 <<<
parse error in /tmp/sudoers near line 1

This bug is at least contained in versions 1.7.3 .. 1.7.4p3.
I assume this bug is vital on all platforms since we found it on HP-UX and Solaris.
Comment 1 Todd C. Miller 2010-08-30 11:12:18 MDT
The problem is that a line starting with #[0-9] could either be a user specification beginning with a uid or a comment.  There is not a good way for sudo to tell which it is.