summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-08-09 04:07:23 +0200
committerRobin Gareus <robin@gareus.org>2017-08-10 02:25:49 +0200
commit0191a9c4c2749871887e3a2878a36afef90f832b (patch)
tree8e73f73ce8b2a986f8b5119b557932b28ce0d93f /libs/ardour/session.cc
parentcba622cdcecdba2fd88556c4364646c96f4451c6 (diff)
Centralize Lua sandboxing
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 91f67cf3da..764e05c3e8 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -5500,6 +5500,7 @@ Session::setup_lua ()
lua.Print.connect (&_lua_print);
#endif
lua.tweak_rt_gc ();
+ lua.sandbox (true);
lua.do_command (
"function ArdourSession ()"
" local self = { scripts = {}, instances = {} }"
@@ -5516,7 +5517,6 @@ Session::setup_lua ()
" assert(type(a) == 'table' or type(a) == 'nil', 'Given argument is invalid')"
" assert(self.scripts[n] == nil, 'Callback \"'.. n ..'\" already exists.')"
" self.scripts[n] = { ['f'] = f, ['a'] = a }"
- " local env = _ENV; env.f = nil env.io = nil env.os = nil env.loadfile = nil env.require = nil env.dofile = nil env.package = nil env.debug = nil"
" local env = { print = print, tostring = tostring, assert = assert, ipairs = ipairs, error = error, select = select, string = string, type = type, tonumber = tonumber, collectgarbage = collectgarbage, pairs = pairs, math = math, table = table, pcall = pcall, bit32=bit32, Session = Session, PBD = PBD, Timecode = Timecode, Evoral = Evoral, C = C, ARDOUR = ARDOUR }"
" self.instances[n] = load (string.dump(f, true), nil, nil, env)(a)"
" Session:scripts_changed()" // call back