aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/api_functions_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-06-26 11:59:08 +0200
committerGitHub <noreply@github.com>2019-06-26 11:59:08 +0200
commitac013d7147f13d95ee4ffa4eef6af1023ef0a0c2 (patch)
tree494cd97e17569e6fccec2d1a31a01883f690f354 /test/functional/eval/api_functions_spec.lua
parent469726d3c5ae2b1db2366625d07f830e68ed1e05 (diff)
parent619a86cb1e8640e4b834ef1f85bd62b0fb5609f2 (diff)
downloadrneovim-ac013d7147f13d95ee4ffa4eef6af1023ef0a0c2.tar.gz
rneovim-ac013d7147f13d95ee4ffa4eef6af1023ef0a0c2.tar.bz2
rneovim-ac013d7147f13d95ee4ffa4eef6af1023ef0a0c2.zip
Merge pull request #10342 from bfredl/apisandbox
eval/api: don't allow the API to be called in the sandbox
Diffstat (limited to 'test/functional/eval/api_functions_spec.lua')
-rw-r--r--test/functional/eval/api_functions_spec.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/functional/eval/api_functions_spec.lua b/test/functional/eval/api_functions_spec.lua
index 0e3a88802d..3947f88c0a 100644
--- a/test/functional/eval/api_functions_spec.lua
+++ b/test/functional/eval/api_functions_spec.lua
@@ -4,7 +4,8 @@ local lfs = require('lfs')
local neq, eq, command = helpers.neq, helpers.eq, helpers.command
local clear, curbufmeths = helpers.clear, helpers.curbufmeths
local exc_exec, expect, eval = helpers.exc_exec, helpers.expect, helpers.eval
-local insert = helpers.insert
+local insert, meth_pcall = helpers.insert, helpers.meth_pcall
+local meths = helpers.meths
describe('eval-API', function()
before_each(clear)
@@ -145,4 +146,10 @@ describe('eval-API', function()
]])
screen:detach()
end)
+
+ it('cannot be called from sandbox', function()
+ eq({false, 'Vim(call):E48: Not allowed in sandbox'},
+ meth_pcall(command, "sandbox call nvim_input('ievil')"))
+ eq({''}, meths.buf_get_lines(0, 0, -1, true))
+ end)
end)