nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] preventing a root-owned .nano dir


From: Benno Schulenberg
Subject: Re: [Nano-devel] preventing a root-owned .nano dir
Date: Fri, 10 Jul 2015 12:32:11 +0200

On Thu, Jul 9, 2015, at 05:49, Eitan Adler wrote:
> On 8 July 2015 at 19:44,  <address@hidden> wrote:
> > What about `sudo -u another_user nano`? I've seen many
> > broken environments over the years and having nano deal
> > with it sounds like a good idea. But it would be less hacky if
> > it handled both cases, root and other users.

When a user is advanced enough to use 'sudo -u', he or she
should be smart enough to also use -H.  The reason I suggest
nano should ignore HOME when running as root is that novice
users, when they've just freshly installed a distro, get
instructed to edit some configuration file, and they run
'sudo nano /etc/something', and then later run into the
annoying presence of a root-owned .nano dir.

https://bugs.launchpad.net/ubuntu/+source/nano/+bug/1471459

Of course, distros could instruct their users to always use
'sudo -H' or 'sudoedit', or they could put 'always_set_home'
in their /etc/sudoers file.  But there are a lot of distros
out there.  And it is nano that creates the directory, so it
would be nice if nano was creating it wisely.

'sudo -u otheruser nano' will just complain that 
/home/yourself/.nano/search_history cannot be read,
or that /home/yourself/.nano cannot be created.
There is no harm in those messages, they just indicate
you aren't using sudo correctly.  Nano will not create
a directory that is then unusable by the user.

> IMHO this is 'expected' behavior: most users should be using sudo -H
> and without -H one would expect programs that use HOME to rely on it.
> That said, there are probably enough sufficiently broken callers of
> sudo out there that it may be worthwhile for nano to do something
> about it.

Benno

-- 
http://www.fastmail.com - IMAP accessible web-mail




reply via email to

[Prev in Thread] Current Thread [Next in Thread]