diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-02-24 20:33:43 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-03-01 20:02:09 -0500 |
commit | d846f47cc88cd36da5ad8fd7e716552c80e3b418 (patch) | |
tree | f136629e3dcd12f3fa2d11446fd8584ddf173d9f /src/nvim/ex_docmd.c | |
parent | 3618fe9e8c67276bc262c6cde8526f42016c2f84 (diff) | |
download | rneovim-d846f47cc88cd36da5ad8fd7e716552c80e3b418.tar.gz rneovim-d846f47cc88cd36da5ad8fd7e716552c80e3b418.tar.bz2 rneovim-d846f47cc88cd36da5ad8fd7e716552c80e3b418.zip |
vim-patch:8.1.0881: can execute shell commands in rvim through interfaces
Problem: Can execute shell commands in rvim through interfaces.
Solution: Disable using interfaces in restricted mode. Allow for writing
file with writefile(), histadd() and a few others.
https://github.com/vim/vim/commit/8c62a08faf89663e5633dc5036cd8695c80f1075
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 28ecaf684a..abe394dc3a 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1783,10 +1783,14 @@ static char_u * do_one_cmd(char_u **cmdlinep, if (!ea.skip) { if (sandbox != 0 && !(ea.argt & SBOXOK)) { - /* Command not allowed in sandbox. */ + // Command not allowed in sandbox. errormsg = (char_u *)_(e_sandbox); goto doend; } + if (restricted != 0 && (ea.argt & RESTRICT)) { + errormsg = (char_u *)_("E981: Command not allowed in restricted mode"); + goto doend; + } if (!MODIFIABLE(curbuf) && (ea.argt & MODIFY) // allow :put in terminals && (!curbuf->terminal || ea.cmdidx != CMD_put)) { |