From 1d19dff701524ebed90a4fbd7c7cd75ab954b79d Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Wed, 16 Jul 2014 18:39:52 +0300 Subject: [PATCH] Security: disable the elixir checker by default. This executes the code 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_elixir_checker to 1 in your vimrc. References: https://groups.google.com/d/msg/elixir-lang-talk/B29noPHvQ-8/9JvSGPop7n0J --- plugin/syntastic.vim | 2 +- plugin/syntastic/loclist.vim | 1 + plugin/syntastic/registry.vim | 2 +- syntax_checkers/elixir/elixir.vim | 5 +++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index ae3ed8a3..c91a21e1 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.4.0-106' +let g:syntastic_version = '3.4.0-107' lockvar g:syntastic_version " Sanity checks {{{1 diff --git a/plugin/syntastic/loclist.vim b/plugin/syntastic/loclist.vim index 6ab2132e..e7c05bf7 100644 --- a/plugin/syntastic/loclist.vim +++ b/plugin/syntastic/loclist.vim @@ -49,6 +49,7 @@ endfunction " }}}2 function! g:SyntasticLoclist.isNewerThan(stamp) " {{{2 if !exists("self._stamp") let self._stamp = [] + return 0 endif return syntastic#util#compareLexi(self._stamp, a:stamp) > 0 endfunction " }}}2 diff --git a/plugin/syntastic/registry.vim b/plugin/syntastic/registry.vim index fb551528..47d83106 100644 --- a/plugin/syntastic/registry.vim +++ b/plugin/syntastic/registry.vim @@ -30,7 +30,7 @@ let s:defaultCheckers = { \ 'dart': ['dartanalyzer'], \ 'docbk': ['xmllint'], \ 'dustjs': ['swiffer'], - \ 'elixir': ['elixir'], + \ 'elixir': [], \ 'erlang': ['escript'], \ 'eruby': ['ruby'], \ 'fortran': ['gfortran'], diff --git a/syntax_checkers/elixir/elixir.vim b/syntax_checkers/elixir/elixir.vim index 566131d5..3914fa9b 100644 --- a/syntax_checkers/elixir/elixir.vim +++ b/syntax_checkers/elixir/elixir.vim @@ -24,6 +24,11 @@ function! SyntaxCheckers_elixir_elixir_IsAvailable() dict endfunction function! SyntaxCheckers_elixir_elixir_GetLocList() dict + if !exists('g:syntastic_enable_elixir_checker') || !g:syntastic_enable_elixir_checker + call syntastic#log#error('checker elixir/elixir: checks disabled for security reasons; ' . + \ 'set g:syntastic_enable_elixir_checker to 1 to override') + return [] + endif let make_options = {} let compile_command = 'elixir'