[latex3-commits] [latex3/l3sys-query] main: Check and respect openin_any for --all option (fd4cb0b)

github at latex-project.org github at latex-project.org
Wed Mar 6 07:34:11 CET 2024


Repository : https://github.com/latex3/l3sys-query
On branch  : main
Link       : https://github.com/latex3/l3sys-query/commit/fd4cb0b91dec13f22dfa567ebd8bffcda0b5bc4b

>---------------------------------------------------------------

commit fd4cb0b91dec13f22dfa567ebd8bffcda0b5bc4b
Author: Joseph Wright <joseph at texdev.net>
Date:   Wed Mar 6 06:34:11 2024 +0000

    Check and respect openin_any for --all option


>---------------------------------------------------------------

fd4cb0b91dec13f22dfa567ebd8bffcda0b5bc4b
 l3sys-query.lua | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/l3sys-query.lua b/l3sys-query.lua
index c243ed6..909bb07 100755
--- a/l3sys-query.lua
+++ b/l3sys-query.lua
@@ -104,6 +104,10 @@ local option_list =
 local io     = io
 local stderr = io.stderr
 
+local kpse             = kpse
+local set_program_name = kpse.set_program_name
+local var_value        = kpse.var_value
+
 local lfs        = lfs
 local attributes = lfs.attributes
 local currentdir = lfs.currentdir
@@ -125,6 +129,17 @@ local concat = table.concat
 local insert = table.insert
 local sort   = table.sort
 
+--
+-- Read security settings
+--
+
+set_program_name("kpsewhich")
+local is_paranoid = false
+local open_mode = var_value("openin_any")
+if open_mode and open_mode ~= "a" then
+  is_paranoid = true
+end
+
 --
 -- Support functions and data
 --
@@ -451,7 +466,7 @@ function cmd_impl.ls(spec)
 
   -- Build a table of entries, excluding "." and "..", and return as a string
   -- with one entry per line.
-  local is_all = options.all
+  local is_all = options.all and not is_paranoid
   local opt = options.type
   local is_rec = options.recursive
   local function browse(path)





More information about the latex3-commits mailing list.