diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-02-24 20:33:43 -0500 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-03-01 20:02:09 -0500 |
commit | d846f47cc88cd36da5ad8fd7e716552c80e3b418 (patch) | |
tree | f136629e3dcd12f3fa2d11446fd8584ddf173d9f /src/nvim/ex_cmds.c | |
parent | 3618fe9e8c67276bc262c6cde8526f42016c2f84 (diff) | |
download | rneovim-d846f47cc88cd36da5ad8fd7e716552c80e3b418.tar.gz rneovim-d846f47cc88cd36da5ad8fd7e716552c80e3b418.tar.bz2 rneovim-d846f47cc88cd36da5ad8fd7e716552c80e3b418.zip |
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.
https://github.com/vim/vim/commit/8c62a08faf89663e5633dc5036cd8695c80f1075
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index bc6821f60f..ba66b666e0 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -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; } /* |