Some programs create root-owned files in user $HOME when run under sudo
Bug #58002 reported by
Rocco Stanzione
This bug affects 8 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vim (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
The first time I noticed this I thought I'd done something wrong. But 5 installations later, my .viminfo is always owned by root, causing certain things to malfunction or not function at all. For example I can't copy and paste text (vim-style) from one file to another, and despite my .vimrc magic my cursor is always on line 1, column 1 when I open a file.
Changed in vim: | |
status: | Unconfirmed → Confirmed |
Changed in vim: | |
importance: | Wishlist → Medium |
To post a comment you must log in.
After furter reflection, meditation, source package examination and finally experimentation, I see the cause of the problem. The first file I edit, without exception, on a new system is my sources.list. So of course I say `sudo vi /etc/apt/ sources. list`. Since I'm using sudo, the .vimrc file is created as root, and since $HOME is preserved when I use sudo with no options, it's created in my home directory. The simplest solution is probably an empty /etc/skel entry for .vimrc?