Comparison

util/datamanager.lua @ 11288:5fd1f1b544a0

util.datamanager: Fix not passing variables as format string to logger (thanks semgrep) Passing error messages as format string could lead to errors, although not a problem anymore since util.format sanitizes this.
author Kim Alvefur <zash@zash.se>
date Sat, 16 Jan 2021 15:49:46 +0100
parent 10666:dfc8257d8445
child 11369:87105a9a11df
comparison
equal deleted inserted replaced
11287:b602dd3c4bbc 11288:5fd1f1b544a0
342 typ = type_map[typ or "keyval"]; 342 typ = type_map[typ or "keyval"];
343 local store_dir = format("%s/%s/", data_path, encode(host)); 343 local store_dir = format("%s/%s/", data_path, encode(host));
344 344
345 local mode, err = lfs.attributes(store_dir, "mode"); 345 local mode, err = lfs.attributes(store_dir, "mode");
346 if not mode then 346 if not mode then
347 return function() log("debug", err or (store_dir .. " does not exist")) end 347 return function() log("debug", "Could not iterate over stores in %s: %s", store_dir, err); end
348 end 348 end
349 local next, state = lfs.dir(store_dir); -- luacheck: ignore 431/next 431/state 349 local next, state = lfs.dir(store_dir); -- luacheck: ignore 431/next 431/state
350 return function(state) -- luacheck: ignore 431/state 350 return function(state) -- luacheck: ignore 431/state
351 for node in next, state do 351 for node in next, state do
352 if not node:match"^%." then 352 if not node:match"^%." then