patch 9.1.1552: [security]: path traversal issue in tar.vim
Problem: [security]: path traversal issue in tar.vim (@ax) Solution: warn the user for such things, drop leading /, don't forcefully overwrite files when writing temporary files, refactor autoload/tar.vim tar.vim: drop leading / in path names A tar archive containing files with leading `/` may cause confusions as to where the content is extracted. Let's make sure we drop the leading `/` and use a relative path instead. Also while at it, had to refactor it quite a bit and increase the minimum supported Vim version to v9. Also add a test for some basic tar functionality closes: #17733
This commit is contained in:
@ -23,14 +23,14 @@ set cpo&vim
|
||||
" Public Interface: {{{1
|
||||
augroup tar
|
||||
au!
|
||||
au BufReadCmd tarfile::* call tar#Read(expand("<amatch>"), 1)
|
||||
au FileReadCmd tarfile::* call tar#Read(expand("<amatch>"), 0)
|
||||
au BufReadCmd tarfile::* call tar#Read(expand("<amatch>"))
|
||||
au FileReadCmd tarfile::* call tar#Read(expand("<amatch>"))
|
||||
au BufWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
|
||||
au FileWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
|
||||
|
||||
if has("unix")
|
||||
au BufReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 1)
|
||||
au FileReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 0)
|
||||
au BufReadCmd tarfile::*/* call tar#Read(expand("<amatch>"))
|
||||
au FileReadCmd tarfile::*/* call tar#Read(expand("<amatch>"))
|
||||
au BufWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
|
||||
au FileWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
|
||||
endif
|
||||
|
Reference in New Issue
Block a user