diff options
author | Gregory Anders <greg@gpanders.com> | 2022-11-06 19:44:30 -0700 |
---|---|---|
committer | Gregory Anders <greg@gpanders.com> | 2022-11-17 08:23:41 -0700 |
commit | 6d9c3d903ecee2d1d21d0a0806f1a2bebe628e8e (patch) | |
tree | 31cb31b570e2263250471ea2ee08be1b41ac8d31 /src/nvim/main.c | |
parent | 294910a1ffd11bea0081c2b92632628ef0462eb1 (diff) | |
download | rneovim-6d9c3d903ecee2d1d21d0a0806f1a2bebe628e8e.tar.gz rneovim-6d9c3d903ecee2d1d21d0a0806f1a2bebe628e8e.tar.bz2 rneovim-6d9c3d903ecee2d1d21d0a0806f1a2bebe628e8e.zip |
refactor: deprecate 'secure' option
Now that 'exrc' files must be explicitly marked trusted there is no need
to constrain what can be done in them.
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index e8c1c98c38..a369ca0256 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1989,32 +1989,15 @@ static void source_startup_scripts(const mparm_T *const parmp) do_system_initialization(); if (do_user_initialization()) { - // Read initialization commands from ".vimrc" or ".exrc" in current + // Read initialization commands from ".nvimrc" or ".exrc" in current // directory. This is only done if the 'exrc' option is set. - // Because of security reasons we disallow shell and write commands - // now, except for unix if the file is owned by the user or 'secure' - // option has been reset in environment of global "exrc" or "vimrc". // Only do this if VIMRC_FILE is not the same as vimrc file sourced in // do_user_initialization. -#if defined(UNIX) - // If vimrc file is not owned by user, set 'secure' mode. - if (!os_file_owned(VIMRC_FILE)) // NOLINT(readability/braces) -#endif - secure = p_secure; - char *str = nlua_read_secure(VIMRC_FILE); if (str != NULL) { do_source_str(str, VIMRC_FILE); xfree(str); } else { -#if defined(UNIX) - // if ".exrc" is not owned by user set 'secure' mode - if (!os_file_owned(EXRC_FILE)) { - secure = p_secure; - } else { - secure = 0; - } -#endif str = nlua_read_secure(EXRC_FILE); if (str != NULL) { do_source_str(str, EXRC_FILE); @@ -2022,10 +2005,6 @@ static void source_startup_scripts(const mparm_T *const parmp) } } } - if (secure == 2) { - need_wait_return = true; - } - secure = 0; } TIME_MSG("sourcing vimrc file(s)"); } |