[sudo-workers] visudo edit wrong file

Radovan Sroka rsroka at redhat.com
Tue Sep 15 09:08:08 MDT 2015


Hi,

I found something strange in visudo behavior. Problem appears in the last stable release of sudo (sudo 1.8.14p3). I also tried to reproduce problem on 1.8.9 and 1.8.12 version and there everything worked fine for me.

You can reproduce this problem if you will follow next steps:

# visudo
- make syntax error
- save(:wq for vi/vim)
- "what now" message appears
- type "e"

Expected result:
- editor opens sudoers file as before

Actual result:
- editor opens empty file called "+1" or with number of line where was the error inserted

Visudo actually opens two files and sudoers file is the second.
I think that visudo executes editor with params but in wrong order because "--" is placed as first every time and it's followed by "+1" what was supposed to be not file but number of error line as metadata for editor and editor after "--" parameter expects only files.


Could You look at this?

Radovan Sroka
Security Technologies | Redhat, Inc


More information about the sudo-workers mailing list