diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2020-11-11 19:39:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-11 19:39:08 +0100 |
commit | 4875db2e56b395f47e3b9634b8c0a0e179fbe353 (patch) | |
tree | 756ad7dc5faa38b1c359bf92d8cf9426d13bf052 /src/nvim/ex_cmds.c | |
parent | 0a95549d66df63c06d775fcc329f7b63cbb46b2f (diff) | |
parent | 7777532cebcfa9abc5ab2c7beae77f386feed3ca (diff) | |
download | rneovim-4875db2e56b395f47e3b9634b8c0a0e179fbe353.tar.gz rneovim-4875db2e56b395f47e3b9634b8c0a0e179fbe353.tar.bz2 rneovim-4875db2e56b395f47e3b9634b8c0a0e179fbe353.zip |
Merge pull request #11996 from georg3tom/remove_restricted
Removed restricted mode - Fix #11972
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 55366842b0..17afb33059 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -1049,13 +1049,13 @@ void do_bang(int addr_count, exarg_T *eap, int forceit, int do_in, int do_out) int len; int scroll_save = msg_scroll; - /* - * Disallow shell commands in restricted mode (-Z) - * Disallow shell commands from .exrc and .vimrc in current directory for - * security reasons. - */ - if (check_restricted() || check_secure()) + // + // Disallow shell commands from .exrc and .vimrc in current directory for + // security reasons. + // + if (check_secure()) { return; + } if (addr_count == 0) { /* :! */ msg_scroll = FALSE; /* don't scroll here */ @@ -1383,10 +1383,9 @@ do_shell( int flags // may be SHELL_DOOUT when output is redirected ) { - // Disallow shell commands in restricted mode (-Z) // Disallow shell commands from .exrc and .vimrc in current directory for // security reasons. - if (check_restricted() || check_secure()) { + if (check_secure()) { msg_end(); return; } @@ -3030,20 +3029,6 @@ 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. -bool check_restricted(void) - FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT -{ - if (restricted) { - EMSG(_("E145: Shell commands and some functionality not allowed" - " in restricted mode")); - return true; - } - return false; -} - /* * Check if the secure flag is set (.exrc or .vimrc in current directory). * If so, give an error message and return TRUE. |