visudo edit wrong file

Radovan Sroka <[email protected]>
Newsgroups gmane.comp.tools.sudo.devel
Message-ID <[email protected]>
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
____________________________________________________________
sudo-workers mailing list <[email protected]>
For list information, options, or to unsubscribe, visit:
http://www.sudo.ws/mailman/listinfo/sudo-workers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.