1
0
forked from aniani/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.
This commit is contained in:
Bram Moolenaar
2019-02-08 14:34:10 +01:00
parent c6ddce3f2c
commit 8c62a08faf
8 changed files with 151 additions and 18 deletions

View File

@@ -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 */