Bug 734 - visudo locks user out on second attempt
visudo locks user out on second attempt
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Visudo
1.8.6
PC Linux
: low high
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-12 05:47 MST by RevRagnarok
Modified: 2016-02-12 12:09 MST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RevRagnarok 2016-02-12 05:47:51 MST
I made a mistake in visudo, so it asked me what to do. I chose "e" and then MADE NO CHANGES. Upon exiting the editor, it went back to the shell, effectively locking me out, instead of telling me it was still borken:

[revragnarok@machine jenkins]$ sudo visudo 
[sudo] password for revragnarok: 
Your password will expire in 3 day(s).
visudo: >>> /etc/sudoers: syntax error near line 113 <<<
What now? ?
Options are:
  (e)dit sudoers file again
  e(x)it without saving changes to sudoers file
  (Q)uit and save changes to sudoers file (DANGER!)

What now? e
[revragnarok@machine jenkins]$ sudo visudo 
sudo: >>> /etc/sudoers: syntax error near line 113 <<<
sudo: parse error in /etc/sudoers near line 113
revragnarok is not allowed to run sudo on machine.  This incident will be reported.

== Version info ==
[revragnarok@machine jenkins]$ rpm -q --whatprovides $(which visudo)
sudo-1.8.6p7-13.el7.x86_64
[revragnarok@machine jenkins]$ cat /etc/redhat-release 
CentOS Linux release 7.1.1503 (Core)
Comment 1 Todd C. Miller 2016-02-12 10:16:03 MST
I can only reproduce this bug with RedHat/Centos sudo package.  The bug is not present when I build from source or use the package from www.sudo.ws.

It is likely that this bug was introduced by one of the RedHat patches to sudo.  You may wish to open a bug report with RedHat instead.
Comment 2 RevRagnarok 2016-02-12 12:09:02 MST
Filed: https://bugs.centos.org/view.php?id=10361

Thanks for the quick feedback!