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:
Jan Edmund Lazo
2020-02-24 20:33:43 -05:00
parent 3618fe9e8c
commit d846f47cc8
5 changed files with 134 additions and 19 deletions

View File

@@ -3008,18 +3008,18 @@ void ex_z(exarg_T *eap)
ex_no_reprint = true;
}
/*
* Check if the restricted flag is set.
* If so, give an error message and return TRUE.
* Otherwise, return FALSE.
*/
int check_restricted(void)
// Check if the restricted flag is set.
// If so, give an error message and return true.
// Otherwise, return false.
bool check_restricted(void)
FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{
if (restricted) {
EMSG(_("E145: Shell commands not allowed in restricted mode"));
return TRUE;
EMSG(_("E145: Shell commands and some functionality not allowed"
" in restricted mode"));
return true;
}
return FALSE;
return false;
}
/*