vim-patch:8.1.1365: :source should check sandbox #10082

Problem:    Source command doesn't check for the sandbox. (Armin Razmjou)
Solution:   Check for the sandbox when sourcing a file.
5357552140
This commit is contained in:
Justin M. Keyes 2019-05-29 00:33:22 +02:00 committed by GitHub
parent 877d539904
commit 4553fc5e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -1244,6 +1244,13 @@ openscript (
EMSG(_(e_nesting));
return;
}
// Disallow sourcing a file in the sandbox, the commands would be executed
// later, possibly outside of the sandbox.
if (check_secure()) {
return;
}
if (ignore_script)
/* Not reading from script, also don't open one. Warning message? */
return;