FS#8602 - changing an editor for visudo

Attached to Project: Arch Linux
Opened by Leon Vayman (vleon) - Saturday, 10 November 2007, 21:19 GMT
Last edited by Aaron Griffin (phrakture) - Wednesday, 07 May 2008, 22:58 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Paul Mattal (paul)
Architecture All
Severity Medium
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:

right now the only option of using any other editor for the visudo command is adding the line Default env_editor to the sudoers file, this can be done in two ways
1) using visudo (that means that you use vim, vim is not too friendly for someone who doesnt know vim and doesnt want to waste time digging in vim's help to find out that you need to type "a" to edit something and to tyoe ":wq" to save and exit, maybe knowing vim itsealf is KISS but digging everywhere to learn those basic commands so that i can use an editor i know for visudo is definatlly not KISS in any way)
2) editing with your editor, its very unsafe, a wrong syntax and sudo wont work, some admins prefer to disable root, such an act can kill a system with a disabled root..
its no too hard to use a wrong syntax, default is a word that is too simple to mispell, ad you can easily forget or not notice that you need the "d" to be capital.


man visudo gives two solutions for this problem:

1) at compile time there is an option to add editor to a list of default ones, so an editor in that list stated in the EDITOR and ENVIORMANT variables would not be used, if thats the case, then adding some popular editors like nano would be a great solution

2) at compile time you can pass an argument that will work like Defaults env_editor, if its not unsafe, then this solution will be better.

it was suggested in the #arch-linux channel on freenode that the bug may be rejected because the man page writes that the default editor for the system is vim, i hope that changing a man page with adding a little argument or two, and recompiling is not a big problem.

im sorry if its not in its place, i really think that the situation as it is violates the KISS principle (correct me if im wrong)m this is my first bug report ever so please understand :)
This task depends upon

Closed by  Aaron Griffin (phrakture)
Wednesday, 07 May 2008, 22:58 GMT
Reason for closing:  Implemented
Additional comments about closing:  In testing
Comment by Attila (attila) - Sunday, 11 November 2007, 10:03 GMT
Thanks Leon for pointing this out. Now i know why i even see vi instead of my favorit if i want to edit sudoers.-) There should be a safe way to use $EDITOR because at example opensuse uses it. The source rpm of can get from
ftp://ftp5.gwdg.de/pub/opensuse/distribution/10.3/repo/src-oss/suse/src/sudo-1.6.9p2-23.src.rpm
Perhaps a dev can extract it to see how it can be solved. On the other side it could never be wrong to have a minimal understanding how vi is to use because it is the default editor of the most distros what i know.-)
Comment by Jonathan Frazier (wide-eye) - Sunday, 11 November 2007, 23:51 GMT
I added "--with-env-editor" to the configure options for sudo, built and installed it, then EDITOR=nano visudo worksforme.
Comment by Gavin Bisesi (Daenyth) - Friday, 25 April 2008, 03:38 GMT
The official pkgbuild still has --with-editor=/usr/bin/vi. Any reason it's not implemented?

Loading...