diff --git a/sys/apps/shell.lua b/sys/apps/shell.lua index 7036afa..91228fb 100644 --- a/sys/apps/shell.lua +++ b/sys/apps/shell.lua @@ -10,6 +10,10 @@ local sandboxEnv = setmetatable({ }, { __index = _G }) for k,v in pairs(_ENV) do sandboxEnv[k] = v end +sandboxEnv.package = nil +sandboxEnv.require = nil +sandboxEnv.arg = nil +sandboxEnv._ENV = nil sandboxEnv.shell = shell _G.requireInjector(_ENV) @@ -291,7 +295,9 @@ function shell.setEnv(name, value) end function shell.getEnv() - return sandboxEnv + local env = Util.shallowCopy(sandboxEnv) + _G.requireInjector(env) + return env end function shell.setAlias( _sCommand, _sProgram ) diff --git a/sys/kernel.lua b/sys/kernel.lua index ea4233c..4838892 100644 --- a/sys/kernel.lua +++ b/sys/kernel.lua @@ -151,7 +151,7 @@ function kernel.newRoutine(args) }, { __index = Routine }) Util.merge(routine, args) - routine.env = args.env or Util.shallowCopy(shell.getEnv()) + routine.env = args.env or shell.getEnv() return routine end