mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 09:48:19 +00:00
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.
8c62a08faf
This commit is contained in:
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user