When I edit /etc/sudoers using visudo, I think it saves to sudoers.tmp, checks it for errors, then copies it to the real /etc/sudoers.
However, I can't confirm my theory (how the lock file is used) in the man pages: http://manpages.ubuntu.com/manpages/dapper/man8/visudo.8.html - it's not described there.
Does anyone know if this behavior is described anywhere? Or is this because lock files are so common it's not described in visudo?
sudo visudolook at the top line; it sais you are editing/etc/sudoers.tmp. – Jacob Vlijm May 19 '15 at 20:58