Properly note lists in other lists as used

If a list:

- list: foo
  items: [a, b, c]

Was referenced in another list:

- list: bar
  items: [foo, d, e, f]

The first list would not be marked as used, when it should.

This avoids mistaken messages like "list xxx not refered to by any rule/macro/list"

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
Mark Stemm 2020-10-14 19:13:15 -07:00 committed by poiana
parent 64a231b962
commit 91bfa379ce

View File

@ -861,6 +861,7 @@ function load_rules(sinsp_lua_parser,
if (state.lists[item] == nil) then
items[#items+1] = quote_item(item)
else
state.lists[item].used = true
for i, exp_item in ipairs(state.lists[item].items) do
items[#items+1] = exp_item
end