Bug 623 - "Syntax error" when last comment has no empty line feed in /etc/sudoers file
"Syntax error" when last comment has no empty line feed in /etc/sudoers file
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudoers
1.8.3
PC Linux
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-12 03:54 MST by Michael Galyuk
Modified: 2014-01-08 14:31 MST (History)
0 users

See Also:


Attachments
Screenshot with the bug (73.20 KB, image/jpeg)
2013-11-12 03:54 MST, Michael Galyuk
Details

Note You need to log in before you can comment on or make changes to this 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.