summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/util-sbx.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/util-sbx.lua')
-rw-r--r--tex/context/base/mkiv/util-sbx.lua17
1 files changed, 9 insertions, 8 deletions
diff --git a/tex/context/base/mkiv/util-sbx.lua b/tex/context/base/mkiv/util-sbx.lua
index 66a650875..57c576870 100644
--- a/tex/context/base/mkiv/util-sbx.lua
+++ b/tex/context/base/mkiv/util-sbx.lua
@@ -28,6 +28,7 @@ local concat = string.concat
local unquoted = string.unquoted
local optionalquoted = string.optionalquoted
local basename = file.basename
+local nameonly = file.nameonly
local sandbox = sandbox
local validroots = { }
@@ -122,9 +123,9 @@ local function registerlibrary(name)
return
end
if validlibraries == true then
- validlibraries = { [name] = true }
+ validlibraries = { [nameonly(name)] = true }
else
- validlibraries[name] = true
+ validlibraries[nameonly(name)] = true
end
elseif name == true then
validlibraries = { }
@@ -461,7 +462,7 @@ function sandbox.getrunner(name)
end
local function suspicious(str)
- return (find(str,"[/\\]") or find(command,"%.%.")) and true or false
+ return (find(str,"[/\\]") or find(command,"..",1,true)) and true or false
end
local function binaryrunner(action,command,...)
@@ -562,9 +563,9 @@ if FFISUPPORTED and ffi then
end
end
- local load = ffi.load
+ local fiiload = ffi.load
- if load then
+ if fiiload then
local reported = { }
@@ -573,10 +574,10 @@ if FFISUPPORTED and ffi then
-- all blocked
elseif validlibraries == true then
-- all permitted
- return load(name,...)
- elseif validlibraries[name] then
+ return fiiload(name,...)
+ elseif validlibraries[nameonly(name)] then
-- 'name' permitted
- return load(name,...)
+ return fiiload(name,...)
else
-- 'name' not permitted
end