Bug 269

Summary: sudoers should point out why using visudo is a good idea
Product: Sudo Reporter: Martin Pitt <martin.pitt>
Component: DocumentationAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: low    
Version: 1.6.9   
Hardware: PC   
OS: Linux   
URL: https://launchpad.net/bugs/11620
Attachments: improve comment about visudo in sudoers

Description Martin Pitt 2007-11-14 07:23:47 MST
Created attachment 216 [details]
improve comment about visudo in sudoers

From the original Ubuntu bug:

  "There is a comment in the /etc/sudoers file that says that it MUST be edited with 'visudo'. It does not say WHY, and really should. I discovered the hard way that the reason is that 'visudo' performs sanity and syntax checks, preventing you from locking yourself out!

I think that the comments at the top of /etc/sudoers should make that clearer, so that foolish people like me don't lock themself out."

Admittedly he had that coming, but I think that a clearer comment cannot hurt. What do you think about attached patch?

Thanks,

Martin
Comment 1 Todd C. Miller 2007-11-14 15:18:31 MST
That seems a bit wordy, how about the following?

# This file MUST be edited with the 'visudo' command as root.
# Failure to use 'visudo' may result in syntax or file permission errors        
# that prevent sudo from running.
Comment 2 Martin Pitt 2007-11-14 17:45:11 MST
Works for me. Thank you!
Comment 3 Todd C. Miller 2007-11-15 11:18:24 MST
I updated sudoers in cvs. The next release of sudo will include this wording.