mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
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.
This commit is contained in:
@@ -2007,11 +2007,16 @@ do_one_cmd(
|
||||
#ifdef HAVE_SANDBOX
|
||||
if (sandbox != 0 && !(ea.argt & SBOXOK))
|
||||
{
|
||||
/* Command not allowed in sandbox. */
|
||||
// Command not allowed in sandbox.
|
||||
errormsg = _(e_sandbox);
|
||||
goto doend;
|
||||
}
|
||||
#endif
|
||||
if (restricted != 0 && (ea.argt & RESTRICT))
|
||||
{
|
||||
errormsg = _("E981: Command not allowed in rvim");
|
||||
goto doend;
|
||||
}
|
||||
if (!curbuf->b_p_ma && (ea.argt & MODIFY))
|
||||
{
|
||||
/* Command not allowed in non-'modifiable' buffer */
|
||||
|
Reference in New Issue
Block a user