mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +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:
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user