VALUE_PAIR *check, VALUE_PAIR **rep_list);
vp_tmpl_t *xlat_to_tmpl_attr(TALLOC_CTX *ctx, xlat_exp_t *xlat);
xlat_exp_t *xlat_from_tmpl_attr(TALLOC_CTX *ctx, vp_tmpl_t *vpt);
-int radius_xlat_do(REQUEST *request, VALUE_PAIR *vp);
+int xlat_eval_do(REQUEST *request, VALUE_PAIR *vp);
int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp);
int radius_callback_compare(REQUEST *request, VALUE_PAIR *req,
VALUE_PAIR *check, VALUE_PAIR *check_pairs,
*/
typedef int (*xlat_instantiate_t)(void *xlat_inst, void *mod_inst, char const *fmt);
-ssize_t radius_xlat(char *out, size_t outlen, REQUEST *request, char const *fmt, xlat_escape_t escape,
+ssize_t xlat_eval(char *out, size_t outlen, REQUEST *request, char const *fmt, xlat_escape_t escape,
void const *escape_ctx)
CC_HINT(nonnull (1 ,3 ,4));
-ssize_t radius_xlat_struct(char *out, size_t outlen, REQUEST *request, xlat_exp_t const *xlat,
+ssize_t xlat_eval_compiled(char *out, size_t outlen, REQUEST *request, xlat_exp_t const *xlat,
xlat_escape_t escape, void const *escape_ctx)
CC_HINT(nonnull (1 ,3 ,4));
-ssize_t radius_axlat(TALLOC_CTX *ctx, char **out, REQUEST *request,
+ssize_t xlat_aeval(TALLOC_CTX *ctx, char **out, REQUEST *request,
char const *fmt, xlat_escape_t escape, void const *escape_ctx)
CC_HINT(nonnull (2, 3, 4));
-ssize_t radius_axlat_struct(TALLOC_CTX *ctx, char **out, REQUEST *request,
+ssize_t xlat_aeval_compiled(TALLOC_CTX *ctx, char **out, REQUEST *request,
xlat_exp_t const *xlat, xlat_escape_t escape, void const *escape_ctx)
CC_HINT(nonnull (2, 3, 4));
if (extra_msg) {
extra[0] = ' ';
p = extra + 1;
- if (radius_xlat(p, sizeof(extra) - 1, request, extra_msg, NULL, NULL) < 0) {
+ if (xlat_eval(p, sizeof(extra) - 1, request, extra_msg, NULL, NULL) < 0) {
return -1;
}
} else {
RDEBUG4("::: Examining %s", from_list[i]->da->name);
- if (do_xlat) radius_xlat_do(request, from_list[i]);
+ if (do_xlat) xlat_eval_do(request, from_list[i]);
/*
* Attribute should be appended, OR the "to" list
/*
* Prevent infinitely recursive calls if
- * radius_axlat attempts to write to the request log.
+ * xlat_aeval attempts to write to the request log.
*/
request->log.func = NULL;
* This is SLOW! Doing it for every log message
* in every request is NOT recommended!
*/
- if (radius_axlat(request, &exp, request, filename, rad_filename_escape, NULL) < 0) return;
+ if (xlat_aeval(request, &exp, request, filename, rad_filename_escape, NULL) < 0) return;
/*
* Restore the original logging function
/*
* Expand it safely.
*/
- if (radius_xlat(buffer, sizeof(buffer), request, fmt, config_escape_func, NULL) < 0) return 0;
+ if (xlat_eval(buffer, sizeof(buffer), request, fmt, config_escape_func, NULL) < 0) return 0;
ci = cf_reference_item(request->root->config,
request->root->config, buffer);
if (!new) return -1;
/*
- * We do the debug printing because radius_axlat_struct
+ * We do the debug printing because xlat_aeval_compiled
* doesn't have access to the original string. It's been
* mangled during the parsing to xlat_exp_t
*/
RINDENT();
str = NULL;
- slen = radius_axlat_struct(request, &str, request, map->rhs->tmpl_xlat, NULL, NULL);
+ slen = xlat_aeval_compiled(request, &str, request, map->rhs->tmpl_xlat, NULL, NULL);
REXDENT();
if (slen < 0) {
if (!new) return -1;
str = NULL;
- slen = radius_axlat(request, &str, request, map->rhs->name, NULL, NULL);
+ slen = xlat_aeval(request, &str, request, map->rhs->name, NULL, NULL);
if (slen < 0) {
rcode = slen;
goto error;
* We've got to xlat the string before doing
* the comparison.
*/
- radius_xlat_do(request, check_item);
+ xlat_eval_do(request, check_item);
/*
* OK it is present now compare them.
* - -1 On xlat failure.
* - -2 On parse failure.
*/
-int radius_xlat_do(REQUEST *request, VALUE_PAIR *vp)
+int xlat_eval_do(REQUEST *request, VALUE_PAIR *vp)
{
ssize_t slen;
vp->type = VT_DATA;
- slen = radius_axlat(request, &expanded, request, vp->xlat, NULL, NULL);
+ slen = xlat_aeval(request, &expanded, request, vp->xlat, NULL, NULL);
talloc_const_free(vp->xlat);
vp->xlat = NULL;
if (slen < 0) {
vp = pair_make_request("TLS-PSK-Identity", identity, T_OP_SET);
if (!vp) return 0;
- hex_len = radius_xlat(buffer, sizeof(buffer), request, conf->psk_query,
+ hex_len = xlat_eval(buffer, sizeof(buffer), request, conf->psk_query,
NULL, NULL);
if (!hex_len) {
RWDEBUG("PSK expansion returned an empty string.");
if (my_ok && conf->check_cert_cn) {
char cn_str[1024];
- if (radius_xlat(cn_str, sizeof(cn_str), request, conf->check_cert_cn, NULL, NULL) < 0) {
+ if (xlat_eval(cn_str, sizeof(cn_str), request, conf->check_cert_cn, NULL, NULL) < 0) {
/* if this fails, fail the verification */
my_ok = 0;
} else {
return -1;
}
/* Error in expansion, this is distinct from zero length expansion */
- slen = radius_xlat((char *)buff, bufflen, request, vpt->name, escape, escape_ctx);
+ slen = xlat_eval((char *)buff, bufflen, request, vpt->name, escape, escape_ctx);
if (slen < 0) return slen;
/*
return -1;
}
/* Error in expansion, this is distinct from zero length expansion */
- slen = radius_xlat_struct((char *)buff, bufflen, request, vpt->tmpl_xlat, escape, escape_ctx);
+ slen = xlat_eval_compiled((char *)buff, bufflen, request, vpt->tmpl_xlat, escape, escape_ctx);
if (slen < 0) return slen;
RDEBUG2(" --> %s", (char *)buff); /* Print pre-unescaping (so it's escaped) */
RDEBUG4("EXPAND TMPL XLAT");
/* Error in expansion, this is distinct from zero length expansion */
- slen = radius_axlat(tmp_ctx, (char **)&vd.datum.ptr, request, vpt->name, escape, escape_ctx);
+ slen = xlat_aeval(tmp_ctx, (char **)&vd.datum.ptr, request, vpt->name, escape, escape_ctx);
if (slen < 0) goto error;
vd.length = slen;
RDEBUG2("EXPAND %s", vpt->name); /* xlat_struct doesn't do this */
/* Error in expansion, this is distinct from zero length expansion */
- slen = radius_axlat_struct(tmp_ctx, (char **)&vd.datum.ptr, request, vpt->tmpl_xlat, escape, escape_ctx);
+ slen = xlat_aeval_compiled(tmp_ctx, (char **)&vd.datum.ptr, request, vpt->tmpl_xlat, escape, escape_ctx);
if (slen < 0) return slen;
vd.length = slen;
continue;
}
- len = radius_xlat_struct(output, sizeof(output), request, head, NULL, NULL);
+ len = xlat_eval_compiled(output, sizeof(output), request, head, NULL, NULL);
if (len < 0) {
snprintf(output, sizeof(output), "ERROR expanding xlat: %s", fr_strerror());
continue;
char buffer[128];
if (!mx->exec) {
- radius_xlat(buffer, sizeof(buffer), request, mx->xlat_name, NULL, NULL);
+ xlat_eval(buffer, sizeof(buffer), request, mx->xlat_name, NULL, NULL);
} else {
RDEBUG("`%s`", mx->xlat_name);
radius_exec_program(request, NULL, 0, NULL, request, mx->xlat_name, request->packet->vps,
strlcpy(argv_buf, cmd, argv_buflen);
/*
- * Split the string into argv's BEFORE doing radius_xlat...
+ * Split the string into argv's BEFORE doing xlat_eval...
*/
from = cmd;
to = argv_buf;
if (!request) continue;
- sublen = radius_xlat(to, left - 1, request, argv[i], NULL, NULL);
+ sublen = xlat_eval(to, left - 1, request, argv[i], NULL, NULL);
if (sublen <= 0) {
if (can_fail) {
/*
return total;
}
-
/** Replace %whatever in a string.
*
* See 'doc/configuration/variables.rst' for more information.
*
- * @param[in] ctx to allocate expansion buffers in.
- * @param[out] out Where to write pointer to output buffer.
- * @param[in] outlen Size of out.
- * @param[in] request current request.
- * @param[in] node the xlat structure to expand
- * @param[in] escape function to escape final value e.g. SQL quoting.
- * @param[in] escape_ctx pointer to pass to escape function.
+ * @param[in] ctx to allocate expansion buffers in.
+ * @param[out] out Where to write pointer to output buffer.
+ * @param[in] outlen Size of out.
+ * @param[in] request current request.
+ * @param[in] node the xlat structure to expand
+ * @param[in] escape function to escape final value e.g. SQL quoting.
+ * @param[in] escape_ctx pointer to pass to escape function.
* @return length of string written @bug should really have -1 for failure.
*/
-static ssize_t xlat_expand_struct(TALLOC_CTX *ctx, char **out, size_t outlen, REQUEST *request,
+static ssize_t _xlat_eval_compiled(TALLOC_CTX *ctx, char **out, size_t outlen, REQUEST *request,
xlat_exp_t const *node, xlat_escape_t escape, void const *escape_ctx)
{
char *buff;
return len;
}
-static ssize_t xlat_expand(TALLOC_CTX *ctx, char **out, size_t outlen, REQUEST *request, char const *fmt,
+static ssize_t _xlat_eval(TALLOC_CTX *ctx, char **out, size_t outlen, REQUEST *request, char const *fmt,
xlat_escape_t escape, void const *escape_ctx) CC_HINT(nonnull (2, 4, 5));
/** Replace %whatever in a string.
*
* See 'doc/configuration/variables.rst' for more information.
*
- * @param[in] ctx to allocate expansion buffers in.
- * @param[out] out Where to write pointer to output buffer.
- * @param[in] outlen Size of out.
- * @param[in] request current request.
- * @param[in] fmt string to expand.
- * @param[in] escape function to escape final value e.g. SQL quoting.
- * @param[in] escape_ctx pointer to pass to escape function.
+ * @param[in] ctx to allocate expansion buffers in.
+ * @param[out] out Where to write pointer to output buffer.
+ * @param[in] outlen Size of out.
+ * @param[in] request current request.
+ * @param[in] fmt string to expand.
+ * @param[in] escape function to escape final value e.g. SQL quoting.
+ * @param[in] escape_ctx pointer to pass to escape function.
* @return length of string written @bug should really have -1 for failure.
*/
-static ssize_t xlat_expand(TALLOC_CTX *ctx, char **out, size_t outlen, REQUEST *request, char const *fmt,
+static ssize_t _xlat_eval(TALLOC_CTX *ctx, char **out, size_t outlen, REQUEST *request, char const *fmt,
xlat_escape_t escape, void const *escape_ctx)
{
ssize_t len;
return -1;
}
- len = xlat_expand_struct(ctx, out, outlen, request, node, escape, escape_ctx);
+ len = _xlat_eval_compiled(ctx, out, outlen, request, node, escape, escape_ctx);
talloc_free(node);
REXDENT();
return len;
}
-ssize_t radius_xlat(char *out, size_t outlen, REQUEST *request,
- char const *fmt, xlat_escape_t escape, void const *escape_ctx)
+ssize_t xlat_eval(char *out, size_t outlen, REQUEST *request,
+ char const *fmt, xlat_escape_t escape, void const *escape_ctx)
{
- return xlat_expand(request, &out, outlen, request, fmt, escape, escape_ctx);
+ return _xlat_eval(request, &out, outlen, request, fmt, escape, escape_ctx);
}
-ssize_t radius_xlat_struct(char *out, size_t outlen, REQUEST *request,
+ssize_t xlat_eval_compiled(char *out, size_t outlen, REQUEST *request,
xlat_exp_t const *xlat, xlat_escape_t escape, void const *escape_ctx)
{
- return xlat_expand_struct(request, &out, outlen, request, xlat, escape, escape_ctx);
+ return _xlat_eval_compiled(request, &out, outlen, request, xlat, escape, escape_ctx);
}
-ssize_t radius_axlat(TALLOC_CTX *ctx, char **out, REQUEST *request, char const *fmt,
- xlat_escape_t escape, void const *escape_ctx)
+ssize_t xlat_aeval(TALLOC_CTX *ctx, char **out, REQUEST *request, char const *fmt,
+ xlat_escape_t escape, void const *escape_ctx)
{
*out = NULL;
- return xlat_expand(ctx, out, 0, request, fmt, escape, escape_ctx);
+ return _xlat_eval(ctx, out, 0, request, fmt, escape, escape_ctx);
}
-ssize_t radius_axlat_struct(TALLOC_CTX *ctx, char **out, REQUEST *request,
+ssize_t xlat_aeval_compiled(TALLOC_CTX *ctx, char **out, REQUEST *request,
xlat_exp_t const *xlat, xlat_escape_t escape, void const *escape_ctx)
{
*out = NULL;
- return xlat_expand_struct(ctx, out, 0, request, xlat, escape, escape_ctx);
+ return _xlat_eval_compiled(ctx, out, 0, request, xlat, escape, escape_ctx);
}
* If it's a string, expand it again
*/
if (vp->da->type == PW_TYPE_STRING) {
- slen = radius_xlat(*out, outlen, request, vp->vp_strvalue, NULL, NULL);
+ slen = xlat_eval(*out, outlen, request, vp->vp_strvalue, NULL, NULL);
if (slen <= 0) return slen;
/*
* If it's not a string, treat it as a literal
if (extra_msg) {
extra[0] = ' ';
p = extra + 1;
- if (radius_xlat(p, sizeof(extra) - 1, request, extra_msg, NULL, NULL) < 0) {
+ if (xlat_eval(p, sizeof(extra) - 1, request, extra_msg, NULL, NULL) < 0) {
return;
}
} else {
if (!vp) {
goto error;
}
- radius_xlat_do(request, vp);
+ xlat_eval_do(request, vp);
fr_cursor_append(&out, vp);
}
}
VALUE_PAIR *vp;
char timestamp[256];
- if (radius_xlat(timestamp, sizeof(timestamp), request, inst->header, NULL, NULL) < 0) {
+ if (xlat_eval(timestamp, sizeof(timestamp), request, inst->header, NULL, NULL) < 0) {
return -1;
}
/*
* Generate the path for the detail file. Use the same
* format, but truncate at the last /. Then feed it
- * through radius_xlat() to expand the variables.
+ * through xlat_eval() to expand the variables.
*/
- if (radius_xlat(buffer, sizeof(buffer), request, inst->filename, inst->escape_func, NULL) < 0) {
+ if (xlat_eval(buffer, sizeof(buffer), request, inst->filename, inst->escape_func, NULL) < 0) {
return RLM_MODULE_FAIL;
}
eap_round_t *eap_round = eap_session->this_round;
rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) instance;
- if (radius_xlat(challenge_str, sizeof(challenge_str), eap_session->request, inst->challenge, NULL, NULL) < 0) {
+ if (xlat_eval(challenge_str, sizeof(challenge_str), eap_session->request, inst->challenge, NULL, NULL) < 0) {
return RLM_MODULE_FAIL;
}
snprintf(name, sizeof(name), "%%{%s}", check->da->name);
- if (radius_xlat(value, sizeof(value), request, name, NULL, NULL) < 0) {
+ if (xlat_eval(value, sizeof(value), request, name, NULL, NULL) < 0) {
return 0;
}
vp = fr_pair_make(req, NULL, check->da->name, value, check->op);
} else {
int len;
- len = radius_xlat(buffer, sizeof(buffer), request, inst->key, NULL, NULL);
+ len = xlat_eval(buffer, sizeof(buffer), request, inst->key, NULL, NULL);
if (len < 0) {
return RLM_MODULE_FAIL;
}
for (vp = fr_cursor_init(&cursor, &check_tmp);
vp;
vp = fr_cursor_next(&cursor)) {
- if (radius_xlat_do(request, vp) < 0) {
+ if (xlat_eval_do(request, vp) < 0) {
RWARN("Failed parsing expanded value for check item, skipping entry: %s", fr_strerror());
fr_pair_list_free(&check_tmp);
continue;
in = buffer;
}
- len = radius_xlat(out, outlen, request, in, rlm_ldap_escape_func, NULL);
+ len = xlat_eval(out, outlen, request, in, rlm_ldap_escape_func, NULL);
if (len < 0) {
REDEBUG("Failed creating filter");
*p++ = '.';
}
- if (radius_xlat(p, (sizeof(path) - (p - path)) - 1, request, section->reference, NULL, NULL) < 0) {
+ if (xlat_eval(p, (sizeof(path) - (p - path)) - 1, request, section->reference, NULL, NULL) < 0) {
goto error;
}
} else if (do_xlat) {
char *exp = NULL;
- if (radius_axlat(request, &exp, request, value, NULL, NULL) <= 0) {
+ if (xlat_aeval(request, &exp, request, value, NULL, NULL) <= 0) {
RDEBUG("Skipping attribute \"%s\"", attr);
talloc_free(exp);
{
char path[2048];
- if (radius_xlat(path, sizeof(path), request, inst->file.name, inst->file.escape_func, NULL) < 0) {
+ if (xlat_eval(path, sizeof(path), request, inst->file.name, inst->file.escape_func, NULL) < 0) {
return RLM_MODULE_FAIL;
}
*/
if (inst->ntlm_cpw_username) {
- len = radius_xlat(buf, sizeof(buf) - 2, request, inst->ntlm_cpw_username, NULL, NULL);
+ len = xlat_eval(buf, sizeof(buf) - 2, request, inst->ntlm_cpw_username, NULL, NULL);
if (len < 0) {
goto ntlm_auth_err;
}
}
if (inst->ntlm_cpw_domain) {
- len = radius_xlat(buf, sizeof(buf) - 2, request, inst->ntlm_cpw_domain, NULL, NULL);
+ len = xlat_eval(buf, sizeof(buf) - 2, request, inst->ntlm_cpw_domain, NULL, NULL);
if (len < 0) {
goto ntlm_auth_err;
}
*x = '\0';
/* Perform the xlat */
- result_len = radius_xlat(result, sizeof(result), request, inst->local_cpw, NULL, NULL);
+ result_len = xlat_eval(result, sizeof(result), request, inst->local_cpw, NULL, NULL);
if (result_len < 0){
return -1;
} else if (result_len == 0) {
* what the challenge value is.
*/
- len = radius_axlat(request, &expanded, request, inst->chal_prompt, NULL, NULL);
+ len = xlat_aeval(request, &expanded, request, inst->chal_prompt, NULL, NULL);
if (len < 0) {
return RLM_MODULE_FAIL;
}
return RLM_MODULE_INVALID;
}
- len = radius_xlat(charbuf, sizeof(charbuf), request, "%{mschap:LM-Hash %{User-Password}}", NULL, NULL);
+ len = xlat_eval(charbuf, sizeof(charbuf), request, "%{mschap:LM-Hash %{User-Password}}", NULL, NULL);
if (len < 0){
return RLM_MODULE_FAIL;
}
}
/*
- * This is a wraper for radius_axlat
+ * This is a wraper for xlat_aeval
* Now users are able to get data that is accessible only via xlat
* e.g. %{client:...}
* Call syntax is radiusd::xlat(string), string will be handled the
in_str = (char *) SvPV(ST(0), PL_na);
- slen = radius_axlat(request, &expanded, request, in_str, NULL, NULL);
+ slen = xlat_aeval(request, &expanded, request, in_str, NULL, NULL);
if (slen < 0) {
REDEBUG("Error parsing xlat '%s'", in_str);
XSRETURN_UNDEF;
* Get the utmp filename, via xlat.
*/
filename = NULL;
- if (radius_axlat(request, &filename, request, inst->filename, NULL, NULL) < 0) {
+ if (xlat_aeval(request, &filename, request, inst->filename, NULL, NULL) < 0) {
return RLM_MODULE_FAIL;
}
/*
* Translate the User-Name attribute, or whatever else they told us to use.
*/
- if (radius_axlat(request, &expanded, request, inst->username, NULL, NULL) < 0) {
+ if (xlat_aeval(request, &expanded, request, inst->username, NULL, NULL) < 0) {
rcode = RLM_MODULE_FAIL;
goto finish;
/*
* Get the filename, via xlat.
*/
- if (radius_axlat(request, &expanded, request, inst->filename, NULL, NULL) < 0) {
+ if (xlat_aeval(request, &expanded, request, inst->filename, NULL, NULL) < 0) {
return RLM_MODULE_FAIL;
}
TALLOC_FREE(expanded);
- len = radius_axlat(request, &expanded, request, inst->username, NULL, NULL);
+ len = xlat_aeval(request, &expanded, request, inst->username, NULL, NULL);
if (len < 0) {
rcode = RLM_MODULE_FAIL;
RDEBUG2("Performing xlat expansion of response value");
- if (radius_axlat(request, &expanded, request, value, NULL, NULL) < 0) {
+ if (xlat_aeval(request, &expanded, request, value, NULL, NULL) < 0) {
goto skip;
}
type = PW_TYPE_STRING;
value = json_object_get_string(leaf);
if (flags->do_xlat) {
- if (radius_axlat(request, &expanded, request, value, NULL, NULL) < 0) return NULL;
+ if (xlat_aeval(request, &expanded, request, value, NULL, NULL) < 0) return NULL;
src.datum.strvalue = expanded;
src.length = talloc_array_length(src.datum.strvalue) - 1;
} else {
if (username) {
SET_OPTION(CURLOPT_USERNAME, username);
} else if (section->username) {
- if (radius_xlat(buffer, sizeof(buffer), request, section->username, NULL, NULL) < 0) {
+ if (xlat_eval(buffer, sizeof(buffer), request, section->username, NULL, NULL) < 0) {
option = STRINGIFY(CURLOPT_USERNAME);
goto error;
}
if (password) {
SET_OPTION(CURLOPT_PASSWORD, password);
} else if (section->password) {
- if (radius_xlat(buffer, sizeof(buffer), request, section->password, NULL, NULL) < 0) {
+ if (xlat_eval(buffer, sizeof(buffer), request, section->password, NULL, NULL) < 0) {
option = STRINGIFY(CURLOPT_PASSWORD);
goto error;
}
if (username) {
SET_OPTION(CURLOPT_TLSAUTH_USERNAME, username);
} else if (section->username) {
- if (radius_xlat(buffer, sizeof(buffer), request, section->username, NULL, NULL) < 0) {
+ if (xlat_eval(buffer, sizeof(buffer), request, section->username, NULL, NULL) < 0) {
option = STRINGIFY(CURLOPT_TLSAUTH_USERNAME);
goto error;
}
if (password) {
SET_OPTION(CURLOPT_TLSAUTH_PASSWORD, password);
} else if (section->password) {
- if (radius_xlat(buffer, sizeof(buffer), request, section->password, NULL, NULL) < 0) {
+ if (xlat_eval(buffer, sizeof(buffer), request, section->password, NULL, NULL) < 0) {
option = STRINGIFY(CURLOPT_TLSAUTH_PASSWORD);
goto error;
}
rest_custom_data_t *data;
char *expanded = NULL;
- if (radius_axlat(request, &expanded, request, section->data, NULL, NULL) < 0) return -1;
+ if (xlat_aeval(request, &expanded, request, section->data, NULL, NULL) < 0) return -1;
data = talloc_zero(request, rest_custom_data_t);
data->p = expanded;
path = (uri + len);
- len = radius_axlat(request, out, request, scheme, NULL, NULL);
+ len = xlat_aeval(request, out, request, scheme, NULL, NULL);
talloc_free(scheme);
if (len < 0) {
TALLOC_FREE(*out);
return 0;
}
- len = radius_axlat(request, &path_exp, request, path, rest_uri_escape, NULL);
+ len = xlat_aeval(request, &path_exp, request, path, rest_uri_escape, NULL);
if (len < 0) {
TALLOC_FREE(*out);
return 0;
}
- len = radius_axlat(request, &expanded, request, sqluser, NULL, NULL);
+ len = xlat_aeval(request, &expanded, request, sqluser, NULL, NULL);
if (len < 0) {
return -1;
}
entry = *phead = NULL;
if (!inst->config->groupmemb_query || !*inst->config->groupmemb_query) return 0;
- if (radius_axlat(request, &expanded, request, inst->config->groupmemb_query,
+ if (xlat_aeval(request, &expanded, request, inst->config->groupmemb_query,
inst->sql_escape_func, *handle) < 0) return -1;
ret = rlm_sql_select_query(inst, request, handle, expanded);
/*
* Expand the group query
*/
- if (radius_axlat(request, &expanded, request, inst->config->authorize_group_check_query,
+ if (xlat_aeval(request, &expanded, request, inst->config->authorize_group_check_query,
inst->sql_escape_func, *handle) < 0) {
REDEBUG("Error generating query");
rcode = RLM_MODULE_FAIL;
/*
* Now get the reply pairs since the paircompare matched
*/
- if (radius_axlat(request, &expanded, request, inst->config->authorize_group_reply_query,
+ if (xlat_aeval(request, &expanded, request, inst->config->authorize_group_reply_query,
inst->sql_escape_func, *handle) < 0) {
REDEBUG("Error generating query");
rcode = RLM_MODULE_FAIL;
vp_cursor_t cursor;
VALUE_PAIR *vp;
- if (radius_axlat(request, &expanded, request, inst->config->authorize_check_query,
+ if (xlat_aeval(request, &expanded, request, inst->config->authorize_check_query,
inst->sql_escape_func, handle) < 0) {
REDEBUG("Failed generating query");
rcode = RLM_MODULE_FAIL;
/*
* Now get the reply pairs since the paircompare matched
*/
- if (radius_axlat(request, &expanded, request, inst->config->authorize_reply_query,
+ if (xlat_aeval(request, &expanded, request, inst->config->authorize_reply_query,
inst->sql_escape_func, handle) < 0) {
REDEBUG("Error generating query");
rcode = RLM_MODULE_FAIL;
*p++ = '.';
}
- if (radius_xlat(p, sizeof(path) - (p - path), request, section->reference, NULL, NULL) < 0) {
+ if (xlat_eval(p, sizeof(path) - (p - path), request, section->reference, NULL, NULL) < 0) {
rcode = RLM_MODULE_FAIL;
goto finish;
goto finish;
}
- if (radius_axlat(request, &expanded, request, value, inst->sql_escape_func, handle) < 0) {
+ if (xlat_aeval(request, &expanded, request, value, inst->sql_escape_func, handle) < 0) {
rcode = RLM_MODULE_FAIL;
goto finish;
return RLM_MODULE_FAIL;
}
- if (radius_axlat(request, &expanded, request, inst->config->simul_count_query,
+ if (xlat_aeval(request, &expanded, request, inst->config->simul_count_query,
inst->sql_escape_func, handle) < 0) {
fr_connection_release(inst->pool, request, handle);
sql_unset_user(inst, request);
goto finish;
}
- if (radius_axlat(request, &expanded, request, inst->config->simul_verify_query,
+ if (xlat_aeval(request, &expanded, request, inst->config->simul_verify_query,
inst->sql_escape_func, handle) < 0) {
rcode = RLM_MODULE_FAIL;
return;
}
- if (radius_axlat(request, &expanded, request, filename, NULL, NULL) < 0) {
+ if (xlat_aeval(request, &expanded, request, filename, NULL, NULL) < 0) {
return;
}
}
/* Finally, xlat resulting SQL query */
- if (radius_axlat(request, &expanded, request, query, NULL, NULL) < 0) {
+ if (xlat_aeval(request, &expanded, request, query, NULL, NULL) < 0) {
return RLM_MODULE_FAIL;
}
}
/* Finally, xlat resulting SQL query */
- if (radius_axlat(request, &expanded, request, query, NULL, NULL) < 0) {
+ if (xlat_aeval(request, &expanded, request, query, NULL, NULL) < 0) {
return RLM_MODULE_FAIL;
}
talloc_free(expanded);
*/
sqlippool_expand(query, sizeof(query), fmt, data, param, param_len);
- if (radius_axlat(request, &expanded, request, query, data->sql_inst->sql_escape_func, *handle) < 0) return -1;
+ if (xlat_aeval(request, &expanded, request, query, data->sql_inst->sql_escape_func, *handle) < 0) return -1;
ret = data->sql_inst->sql_query(data->sql_inst, request, handle, expanded);
if (ret < 0){
/*
* Do an xlat on the provided string
*/
- if (radius_axlat(request, &expanded, request, query, data->sql_inst->sql_escape_func, handle) < 0) {
+ if (xlat_aeval(request, &expanded, request, query, data->sql_inst->sql_escape_func, handle) < 0) {
return 0;
}
retval = data->sql_inst->sql_select_query(data->sql_inst, request, &handle, expanded);
if (!str || !*str) return rcode;
- if (radius_axlat(request, &expanded, request, str, NULL, NULL) < 0) {
+ if (xlat_aeval(request, &expanded, request, str, NULL, NULL) < 0) {
return rcode;
}