6 Commits

Author SHA1 Message Date
d0db2adafb fixing missing pack/unpack closes #1 2025-06-29 02:11:40 -06:00
Alan Boudreault
e04ddbe3ae chore(rockspec) fix the rockspec source url 2021-11-04 19:15:52 +01:00
Alan Boudreault
0108834dd3 chore(rockspec) switch to git+https protocol 2021-11-02 16:54:46 +01:00
Alan Boudreault
ee3285e2fd chore(*) luarocks only support git+ssh protocol 2021-11-02 15:59:48 +01:00
Alan Boudreault
07a01090e7 chore(*) fix rockspec source url 2021-11-02 15:44:45 +01:00
Enrique García Cota
35714d7a92 chore rockspec for 1.0.1 2021-01-07 18:55:19 +01:00
2 changed files with 23 additions and 5 deletions

View File

@@ -1,15 +1,15 @@
package = "sandbox"
version = "1.0.0-0"
version = "1.0.1-4"
source = {
url = "git://github.com/kikito/sandbox.lua.git",
tag = "v1.0.0"
url = "git+https://github.com/kikito/lua-sandbox",
tag = "v1.0.1"
}
description = {
summary = "A pure-lua solution for running untrusted Lua code.",
homepage = "https://github.com/kikito/sandbox.lua",
homepage = "https://github.com/kikito/lua-sandbox",
}
dependencies = {

View File

@@ -1,5 +1,5 @@
local sandbox = {
_VERSION = "sandbox 0.5",
_VERSION = "sandbox 0.5.1",
_DESCRIPTION = "A pure-lua solution for running untrusted Lua code.",
_URL = "https://github.com/kikito/sandbox.lua",
_LICENSE = [[
@@ -29,6 +29,24 @@ local sandbox = {
}
-- 0.5.1 fixing missing pack and unpack functions for some Lua versions
if not table.pack then
table.pack = function(...)
local t = {...}
t.n = select("#", ...)
return t
end
end
if not table.unpack then
table.unpack = function(tab, start, finish)
local result = {}
for i = start or 1, finish or #tab do
result[#result + 1] = tab[i]
end
return result
end
end
-- quotas don't work in LuaJIT since debug.sethook works differently there
local quota_supported = type(_G.jit) == "nil"
sandbox.quota_supported = quota_supported