From f4b79296fc390cc0c1ca20b9792cff151616defd Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Wed, 12 Jan 2022 14:22:44 +0000 Subject: [PATCH] fix: improve nested configuration field support This fixes the parser introduced in https://github.com/falcosecurity/falco/pull/1792. Now, nested fields such as `arr[1].subval` are supported, whereas the parser used to recognize the `.` as an unexpected character. Signed-off-by: Jason Dellaluce --- userspace/falco/configuration.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/userspace/falco/configuration.h b/userspace/falco/configuration.h index 0d682df1..2f93264d 100644 --- a/userspace/falco/configuration.h +++ b/userspace/falco/configuration.h @@ -168,6 +168,10 @@ private: int nodeIdx = std::stoi(key.substr(i + 1, close_param_idx - i - 1)); ret.reset(ret[nodeIdx]); i = close_param_idx; + if (i < key.size() - 1 && key[i + 1] == '.') + { + i++; + } } } }