struct edit_map_s {
fr_edit_list_t *el; //!< edit list
+ TALLOC_CTX *ctx;
edit_map_t *parent;
edit_map_t *child;
* parent VP. Because we're going to be moving them to the parent VP at some
* point. The ones which aren't moved will get deleted in this function.
*/
- token = fr_pair_list_afrom_str(state, da, box->vb_strvalue, box->vb_length, children);
+ token = fr_pair_list_afrom_str(current->ctx, da, box->vb_strvalue, box->vb_length, children);
if (token == T_INVALID) {
RPEDEBUG("Failed parsing string '%pV' as attribute list", box);
return -1;
* Once that's implemented, we also need to update the edit list API to
* allow for "please delete children"?
*/
- vp = tmpl_dcursor_init(&err, state, &cc, &cursor, request, current->lhs.vpt);
+ vp = tmpl_dcursor_init(&err, current->ctx, &cc, &cursor, request, current->lhs.vpt);
if (!vp) break;
/*
child->func = expand_lhs;
if (fr_type_is_leaf(tmpl_attr_tail_da(current->lhs.vpt)->type)) {
+ child->ctx = child;
child->check_lhs = check_lhs_value;
child->expanded_lhs = expanded_lhs_value;
} else {
+ child->ctx = current->lhs.vp ? current->lhs.vp : child;
child->check_lhs = check_lhs_nested;
child->expanded_lhs = expanded_lhs_attribute;
child->temporary_pair_list = true;
* parent list, but fr_edit_list_apply_list_assignment() does that
* anyways.
*/
- MEM(current->lhs.vp = fr_pair_afrom_da(current, tmpl_attr_tail_da(current->lhs.vpt)));
+ MEM(current->lhs.vp = fr_pair_afrom_da(current->ctx, tmpl_attr_tail_da(current->lhs.vpt)));
fr_pair_append(¤t->parent->rhs.pair_list, current->lhs.vp);
current->lhs.vp->op = map->op;
* use the cursor in apply_edits_to_leaf()
*/
fr_strerror_clear();
- vp = tmpl_dcursor_init(&err, state, &cc, &cursor, request, current->lhs.vpt);
+ vp = tmpl_dcursor_init(&err, current->ctx, &cc, &cursor, request, current->lhs.vpt);
tmpl_dcursor_clear(&cc);
if (!vp) {
if (!current->lhs.create) {
*/
MEM(state->el = fr_edit_list_alloc(state, map_list_num_elements(&edit->maps)));
+ current->ctx = state;
current->el = state->el;
current->map_head = &edit->maps;
current->map = map_list_head(current->map_head);