*/
if (check_item->op == T_OP_CMP_FALSE) return -1;
- /*
- * We've got to xlat the string before doing
- * the comparison.
- */
- xlat_eval_pair(request, check_item);
-
/*
* OK it is present now compare them.
*/
* only fr_pair_list_copy() those attributes that we're really going to
* use.
*/
-void radius_pairmove(request_t *request, fr_pair_list_t *to, fr_pair_list_t *from, bool do_xlat)
+void radius_pairmove(request_t *request, fr_pair_list_t *to, fr_pair_list_t *from)
{
int i, j, count, to_count, tailto;
fr_pair_t *from_vp, *next_from, *to_vp, *next_to = NULL;
RDEBUG4("::: Examining %s", from_vp->da->name);
- if (do_xlat) xlat_eval_pair(request, from_vp);
-
/*
* Attribute should be appended, OR the "to" list
* is empty, and we're supposed to replace or
extern "C" {
#endif
-void radius_pairmove(request_t *request, fr_pair_list_t *to, fr_pair_list_t *from, bool do_xlat) CC_HINT(nonnull);
+void radius_pairmove(request_t *request, fr_pair_list_t *to, fr_pair_list_t *from) CC_HINT(nonnull);
#ifdef __cplusplus
}
int xlat_flatten_compiled_argv(TALLOC_CTX *ctx, xlat_exp_t const ***argv, xlat_exp_t const *xlat);
-int xlat_eval_pair(request_t *request, fr_pair_t *vp);
-
bool xlat_async_required(xlat_exp_t const *xlat);
ssize_t xlat_tokenize_ephemeral(TALLOC_CTX *ctx, xlat_exp_t **head,
return count;
}
-/** Expands an attribute marked with fr_pair_mark_xlat
- *
- * Writes the new value to the vp.
- *
- * @param request Current request.
- * @param vp to expand.
- * @return On failure pair will still no longer be marked for xlat expansion.
- * - 0 if successful.
- * - -1 On xlat failure.
- * - -2 On parse failure.
- */
-int xlat_eval_pair(request_t *request, fr_pair_t *vp)
-{
- ssize_t slen;
-
- char *expanded = NULL;
- if (vp->type != VT_XLAT) return 0;
-
- vp->type = VT_DATA;
-
- slen = xlat_aeval(request, &expanded, request, vp->xlat, NULL, NULL);
- talloc_const_free(vp->xlat);
- vp->xlat = NULL;
- if (slen < 0) {
- return -1;
- }
-
- /*
- * Parse the string into a new value.
- *
- * If the fr_pair_t is being used in a regular expression
- * then we just want to copy the new value in unmolested.
- */
- if ((vp->op == T_OP_REG_EQ) || (vp->op == T_OP_REG_NE)) {
- fr_pair_value_bstrdup_buffer(vp, expanded, vp->vp_tainted);
- talloc_free(expanded);
- return 0;
- }
-
- if (fr_pair_value_from_str(vp, expanded, strlen(expanded), &fr_value_unescape_double, true) < 0){
- talloc_free(expanded);
- return -2;
- }
-
- talloc_free(expanded);
-
- return 0;
-}
-
/** Walk over all xlat nodes (depth first) in a xlat expansion, calling a callback
*
* @param[in] exp to evaluate.
}
}
- radius_pairmove(request, &request->reply_pairs, &tmp_list, true);
+ radius_pairmove(request, &request->reply_pairs, &tmp_list);
}
}
fr_pair_append(&tmp_list, vp);
}
- radius_pairmove(request, vps, &tmp_list, false);
+ radius_pairmove(request, vps, &tmp_list);
}
static inline int mruby_set_vps(request_t *request, mrb_state *mrb, mrb_value mruby_request,
fr_pair_append(&tmp_list, vp);
}
- radius_pairmove(request, vps, &tmp_list, false);
+ radius_pairmove(request, vps, &tmp_list);
}
fr_pair_list_t tmp_list;
fr_pair_list_init(&tmp_list);
fr_pair_append(&tmp_list, vp);
- radius_pairmove(current, vps, &tmp_list, false);
+ radius_pairmove(current, vps, &tmp_list);
/*
* If we call json_object_array_get_idx on something that's not an array
* the behaviour appears to be to occasionally segfault.
RDEBUG2("&%pP", vp);
}
REXDENT();
- radius_pairmove(request, &request->control_pairs, &check_tmp, true);
+ radius_pairmove(request, &request->control_pairs, &check_tmp);
fr_pair_list_free(&check_tmp);
}
log_request_pair_list(L_DBG_LVL_2, request, NULL, &reply_tmp, NULL);
- radius_pairmove(request, &request->reply_pairs, &reply_tmp, true);
+ radius_pairmove(request, &request->reply_pairs, &reply_tmp);
fr_pair_list_free(&reply_tmp);
/*
* If there's no reply query configured, then we assume
RDEBUG2("&%pP", vp);
}
REXDENT();
- radius_pairmove(request, &request->control_pairs, &check_tmp, true);
+ radius_pairmove(request, &request->control_pairs, &check_tmp);
rcode = RLM_MODULE_OK;
fr_pair_list_free(&check_tmp);
log_request_pair_list(L_DBG_LVL_2, request, NULL, &reply_tmp, NULL);
- radius_pairmove(request, &request->reply_pairs, &reply_tmp, true);
+ radius_pairmove(request, &request->reply_pairs, &reply_tmp);
rcode = RLM_MODULE_OK;
fr_pair_list_free(&reply_tmp);