FS#59892 - [vim] Update causes E510 (can't make backup file) due to bad permissions in ~/.cache/vim

Attached to Project: Arch Linux
Opened by Aqua Soo (AquaSZS) - Friday, 31 August 2018, 14:17 GMT
Last edited by Doug Newgard (Scimmia) - Monday, 17 September 2018, 15:12 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Perhaps due to some change in /usr/share/vim/vimfiles/archlinux.vim , starting vim after update creates directories owned by root in ~/.cache/vim . This causes any file write attempts to throw an E510 error because vim cannot access ~/.cache/vim/backup .


Additional info:
vim provided by gvim


Steps to reproduce:
Update to vim to 8.1.0333


While this is easily fixed by wiping ~/.cache/vim as root, may cause some confusion after update.
This task depends upon

Closed by  Doug Newgard (Scimmia)
Monday, 17 September 2018, 15:12 GMT
Reason for closing:  Works for me
Comment by Eli Schwartz (eschwartz) - Friday, 31 August 2018, 20:54 GMT
vim cannot even create files owned by root, unless you are in fact running vim as root.
Are you?

If so, then since vim will silent! call mkdir(expand(&g:directory), 'p', 0700) where &g:directory is $XDG_CACHE_HOME (falling back to $HOME/.cache as per the spec), why is that command being evaluated as root, using your own home directory?
Comment by Aqua Soo (AquaSZS) - Saturday, 01 September 2018, 01:23 GMT
On second thought, the problem directories may have been generated when I did `sudo pacdiff` after the update. Of course, there was no error with vimdiff at that time.
Comment by Levente Polyak (anthraxx) - Wednesday, 12 September 2018, 23:23 GMT
tried in clean vm and dont see how this could possibly happen if you didn't do forceful magic to preserve old HOME or XDG_CACHE_HOME value when calling something with sudo (which must not be preserved)

Loading...