From 47821840200cd8e14e99001caac602a37cdf8d5c Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Tue, 17 Feb 2015 10:02:36 +0200 Subject: [PATCH] Security: disable the swift/xcrun checker by default. The checker executes the code in your files. This is probably fine if you wrote the files yourself, but it can be a problem if you're trying to check third party files. If you are 100% willing to let Vim run the code in your files, set g:syntastic_enable_swift_xcrun_checker to 1 in your vimrc. Reference: https://github.com/scrooloose/syntastic/issues/1326 --- plugin/syntastic.vim | 2 +- syntax_checkers/swift/xcrun.vim | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index c6a79cc6..e22eed65 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.6.0-26' +let g:_SYNTASTIC_VERSION = '3.6.0-27' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/syntax_checkers/swift/xcrun.vim b/syntax_checkers/swift/xcrun.vim index 8cf5a987..eea15774 100644 --- a/syntax_checkers/swift/xcrun.vim +++ b/syntax_checkers/swift/xcrun.vim @@ -18,6 +18,11 @@ let s:save_cpo = &cpo set cpo&vim function! SyntaxCheckers_swift_xcrun_GetLocList() dict + if !exists('g:syntastic_enable_swift_xcrun_checker') || !g:syntastic_enable_swift_xcrun_checker + call syntastic#log#error('checker swift/xcrun: checks disabled for security reasons; ' . + \ 'set g:syntastic_enable_swift_xcrun_checker to 1 to override') + return [] + endif let makeprg = self.makeprgBuild({ 'args_after': 'swift' })