visudo doesn't check through files imported into the sudoers file.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Linux 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 20:45:39 UTC 2012 x86_64 GNU/Linux
Ubuntu Server 11.10
What Happened:
The file /etc/sudoers contains a line
"import /etc/sudoers.d/*" (or similar)
When invoking visudo to update the sudoers file, visudo only checks the sudoers file itself for errors, and none of the imported files.
So when I placed a file with a syntax error (and the correct permissions) in the sudoers.d folder and ran visudo, it completed with an error, but completed regardless. Every time sudo is issued afterwards it encounters the error and fails.
Thus leaving me unable to fix it without a rescue disk and a reboot, bit of a problem on the headless server it occurred on.
What I Expected to Happen:
The visudo command to parse and check each of the imported files for errors before continuing. If an error is found in an imported file to give a line where the error occurred in the specific file it occurred in, and give an option to cancel the update, edit the offending file and try again, or continue regardless.