FS#57772 - [vim-runtime] vim calls `/bin/bash -c '(install -dm 700 ~/.vim/swap) > XXX'` on each run
Attached to Project:
Arch Linux
Opened by Alexander Meshcheryakov (Self-Perfection) - Friday, 09 March 2018, 16:48 GMT
Last edited by Levente Polyak (anthraxx) - Wednesday, 09 May 2018, 22:44 GMT
Opened by Alexander Meshcheryakov (Self-Perfection) - Friday, 09 March 2018, 16:48 GMT
Last edited by Levente Polyak (anthraxx) - Wednesday, 09 May 2018, 22:44 GMT
|
Details
Description:
Latest version of archlinux.vim contains following code: " Move the swap file location to protect against CVE-2017-1000382 if ! isdirectory('~/.vim/swap/') silent! call system('install -dm 700 ~/.vim/swap') endif set directory=~/.vim/swap/ However check for existing directory does not work and vim always calls install. This can be checked by running: [ -d ~/.vim/swap ] && strace -ff -e trace=execve vim -c :q Apparently vim checks for literal dir '~/.vim/swap' and does not replace ~ with $HOME. This can be fixed by replacing isdirectory('~/.vim/swap/') with isdirectory(expand('~/.vim/swap/')) Additional info: * package version(s) - 8.0.1542-2 |
This task depends upon
Closed by Levente Polyak (anthraxx)
Wednesday, 09 May 2018, 22:44 GMT
Reason for closing: Fixed
Additional comments about closing: 8.0.1806-1
Wednesday, 09 May 2018, 22:44 GMT
Reason for closing: Fixed
Additional comments about closing: 8.0.1806-1
let &directory='~/.vim/swap/'
if ! isdirectory(expand(&directory))
silent! call mkdir(expand(&directory), 'p', 0700)
endif
This avoids running shell and external tool to create swap directory.
FS#57715,FS#57682We are collecting bugreports like flies, but technically these are not duplicates as each one refers to a different issue with the wider change involved here.