# HG changeset patch # User Waqas Hussain # Date 1288878297 -18000 # Node ID 58ab7e61d22019ae7dc975017a02b49e4b8e8e94 # Parent d00fc909296ebd2616c6ff1e041b05358df039a4 mod_console: Keep global variable assignments sandboxed by default. diff -r d00fc909296e -r 58ab7e61d220 plugins/mod_console.lua --- a/plugins/mod_console.lua Thu Nov 04 08:42:18 2010 +0000 +++ b/plugins/mod_console.lua Thu Nov 04 18:44:57 2010 +0500 @@ -27,7 +27,7 @@ prosody.console = { commands = commands, env = def_env }; local function redirect_output(_G, session) - local env = setmetatable({ print = session.print }, { __index = function (t, k) return rawget(_G, k); end, __newindex = function (t, k, v) rawset(_G, k, v); end }); + local env = setmetatable({ print = session.print }, { __index = function (t, k) return rawget(_G, k); end }); env.dofile = function(name) local f, err = loadfile(name); if not f then return f, err; end