On Fri, Jun 17, 2022 at 04:53:41PM -0400, Wietse Venema wrote:
> Viktor Dukhovni:
> > Also, your parsing of the search_keys is hand-rolled, but should be
> > using mystrtok(3) to split the list on commas/whitespace, and
> > split_nameval(3) to split "key = value" pairs on "=".
>
> If the result may contain quoted strings, then we need a smarter
> parser than wnat mystrtok() does now.
If multiple search columns are to be supported, with a mixture of
strings and numeric values, .... Perhaps the search filter should remain
a JSON object:
query_filter = {user:"%s", active:1}
without support for:
search_keys = user:"%s", active:1
there's hardly much value in splitting these, and performing separate
substitutions only add missing "{" and "}" front and back. The real
value is multiple result attributes which are simple names:
result_attribute = foo, bar, ...
The key missing code is correct JSON quoting in expansion "%s".
--
Viktor.