Skip to content

Commit

Permalink
Check and respect openin_any for --all option
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwright committed Mar 6, 2024
1 parent f40c62a commit fd4cb0b
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion l3sys-query.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
--
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit fd4cb0b

Please sign in to comment.