Bug 623

Summary: "Syntax error" when last comment has no empty line feed in /etc/sudoers file
Product: Sudo Reporter: Michael Galyuk <robux>
Component: SudoersAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.3   
Hardware: PC   
OS: Linux   
Attachments: Screenshot with the bug

Description Michael Galyuk 2013-11-12 03:54:14 MST
Created attachment 381 [details]
Screenshot with the bug

The bug appears when there is comment at the end of file /etc/sudoers, but there is no empty string (no line feed).

In this case if user try use sudo in terminal, he see the error message like this:

iron@moon:~$ sudo mc
sudo: >>> /etc/sudoers: syntax error near line 25 <<<
sudo: parse error in /etc/sudoers near line 25
sudo: no valid sudoers sources found, quitting
sudo: не удаётся инициализировать модуль политики
(on english: "cannot initialize politics module")

And "sudo" doesn't work!

Please, correct the bug.

Version of sudo is: i386, 1.8.3p1-1ubuntu3.4,
But the bug appears also in Ubuntu 13.10.
Comment 1 Todd C. Miller 2013-11-12 09:47:07 MST
It's worth noting that if you edit the sudoers file with visudo you wouldn't end up in this situation.  I've just committed a fix for this problem which will be in sudo 1.8.9.
Comment 2 Michael Galyuk 2013-11-13 01:37:35 MST
I use mcedit and never face up with this trouble.
My friend faced up with it and asked me a help through a chat.

We spent about 20 minutes to understand what's wrong.

So, thanks for the quick fix! Have a nice day ;)
Comment 3 Todd C. Miller 2014-01-08 14:31:52 MST
Sudo 1.8.9 is now out.