[luatex] [PATCH] Make require return an error for ffi without shell-escape

Henri Menke henri at henrimenke.de
Tue Apr 12 20:46:11 CEST 2022


This change will make require("ffi") fail with an error by default, which is
generally better than returning an unusable ffi table.  Third-party libraries
usually expect a working ffi table to be available after require("ffi").  That
promise was broken by the previous behavior.
---
 source/texk/web2c/luatexdir/lua/luatex-core.lua | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/source/texk/web2c/luatexdir/lua/luatex-core.lua b/source/texk/web2c/luatexdir/lua/luatex-core.lua
index 51cfa518d..730f0c812 100644
--- a/source/texk/web2c/luatexdir/lua/luatex-core.lua
+++ b/source/texk/web2c/luatexdir/lua/luatex-core.lua
@@ -212,6 +212,8 @@ if saferoption == 1 or shellescape ~= 1 then
     end
 
     ffi = nil
+    package.loaded.ffi = nil
+    package.preload.ffi = error
 
 end
 
-- 
2.33.1



More information about the luatex mailing list.