]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Rename xlat public functions s/radius_xlat/xlat_eval/
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 7 Dec 2016 18:04:42 +0000 (13:04 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 7 Dec 2016 18:04:42 +0000 (13:04 -0500)
35 files changed:
src/include/radiusd.h
src/include/xlat.h
src/main/auth.c
src/main/cond_eval.c
src/main/log.c
src/main/mainconfig.c
src/main/map.c
src/main/pair.c
src/main/tls/session.c
src/main/tls/validate.c
src/main/tmpl.c
src/main/unit_test_module.c
src/main/unlang_interpret.c
src/main/util.c
src/main/xlat_eval.c
src/main/xlat_func.c
src/modules/proto_radius/proto_radius_auth.c
src/modules/rlm_attr_filter/rlm_attr_filter.c
src/modules/rlm_detail/rlm_detail.c
src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c
src/modules/rlm_expr/paircmp.c
src/modules/rlm_files/rlm_files.c
src/modules/rlm_ldap/ldap.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_linelog/rlm_linelog.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_otp/rlm_otp.c
src/modules/rlm_pap/rlm_pap.c
src/modules/rlm_perl/rlm_perl.c
src/modules/rlm_radutmp/rlm_radutmp.c
src/modules/rlm_rest/rest.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_sql/sql.c
src/modules/rlm_sqlcounter/rlm_sqlcounter.c
src/modules/rlm_sqlippool/rlm_sqlippool.c

index 4ea1ddabe6d0d26117a9420a5064078b093343aa..d261535ef427cfd81c388ecf46fc8aa1014f13ab 100644 (file)
@@ -547,7 +547,7 @@ int         paircompare(REQUEST *request, VALUE_PAIR *req_list,
                            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,
index b8b7b18ca2d1b1578f2be6a596f61242294fd454..d1bc35091ff3496775766d1836151263f0e1be9b 100644 (file)
@@ -68,19 +68,19 @@ typedef ssize_t (*xlat_func_t)(TALLOC_CTX *ctx, char **out, size_t outlen,
  */
 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));
 
index 725679329cd141e36c66aa347478a63b2d7dbd04..c8c5b805a5f37ad1b604aca797fec4c5097697fe 100644 (file)
@@ -138,7 +138,7 @@ static int rad_authlog(char const *msg, REQUEST *request, int goodpass)
        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 {
index 8d30cf93f5c97dbdf89ac49deb33b47e794e9e26..451230249c2e5a8d7661f718b0f0281ad01d4313 100644 (file)
@@ -890,7 +890,7 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from, bool d
 
                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
index 51a17af4860f5634cf13cdb7ffacdfacf17f470c..95051803c62e027847ac5c2f0cf901c919852106 100644 (file)
@@ -745,7 +745,7 @@ void vradlog_request(log_type_t type, log_lvl_t lvl, REQUEST *request, char cons
 
                /*
                 *      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;
 
@@ -753,7 +753,7 @@ void vradlog_request(log_type_t type, log_lvl_t lvl, REQUEST *request, char cons
                 *      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
index c3eedb9b97cdebafd8201fb996e2327ed2f44827..7922ffd565c450325d2aa55ab46dbb31c207a284 100644 (file)
@@ -356,7 +356,7 @@ static ssize_t xlat_config(UNUSED TALLOC_CTX *ctx, char **out, size_t outlen,
        /*
         *      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);
index 03d4cc2b55fed70a63555fda38b31b3f3863807e..fa227d592b35ebe0a79d4c86060d83b8163b662e 100644 (file)
@@ -815,7 +815,7 @@ int map_to_vp(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, vp_map_t cons
                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
                 */
@@ -823,7 +823,7 @@ int map_to_vp(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, vp_map_t cons
                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) {
@@ -852,7 +852,7 @@ int map_to_vp(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, vp_map_t cons
                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;
index 6af388bf3b0b8e8127133a22892fa5853d787976..154a789e2bff8dc04a432ff045d756eac8f50ba2 100644 (file)
@@ -578,7 +578,7 @@ int paircompare(REQUEST *request, VALUE_PAIR *req_list, VALUE_PAIR *check,
                 *      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.
@@ -652,7 +652,7 @@ int paircompare(REQUEST *request, VALUE_PAIR *req_list, VALUE_PAIR *check,
  *     - -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;
 
@@ -661,7 +661,7 @@ int radius_xlat_do(REQUEST *request, VALUE_PAIR *vp)
 
        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) {
index 2bd8ddfbb75e0dcd49a727edee4a73a605542b25..f07a9e5bf3ea9166ba117eda5bc58f6ca533fe85 100644 (file)
@@ -245,7 +245,7 @@ unsigned int tls_session_psk_server_cb(SSL *ssl, const char *identity,
                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.");
index e5d698eb25939a249df67b50bd90adf85e7fc71c..95593cebade1c5980ad729e7fbd383f4f8b54d55 100644 (file)
@@ -240,7 +240,7 @@ int tls_validate_cert_cb(int ok, X509_STORE_CTX *x509_ctx)
        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 {
index 931a2bccc88b0281fa054cf41acb21186a8bcab7..5183243c80841a6dff330322cacddfd50ae6d739 100644 (file)
@@ -1549,7 +1549,7 @@ ssize_t _tmpl_to_type(void *out,
                        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;
 
                /*
@@ -1570,7 +1570,7 @@ ssize_t _tmpl_to_type(void *out,
                        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) */
@@ -1843,7 +1843,7 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out,
                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;
 
@@ -1870,7 +1870,7 @@ ssize_t _tmpl_to_atype(TALLOC_CTX *ctx, void *out,
                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;
index 11724d1977f84f4ac436deff249bd9ee4f1aaeb2..df98eff4e5f7f019accbc134c380039b278aa28b 100644 (file)
@@ -628,7 +628,7 @@ static bool do_xlats(char const *filename, FILE *fp)
                                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;
index 7d46486db40ddcf79c229f16034c2af4b1f30a4c..7f2fd51bc0924c64897f113642b9cc2f00556783 100644 (file)
@@ -474,7 +474,7 @@ static unlang_action_t unlang_xlat_inline(REQUEST *request, unlang_stack_t *stac
        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,
index cef5f854ef20556c8256912d79a35179c101f4c5..b639122c792255716b47dd6fa5bebe9ab0845ea6 100644 (file)
@@ -672,7 +672,7 @@ int rad_expand_xlat(REQUEST *request, char const *cmd,
        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;
@@ -764,7 +764,7 @@ int rad_expand_xlat(REQUEST *request, char const *cmd,
 
                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) {
                                /*
index f2656f2222432c78dea2cbdcc95fd0b10e12cdb1..69bd441c117ca798c33edcf17b68e0adfe794127 100644 (file)
@@ -714,21 +714,20 @@ static size_t xlat_process(TALLOC_CTX *ctx, char **out, REQUEST *request, xlat_e
        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;
@@ -762,23 +761,23 @@ static ssize_t xlat_expand_struct(TALLOC_CTX *ctx, char **out, size_t outlen, RE
        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;
@@ -807,7 +806,7 @@ static ssize_t xlat_expand(TALLOC_CTX *ctx, char **out, size_t outlen, REQUEST *
                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();
@@ -816,28 +815,28 @@ static ssize_t xlat_expand(TALLOC_CTX *ctx, char **out, size_t outlen, REQUEST *
        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);
 }
index 6f670e183f9b2ee970f19ca71e855ea382ea6620..e43f96b334c3f43f01c2cb38ed9e117a2fac04c1 100644 (file)
@@ -591,7 +591,7 @@ static ssize_t xlat_xlat(TALLOC_CTX *ctx, char **out, size_t outlen,
         *      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
index 7551a06af0ec3086b153826b961e7f2e33cad28c..bcaf90a116335edf4dbb302b5ddcb8ad50e2f111 100644 (file)
@@ -102,7 +102,7 @@ static void auth_message(char const *msg, REQUEST *request, int goodpass)
        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 {
index 4efbbf207b02f4df787c24592dae7f9ca82584b9..669bbfbcaa7736feb9d1930226b29cafe48918bc 100644 (file)
@@ -219,7 +219,7 @@ static rlm_rcode_t CC_HINT(nonnull(1,2)) attr_filter_common(void const *instance
                                if (!vp) {
                                        goto error;
                                }
-                               radius_xlat_do(request, vp);
+                               xlat_eval_do(request, vp);
                                fr_cursor_append(&out, vp);
                        }
                }
index 5db36618f8d3669025caae8958a00aeb47d47328..7a91fe5c0fd2b1cee3e11e739280fb9ed9095b69 100644 (file)
@@ -223,7 +223,7 @@ static int detail_write(FILE *out, rlm_detail_t const *inst, REQUEST *request, R
        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;
        }
 
@@ -358,9 +358,9 @@ static rlm_rcode_t CC_HINT(nonnull) detail_do(void const *instance, REQUEST *req
        /*
         *      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;
        }
 
index faba7c088ad9957aab68665d649c94c2f3314d70..e3fe3de33a24406cc4a7bf63c23689eb1f4bd0ff 100644 (file)
@@ -159,7 +159,7 @@ static rlm_rcode_t mod_session_init(void *instance, eap_session_t *eap_session)
        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;
        }
 
index fded43ddbdc059f6448ca47e0720a6118885055e..0caae008c26d3c6f6ba28a555a72bb809096b2e9 100644 (file)
@@ -187,7 +187,7 @@ static int genericcmp(UNUSED void *instance,
 
                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);
index 1dffe28189ea43b891fc65ed71ccff29b44ca2c8..84193c77151f3628b432c39e32c5417b2ea16e90 100644 (file)
@@ -361,7 +361,7 @@ static rlm_rcode_t file_common(rlm_files_t const *inst, REQUEST *request, char c
        } 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;
                }
@@ -413,7 +413,7 @@ static rlm_rcode_t file_common(rlm_files_t const *inst, REQUEST *request, char c
                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;
index 7384848f7219597ca73cc52713e52ce070911c0e..22a92208b409857ffeed4ecdf530276cffac49b1 100644 (file)
@@ -524,7 +524,7 @@ ssize_t rlm_ldap_xlat_filter(REQUEST *request, char const **sub, size_t sublen,
                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");
 
index a9fbc2f1f0cc2771110f01f7129bd5714d12bd3b..8a87c843f92c1220447774ae6f7f7b295eefaf5a 100644 (file)
@@ -1167,7 +1167,7 @@ static rlm_rcode_t user_modify(rlm_ldap_t const *inst, REQUEST *request, ldap_ac
                *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;
        }
 
@@ -1241,7 +1241,7 @@ static rlm_rcode_t user_modify(rlm_ldap_t const *inst, REQUEST *request, ldap_ac
                } 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);
index 4c9c8b466bce6048e63940cad2253050e23e6cdc..0c994c4dae0103fef4f565db9d375606e24c1d5a 100644 (file)
@@ -651,7 +651,7 @@ build_vector:
        {
                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;
                }
 
index 7684daf336e9a6625339834aa78ee6cc6cde5e55..30678c49e1f26ff5898cb8b95822357f1c177d0a 100644 (file)
@@ -801,7 +801,7 @@ static int CC_HINT(nonnull (1, 2, 4, 5)) do_mschap_cpw(rlm_mschap_t const *inst,
                 */
 
                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;
                        }
@@ -818,7 +818,7 @@ static int CC_HINT(nonnull (1, 2, 4, 5)) do_mschap_cpw(rlm_mschap_t const *inst,
                }
 
                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;
                        }
@@ -1065,7 +1065,7 @@ 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) {
index c912acc056e09887f0eb5e05634cd08fa43eb388..40bdb060880d9817b3160f6fe958c7181dab03db 100644 (file)
@@ -251,7 +251,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(void *instance, UNUSED void *t
                 *      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;
                }
index 1e5ea0cda63eb8a9f0598ff5f9410815c676807d..8a79e532dea8418203da1a38a8723072a06ca8d8 100644 (file)
@@ -861,7 +861,7 @@ static rlm_rcode_t CC_HINT(nonnull) pap_auth_lm(rlm_pap_t const *inst, REQUEST *
                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;
        }
index 7fa410fb32173b5d1e3b72b408c09158fa215630..c89176c4f8cb2ba131d4e7c5d967c4e034753ac1 100644 (file)
@@ -299,7 +299,7 @@ static XS(XS_radiusd_radlog)
 }
 
 /*
- *     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
@@ -319,7 +319,7 @@ static XS(XS_radiusd_xlat)
 
        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;
index e877dc15fa9beb08b40927ee8f50f0f75f6b4595..6ef1b63e9885b2660af83f33c02819e5a69657f2 100644 (file)
@@ -311,7 +311,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_accounting(void *instance, UNUSED void *
         *      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;
        }
 
@@ -348,7 +348,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_accounting(void *instance, UNUSED void *
        /*
         *      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;
@@ -562,7 +562,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_checksimul(void *instance, UNUSED void *
        /*
         *      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;
        }
 
@@ -588,7 +588,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_checksimul(void *instance, UNUSED void *
 
        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;
 
index 9e2e03647d834676d9f9ba58580a98eb6c1ca49c..6cd906c3f2b7ef6124a536506858fb7d7bd67b2c 100644 (file)
@@ -826,7 +826,7 @@ static int rest_decode_post(UNUSED rlm_rest_t const *instance, UNUSED rlm_rest_s
 
                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;
                }
 
@@ -934,7 +934,7 @@ static VALUE_PAIR *json_pair_make_leaf(UNUSED rlm_rest_t const *instance, UNUSED
                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 {
@@ -1832,7 +1832,7 @@ int rest_request_config(rlm_rest_t const *inst, rlm_rest_thread_t *t, rlm_rest_s
                        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;
                                }
@@ -1842,7 +1842,7 @@ int rest_request_config(rlm_rest_t const *inst, rlm_rest_thread_t *t, rlm_rest_s
                        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;
                                }
@@ -1855,7 +1855,7 @@ int rest_request_config(rlm_rest_t const *inst, rlm_rest_thread_t *t, rlm_rest_s
                        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;
                                }
@@ -1865,7 +1865,7 @@ int rest_request_config(rlm_rest_t const *inst, rlm_rest_thread_t *t, rlm_rest_s
                        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;
                                }
@@ -1965,7 +1965,7 @@ int rest_request_config(rlm_rest_t const *inst, rlm_rest_thread_t *t, rlm_rest_s
                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;
@@ -2309,7 +2309,7 @@ ssize_t rest_uri_build(char **out, rlm_rest_t const *inst, REQUEST *request, cha
 
        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);
@@ -2317,7 +2317,7 @@ ssize_t rest_uri_build(char **out, rlm_rest_t const *inst, REQUEST *request, cha
                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);
 
index 89ed46d220831bc0557bc723b0b8a36c7fc216a9..70a91e672d936d3937f660fb5a998e57a6c157ea 100644 (file)
@@ -691,7 +691,7 @@ int sql_set_user(rlm_sql_t const *inst, REQUEST *request, char const *username)
                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;
        }
@@ -734,7 +734,7 @@ static int sql_get_grouplist(rlm_sql_t const *inst, rlm_sql_handle_t **handle, R
        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);
@@ -913,7 +913,7 @@ static rlm_rcode_t rlm_sql_process_groups(rlm_sql_t const *inst, REQUEST *reques
                        /*
                         *      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;
@@ -963,7 +963,7 @@ static rlm_rcode_t rlm_sql_process_groups(rlm_sql_t const *inst, REQUEST *reques
                        /*
                         *      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;
@@ -1306,7 +1306,7 @@ static rlm_rcode_t mod_authorize(void *instance, UNUSED void *thread, REQUEST *r
                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;
@@ -1354,7 +1354,7 @@ static rlm_rcode_t mod_authorize(void *instance, UNUSED void *thread, REQUEST *r
                /*
                 *      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;
@@ -1534,7 +1534,7 @@ static int acct_redundant(rlm_sql_t const *inst, REQUEST *request, sql_acct_sect
                *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;
@@ -1581,7 +1581,7 @@ static int acct_redundant(rlm_sql_t const *inst, REQUEST *request, sql_acct_sect
                        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;
@@ -1741,7 +1741,7 @@ static rlm_rcode_t mod_checksimul(void *instance, UNUSED void *thread, REQUEST *
                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);
@@ -1783,7 +1783,7 @@ static rlm_rcode_t mod_checksimul(void *instance, UNUSED void *thread, 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;
 
index 45a9c7a33b79dba7ca58f098c6a79d794409e1ad..e8f65995039b7807d3a83de24e5afe59b7106349 100644 (file)
@@ -529,7 +529,7 @@ void rlm_sql_query_log(rlm_sql_t const *inst, REQUEST *request, sql_acct_section
                return;
        }
 
-       if (radius_axlat(request, &expanded, request, filename, NULL, NULL) < 0) {
+       if (xlat_aeval(request, &expanded, request, filename, NULL, NULL) < 0) {
                return;
        }
 
index dea3f221c0b4873cdaef6b7ddb620b2aff5fd308..b5f4e7cb2545b96f05d074feb4c705f46b4d4dfd 100644 (file)
@@ -358,7 +358,7 @@ static int counter_cmp(void *instance, REQUEST *request, UNUSED VALUE_PAIR *req
        }
 
        /* 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;
        }
 
@@ -440,7 +440,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(void *instance, UNUSED void *t
        }
 
        /* 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);
index d153e1c48830aca062403bd13ec5aeb6f5543f9c..9f39e36880163d1f803716734e363722e1d9f213 100644 (file)
@@ -278,7 +278,7 @@ static int sqlippool_command(char const *fmt, rlm_sql_handle_t **handle,
         */
        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){
@@ -322,7 +322,7 @@ static int CC_HINT(nonnull (1, 3, 4, 5)) sqlippool_query1(char *out, int outlen,
        /*
         *      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);
@@ -419,7 +419,7 @@ static int do_logging(REQUEST *request, char const *str, int rcode)
 
        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;
        }