nanosudo? (default update-alternatives --config editor choice)
Paul Sladen
ubuntu at paul.sladen.org
Mon Dec 24 09:11:13 UTC 2012
On Mon, 24 Dec 2012, Phil Dobbin wrote:
> [is this] now standard Ubuntu policy to default to nano rather
> than vim (vi) for visudo
I had a reinvestigate, rather than relying on my memory. The
requirement is mandated in the following section of the Policy Manual:
Debian Policy Manual
11.4 Editors and pagers
http://www.debian.org/doc/debian-policy/ch-customized-programs.html#s11.4
"‥every program that launches an editor or pager must use the
EDITOR ‥ environment variable" and "[‥if] not set, the programs
/usr/bin/editor ‥ should be used"
So you are correct about EDITOR being unset. Running
'apt-get changelog sudo' brings up an interesting progression of bugs:
1.
* enable ENV_EDITOR
Fixed in sudo (1.4.1-1) on 1996-03-05.
2.
"visudo does not default to vi"
http://bugs.debian.org/388659
Fixed in sudo (1.6.9p9-1) on 2007-12-03
3.
"sudo: ignores configured editor preferences"
http://bugs.debian.org/474197
Fixed in sudo (1.6.9p15-2), on 2008-04-16 with a revert + rationale:
* revert the fix for 388659 such that visudo once again defaults to
using /usr/bin/editor. I was always ambivalent about this change, it
has caused more confusion and frustration than it cured, …"
> so making the nano the default $EDITOR because
So by this stage, $EDITOR should be respected, and if not set should
fallback to /usr/bin/editor, which should default to Nano. However, I
notice that as-of a couple of months ago, a bug has been opened:
"vipw uses vi by default; should use /usr/bin/editor"
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688252
So this could do with double checking.
-Paul
More information about the ubuntu-users
mailing list