vim-patch:1294861: runtime(getscript,vimball,rust): Use correct shellescape() form for ! ex cmd

Problem:  shellescape() called without {special} flag for :! ex command
Solution: Pass 1 as second argument to shellescape() in :! contexts

related: Commit: 3fb5e58fbc63d86a3e65f1a141b0d67af2 (patch 9.2.0479:
         [security]: runtime(tar): command injection in tar plugin)

129486193c

Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2026-05-21 07:52:30 +08:00
parent 3883cba996
commit 040c5deb3f

View File

@@ -1,5 +1,6 @@
" Description: Helper functions for Rust commands/mappings
" Last Modified: 2023-09-11
" 2026 May 20 by Vim project: use correct shellescape() with ! command
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
function! rust#Load()
@@ -125,7 +126,7 @@ function! s:Run(dict, rustc_args, args)
echohl None
endif
if !v:shell_error
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
exe '!' . shellescape(exepath,1) . " " . join(map(a:args, 'shellescape(v:val,1)'))
endif
endfunction