mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-30 21:25:06 +00:00
Don't trim quoted strings
When parsing condition expressions, if the type of an ast node is String (aka quoted string), don't trim whitespace from the value. This ensures that conditions that want to match exact strings e.g. command lines with leading/trailing spaces will work properly. This fixes #253.
This commit is contained in:
parent
38f488bfda
commit
481582ca09
@ -130,7 +130,7 @@ end
|
||||
|
||||
local function terminal (tag)
|
||||
-- Rather than trim the whitespace in this way, it would be nicer to exclude it from the capture...
|
||||
return token(V(tag), tag) / function (tok) return { type = tag, value = trim(tok)} end
|
||||
return token(V(tag), tag) / function (tok) val = tok; if tag ~= "String" then val = trim(tok) end; return { type = tag, value = val} end
|
||||
end
|
||||
|
||||
local function unaryboolop (op, e)
|
||||
|
Loading…
Reference in New Issue
Block a user