nanosudo? (default update-alternatives --config editor choice)

Phil Dobbin bukowskiscat at gmail.com
Mon Dec 24 16:10:43 UTC 2012


On 12/24/2012 09:11 AM, Paul Sladen wrote:

> 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.

I see. :-)

Whilst I can understand Ubuntu wanting to make things easier for people
with regards to the default editor (many people are put off by vim it
must be said), I can't help thinking it'd would've been better left as
it was especially in cases like visudo (if you think about it, if you're
using a desktop version of Ubuntu, you'd very rarely need to edit
sudoers anyway. It's mainly used when you're logged in as root on the
server edition). The results of "fiddling" with it seemed to have
outweighed the benefits as is often the case.

Still, it's hardly calamitous. It just surprised me that's all. And
after a quick search on Google, I can't find any reference to any Red
Hat problems similar to this, so it must've been the Ubuntu thread you
mention that I saw. It's been a long year...

Cheers,

  Phil...


-- 
currently (ab)using
CentOS 5.8 & 6.3, Debian Squeeze & Wheezy, Fedora Beefy & Spherical,
Lubuntu 12.10, OS X Snow Leopard & Ubuntu Precise & Quantal






More information about the ubuntu-users mailing list