mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
Removed restricted mode - Fix #11972
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user