mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 08:53:08 +01:00
Fix too restrictive Lua sandbox
Don't limit the environment when evaluating bytecode (factory function).
This commit is contained in:
parent
b25b99216c
commit
8c556fcbdc
1 changed files with 2 additions and 2 deletions
|
|
@ -1061,7 +1061,7 @@ LuaInstance::init ()
|
|||
" assert(type(f) == 'function', 'Factory is a not a function')"
|
||||
" assert(type(a) == 'table' or type(a) == 'nil', 'Given argument is invalid')"
|
||||
" self.scripts[i] = { ['n'] = n, ['s'] = s, ['f'] = f, ['a'] = a, ['c'] = c }"
|
||||
" local env = _ENV; env.f = nil env.io = nil"
|
||||
" local env = _ENV; env.f = nil"
|
||||
" self.instances[i] = load (string.dump(f, true), nil, nil, env)(a)"
|
||||
" if type(c) == 'function' then"
|
||||
" self.icons[i] = load (string.dump(c, true), nil, nil, env)(a)"
|
||||
|
|
@ -1792,7 +1792,7 @@ LuaCallback::init (void)
|
|||
" assert(type(f) == 'function', 'Factory is a not a function')"
|
||||
" assert(type(a) == 'table' or type(a) == 'nil', 'Given argument is invalid')"
|
||||
" self.script = { ['n'] = n, ['s'] = s, ['f'] = f, ['a'] = a }"
|
||||
" local env = _ENV; env.f = nil env.io = nil"
|
||||
" local env = _ENV; env.f = nil"
|
||||
" self.instance = load (string.dump(f, true), nil, nil, env)(a)"
|
||||
" end"
|
||||
""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue