Skip to content

Commit

Permalink
use correct API
Browse files Browse the repository at this point in the history
fr_value_box_aprint() does not print quotation characters around
strings, even if escaping rules are passed to it.

Instead, we need to call fr_value_box_aprint_quoted(), which
will do the right thing.
  • Loading branch information
alandekok committed Oct 15, 2023
1 parent ab30112 commit 455f179
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/rlm_cache/serialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ int cache_serialize(TALLOC_CTX *ctx, char **out, rlm_cache_entry_t const *c)
goto error;
}

fr_value_box_aprint(value_pool, &value, tmpl_value(map->rhs), &fr_value_escape_single);
fr_value_box_aprint_quoted(value_pool, &value, tmpl_value(map->rhs), T_DOUBLE_QUOTED_STRING);
if (!value) goto error;

to_store = talloc_asprintf_append_buffer(to_store, "%s %s %s\n", attr,
Expand Down

0 comments on commit 455f179

Please sign in to comment.