From ec753cf40db4d326c2fbbf5e5be0d249be561a41 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 6 Sep 2023 23:50:17 +0200 Subject: vim-patch:f7ac0ef50988 runtime: don't execute external commands when loading ftplugins This is a followup to 816fbcc262687b81fc46f82f7bbeb1453addfe0c (patch 9.0.1833: [security] runtime file fixes) It basically disables that external commands are run on loading of the filetype plugin, **unless** the user has set the `g:plugin_exec = 1` global variable in their configuration or for a specific filetype the variable g:_exec=1. There are a few more plugins, that may execute system commands like debchangelog, gitcommit, sh, racket, zsh, ps1 but those do at least do not run those commands by default during loading of the filetype plugin (there the command is mostly run as convenience for auto-completion or to provide documentation lookup). closes: vim/vim#13034 https://github.com/vim/vim/commit/f7ac0ef5098856bedca26e7073594a407c05636f Co-authored-by: Christian Brabandt Co-authored-by: Tim Pope --- runtime/doc/filetype.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'runtime/doc') diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index cf60ecdb6b..bae3006c36 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -382,11 +382,24 @@ ways to change this: 3. Docs for the default filetype plugins. *ftplugin-docs* + *plugin_exec* *g:plugin_exec* +Enable executing of external commands. This was done historically for e.g. +the perl filetype plugin (and a few others) to set the search path. +Disabled by default for security reasons: > + :let g:plugin_exec = 1 +It is also possible to enable this only for certain filetypes: > + :let g:_exec = 1 +So to enable this only for ruby, set the following variable: > + :let g:ruby_exec = 1 + +If both, the global `plugin_exec` and the `_exec` specific variable +are set, the filetpe specific variable should have precedent. + AWK *ft-awk-plugin* Support for features specific to GNU Awk, like @include, can be enabled by setting: > - let g:awk_is_gawk = 1 + :let g:awk_is_gawk = 1 CHANGELOG *ft-changelog-plugin* -- cgit