Software /
code /
prosody
Diff
plugins/mod_console.lua @ 3557:58ab7e61d220
mod_console: Keep global variable assignments sandboxed by default.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Thu, 04 Nov 2010 18:44:57 +0500 |
parent | 3540:bc139431830b |
child | 3614:8b436cc88c0e |
line wrap: on
line diff
--- 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