diff options
author | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
commit | 65d009a0596b194597f47531523addd3e64ed005 (patch) | |
tree | e13bd9beecf63e26491a66aa7a8fa702482f0067 /Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua | |
parent | d1a186333ced7b341e26877907343f08211199f7 (diff) |
context [current] (20mar18)
git-svn-id: svn://tug.org/texlive/trunk@47050 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua b/Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua index 66a65087535..57c57687067 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/util-sbx.lua +++ b/Master/texmf-dist/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 |