From 7f5d052faa9bad245d8414e332d6e82471118db0 Mon Sep 17 00:00:00 2001 From: James Roseborough Date: Sat, 11 Apr 2015 23:36:48 +0000 Subject: [PATCH] Add samplesandboxed.lua script to demonstrate sandboxing in lua. --- README.html | 3 +- examples/jse/SampleSandboxed.java | 3 +- examples/lua/samplesandboxed.lua | 114 ++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 examples/lua/samplesandboxed.lua diff --git a/README.html b/README.html index 7bbf88ea..0feaabad 100644 --- a/README.html +++ b/README.html @@ -980,7 +980,8 @@ Files are no longer hosted at LuaForge.
  • Improve garbage collection of orphaned coroutines when yielding from debug hook functions (fixes issue #32).
  • LuaScriptEngineFactory.getScriptEngine() now returns new instance of LuaScriptEngine for each call.
  • Fix os.date("*t") to return hour in 24 hour format (fixes issue #45)
  • -
  • Add SampleSandboxed.java sample code to illustrate sandboxing techniques.
  • +
  • Add SampleSandboxed.java example code to illustrate sandboxing techniques in Java.
  • +
  • Add samplesandboxed.lua example code to illustrate sandboxing techniques in lua.
  • Make string metatable a proper metatable, and make it read-only by default.
  • Add sample code that illustrates techniques in creating sandboxed environments.
  • Add convenience methods to Global to load string scripts with custom environment.
  • diff --git a/examples/jse/SampleSandboxed.java b/examples/jse/SampleSandboxed.java index 33bde745..5b4e265f 100644 --- a/examples/jse/SampleSandboxed.java +++ b/examples/jse/SampleSandboxed.java @@ -7,7 +7,8 @@ import org.luaj.vm2.lib.jse.*; * in a server environment. * *

    Although this sandboxing is done primarily in Java here, these - * same techniques should all be possible directly from lua using metatables. + * same techniques should all be possible directly from lua using metatables, + * and examples are shown in examples/lua/samplesandboxed.lua. * *

    The main goals of this sandbox are: *