add extra argument to radius_xlat for escape function context - currently unused
authorPhil Mayers <p.mayers@imperial.ac.uk>
Fri, 21 Sep 2012 15:27:38 +0000 (16:27 +0100)
committerPhil Mayers <p.mayers@imperial.ac.uk>
Fri, 5 Oct 2012 11:50:29 +0000 (12:50 +0100)
41 files changed:
src/include/radiusd.h
src/main/auth.c
src/main/evaluate.c
src/main/exec.c
src/main/log.c
src/main/mainconfig.c
src/main/modcall.c
src/main/radconf2xml.c
src/main/radmin.c
src/main/radwho.c
src/main/tls.c
src/main/valuepair.c
src/main/xlat.c
src/modules/rlm_acctlog/rlm_acctlog.c
src/modules/rlm_attr_filter/rlm_attr_filter.c
src/modules/rlm_attr_rewrite/rlm_attr_rewrite.c
src/modules/rlm_cache/rlm_cache.c
src/modules/rlm_detail/rlm_detail.c
src/modules/rlm_eap/types/rlm_eap_gtc/rlm_eap_gtc.c
src/modules/rlm_expiration/rlm_expiration.c
src/modules/rlm_expr/paircmp.c
src/modules/rlm_expr/rlm_expr.c
src/modules/rlm_fastusers/rlm_fastusers.c
src/modules/rlm_files/rlm_files.c
src/modules/rlm_ippool/rlm_ippool.c
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_linelog/rlm_linelog.c
src/modules/rlm_logintime/rlm_logintime.c
src/modules/rlm_mschap/rlm_mschap.c
src/modules/rlm_pap/rlm_pap.c
src/modules/rlm_perl/rlm_perl.c
src/modules/rlm_policy/evaluate.c
src/modules/rlm_radutmp/rlm_radutmp.c
src/modules/rlm_redis/rlm_redis.c
src/modules/rlm_rediswho/rlm_rediswho.c
src/modules/rlm_rest/rest.c
src/modules/rlm_sql/rlm_sql.c
src/modules/rlm_sql/sql.c
src/modules/rlm_sql_log/rlm_sql_log.c
src/modules/rlm_sqlcounter/rlm_sqlcounter.c
src/modules/rlm_sqlippool/rlm_sqlippool.c

index 553815a..f6e256b 100644 (file)
@@ -715,7 +715,7 @@ VALUE_PAIR *radius_pairmake(REQUEST *request, VALUE_PAIR **vps,
 typedef size_t (*RADIUS_ESCAPE_STRING)(char *out, size_t outlen, const char *in);
 
 int            radius_xlat(char * out, int outlen, const char *fmt,
-                          REQUEST * request, RADIUS_ESCAPE_STRING func);
+                          REQUEST * request, RADIUS_ESCAPE_STRING func, void *funcarg);
 typedef size_t (*RAD_XLAT_FUNC)(void *instance, REQUEST *, const char *, char *, size_t, RADIUS_ESCAPE_STRING func);
 int            xlat_register(const char *module, RAD_XLAT_FUNC func,
                              void *instance);
index f55e962..34bd56d 100644 (file)
@@ -140,7 +140,7 @@ static int rad_authlog(const char *msg, REQUEST *request, int goodpass)
        if (extra_msg) {
                extra[0] = ' ';
                radius_xlat(extra + 1, sizeof(extra) - 1, extra_msg, request,
-                           NULL);
+                           NULL, NULL);
        } else {
                *extra = '\0';
        }
index 99fa7a0..c0d23ad 100644 (file)
@@ -101,7 +101,7 @@ static const char *expand_string(char *buffer, size_t sizeof_buffer,
        case T_DOUBLE_QUOTED_STRING:
                if (!strchr(value, '%')) return value;
 
-               radius_xlat(buffer, sizeof_buffer, value, request, NULL);
+               radius_xlat(buffer, sizeof_buffer, value, request, NULL, NULL);
                return buffer;
        }
 
index 16155d8..eecec14 100644 (file)
@@ -215,7 +215,7 @@ pid_t radius_start_program(const char *cmd, REQUEST *request,
 
                if (!request) continue;
 
-               sublen = radius_xlat(to, left - 1, argv[i], request, NULL);
+               sublen = radius_xlat(to, left - 1, argv[i], request, NULL, NULL);
                if (sublen <= 0) {
                        /*
                         *      Fail to be backwards compatible.
index 6a20fd9..61ed1e3 100644 (file)
@@ -257,7 +257,7 @@ void radlog_request(int lvl, int priority, REQUEST *request, const char *msg, ..
                 */
                
                radius_xlat(buffer, sizeof(buffer), filename,
-                           request, NULL); /* FIXME: escape chars! */
+                           request, NULL, NULL); /* FIXME: escape chars! */
                request->radlog = rl;
                
                p = strrchr(buffer, FR_DIR_SEP);
index 78d58ce..50c1898 100644 (file)
@@ -367,7 +367,7 @@ static size_t xlat_config(void *instance, REQUEST *request,
        /*
         *      Expand it safely.
         */
-       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, config_escape_func)) {
+       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, config_escape_func, NULL)) {
                return 0;
        }
 
index 5e74334..3c6ad42 100644 (file)
@@ -627,7 +627,7 @@ int modcall(int component, modcallable *c, REQUEST *request)
 
                        if (!mx->exec) {
                                radius_xlat(buffer, sizeof(buffer),
-                                           mx->xlat_name, request, NULL);
+                                           mx->xlat_name, request, NULL, NULL);
                        } else {
                                RDEBUG("`%s`", mx->xlat_name);
                                radius_exec_program(mx->xlat_name, request,
@@ -730,7 +730,7 @@ int modcall(int component, modcallable *c, REQUEST *request)
                                        }
                                } else {
                                        radius_xlat(buffer, sizeof(buffer),
-                                                   child->name, request, NULL);
+                                                   child->name, request, NULL, NULL);
                                }
                                null_case = q = NULL;
                                for(p = g->children; p; p = p->next) {
index 7f192e4..30f319d 100644 (file)
@@ -47,7 +47,8 @@ struct main_config_t mainconfig;
 char *request_log_file = NULL;
 char *debug_log_file = NULL;
 int radius_xlat(UNUSED char *out, UNUSED int outlen, UNUSED const char *fmt,
-               UNUSED REQUEST *request, UNUSED RADIUS_ESCAPE_STRING func)
+               UNUSED REQUEST *request,
+               UNUSED RADIUS_ESCAPE_STRING func, UNUSED void *arg)
 {
        return -1;
 }
index ad3ba83..613d0e2 100644 (file)
@@ -89,7 +89,8 @@ struct main_config_t mainconfig;
 char *request_log_file = NULL;
 char *debug_log_file = NULL;
 int radius_xlat(UNUSED char *out, UNUSED int outlen, UNUSED const char *fmt,
-               UNUSED REQUEST *request, UNUSED RADIUS_ESCAPE_STRING func)
+               UNUSED REQUEST *request,
+               UNUSED RADIUS_ESCAPE_STRING func, UNUSED void *arg)
 {
        return -1;
 }
index 4bb804e..81d1eb0 100644 (file)
@@ -81,7 +81,8 @@ struct main_config_t mainconfig;
 char *request_log_file = NULL;
 char *debug_log_file = NULL;
 int radius_xlat(char *out, UNUSED int outlen, UNUSED const char *fmt,
-               UNUSED REQUEST *request, UNUSED RADIUS_ESCAPE_STRING func)
+               UNUSED REQUEST *request,
+               UNUSED RADIUS_ESCAPE_STRING func, UNUSED void *arg)
 {
        *out = 0;
        return 0;
index 0650e3b..3ae5414 100644 (file)
@@ -1696,7 +1696,7 @@ int cbtls_verify(int ok, X509_STORE_CTX *ctx)
                 *      previous checks passed.
                 */
                if (my_ok && conf->check_cert_cn) {
-                       if (!radius_xlat(cn_str, sizeof(cn_str), conf->check_cert_cn, request, NULL)) {
+                       if (!radius_xlat(cn_str, sizeof(cn_str), conf->check_cert_cn, request, NULL, NULL)) {
                                radlog(L_ERR, "rlm_eap_tls (%s): xlat failed.",
                                       conf->check_cert_cn);
                                /* if this fails, fail the verification */
index c5f0060..e1df052 100644 (file)
@@ -109,7 +109,7 @@ int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp)
                regmatch_t rxmatch[REQUEST_MAX_REGEX + 1];
 
                snprintf(name, sizeof(name), "%%{%s}", check->name);
-               radius_xlat(value, sizeof(value), name, request, NULL);
+               radius_xlat(value, sizeof(value), name, request, NULL, NULL);
 
                /*
                 *      Include substring matches.
@@ -186,7 +186,7 @@ int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp)
                regmatch_t rxmatch[REQUEST_MAX_REGEX + 1];
 
                snprintf(name, sizeof(name), "%%{%s}", check->name);
-               radius_xlat(value, sizeof(value), name, request, NULL);
+               radius_xlat(value, sizeof(value), name, request, NULL, NULL);
 
                /*
                 *      Include substring matches.
@@ -568,7 +568,7 @@ int paircompare(REQUEST *req, VALUE_PAIR *request, VALUE_PAIR *check,
                        check_item->flags.do_xlat = 0;
                        rcode = radius_xlat(buffer, sizeof(buffer),
                                            check_item->vp_strvalue,
-                                           req, NULL);
+                                           req, NULL, NULL);
 
                        /*
                         *      Parse the string into a new value.
@@ -680,7 +680,7 @@ void pairxlatmove(REQUEST *req, VALUE_PAIR **to, VALUE_PAIR **from)
                        i->flags.do_xlat = 0;
                        rcode = radius_xlat(buffer, sizeof(buffer),
                                            i->vp_strvalue,
-                                           req, NULL);
+                                           req, NULL, NULL);
 
                        /*
                         *      Parse the string into a new value.
index 942d891..24328d2 100644 (file)
@@ -910,7 +910,7 @@ void xlat_free(void)
  */
 static int decode_attribute(const char **from, char **to, int freespace,
                             REQUEST *request,
-                            RADIUS_ESCAPE_STRING func)
+                            RADIUS_ESCAPE_STRING func, void *funcarg)
 {
        int     do_length = 0;
        const char *module_name, *xlat_str;
@@ -1011,7 +1011,7 @@ static int decode_attribute(const char **from, char **to, int freespace,
                 *      Expand the first one.  If we did, exit the
                 *      conditional.
                 */
-               retlen = radius_xlat(q, freespace, buffer, request, func);
+               retlen = radius_xlat(q, freespace, buffer, request, func, funcarg);
                if (retlen) {
                        q += retlen;
                        goto done;
@@ -1023,7 +1023,7 @@ static int decode_attribute(const char **from, char **to, int freespace,
                 */
                if (expand2) {
                        retlen = radius_xlat(q, freespace, l,
-                                           request, func);
+                                           request, func, funcarg);
                        if (retlen) {
                                q += retlen;
                        }
@@ -1132,7 +1132,7 @@ do_xlat:
                 *      Expand the second bit.
                 */
                RDEBUG2("\t... expanding second conditional");
-               retlen = radius_xlat(q, freespace, next, request, func);
+               retlen = radius_xlat(q, freespace, next, request, func, funcarg);
        }
        q += retlen;
 
@@ -1180,7 +1180,8 @@ static size_t xlat_copy(char *out, size_t outlen, const char *in)
  * @return length of string written @bug should really have -1 for failure
  */
 int radius_xlat(char *out, int outlen, const char *fmt,
-               REQUEST *request, RADIUS_ESCAPE_STRING func)
+               REQUEST *request,
+               RADIUS_ESCAPE_STRING func, void *funcarg)
 {
        int c, len, freespace;
        const char *p;
@@ -1258,7 +1259,7 @@ int radius_xlat(char *out, int outlen, const char *fmt,
                } else if (c == '%') switch(*p) {
                        case '{':
                                p--;
-                               if (decode_attribute(&p, &q, freespace, request, func) < 0) return 0;
+                               if (decode_attribute(&p, &q, freespace, request, func, funcarg) < 0) return 0;
                                break;
 
                        case '%':
index 86374a4..c7dc1b2 100644 (file)
@@ -88,26 +88,26 @@ static int do_acctlog_acct(void *instance, REQUEST *request)
     if ((pair = pairfind(request->packet->vps, PW_ACCT_STATUS_TYPE, 0)) != NULL) {
         acctstatustype = pair->vp_integer;
     } else {
-        radius_xlat(logstr, sizeof(logstr), "packet has no accounting status type. [user '%{User-Name}', nas '%{NAS-IP-Address}']", request, NULL);
+        radius_xlat(logstr, sizeof(logstr), "packet has no accounting status type. [user '%{User-Name}', nas '%{NAS-IP-Address}']", request, NULL, NULL);
         radlog(L_ERR, "rlm_acctlog (%s)", logstr);
         return RLM_MODULE_INVALID;
     }
 
        switch (acctstatustype) {
                case PW_STATUS_START:
-                       radius_xlat(logstr, sizeof(logstr), inst->acctstart, request, NULL);
+                       radius_xlat(logstr, sizeof(logstr), inst->acctstart, request, NULL, NULL);
                break;
                case PW_STATUS_STOP:
-                       radius_xlat(logstr, sizeof(logstr), inst->acctstop, request, NULL);
+                       radius_xlat(logstr, sizeof(logstr), inst->acctstop, request, NULL, NULL);
                break;
                case PW_STATUS_ALIVE:
-                       radius_xlat(logstr, sizeof(logstr), inst->acctupdate, request, NULL);
+                       radius_xlat(logstr, sizeof(logstr), inst->acctupdate, request, NULL, NULL);
                break;
                case PW_STATUS_ACCOUNTING_ON:
-                       radius_xlat(logstr, sizeof(logstr), inst->accton, request, NULL);
+                       radius_xlat(logstr, sizeof(logstr), inst->accton, request, NULL, NULL);
                break;
                case PW_STATUS_ACCOUNTING_OFF:
-                       radius_xlat(logstr, sizeof(logstr), inst->acctoff, request, NULL);
+                       radius_xlat(logstr, sizeof(logstr), inst->acctoff, request, NULL, NULL);
                break;
 
        default:
index 35a6d52..46f85ef 100644 (file)
@@ -199,7 +199,7 @@ static int attr_filter_common(void *instance, REQUEST *request,
                int len;
 
                len = radius_xlat(buffer, sizeof(buffer), inst->key,
-                                 request, NULL);
+                                 request, NULL, NULL);
                if (!len) {
                        return RLM_MODULE_NOOP;
                }
index fd47702..78754a4 100644 (file)
@@ -178,7 +178,7 @@ static int do_attr_rewrite(void *instance, REQUEST *request)
 
        if (data->new_attr){
                /* new_attribute = yes */
-               if (!radius_xlat(replace_STR, sizeof(replace_STR), data->replace, request, NULL)) {
+               if (!radius_xlat(replace_STR, sizeof(replace_STR), data->replace, request, NULL, NULL)) {
                        DEBUG2("%s: xlat on replace string failed.", data->name);
                        return ret;
                }
@@ -274,7 +274,7 @@ do_again:
                if (data->nocase)
                        cflags |= REG_ICASE;
 
-               if (!radius_xlat(search_STR, sizeof(search_STR), data->search, request, NULL) && data->search_len != 0) {
+               if (!radius_xlat(search_STR, sizeof(search_STR), data->search, request, NULL, NULL) && data->search_len != 0) {
                        DEBUG2("%s: xlat on search string failed.", data->name);
                        return ret;
                }
@@ -367,7 +367,7 @@ do_again:
 
                        if (!done_xlat){
                                if (data->replace_len != 0 &&
-                               radius_xlat(replace_STR, sizeof(replace_STR), data->replace, request, NULL) == 0) {
+                               radius_xlat(replace_STR, sizeof(replace_STR), data->replace, request, NULL, NULL) == 0) {
                                        DEBUG2("%s: xlat on replace string failed.", data->name);
                                        return ret;
                                }
index 7ab428e..014550c 100644 (file)
@@ -279,7 +279,7 @@ static rlm_cache_entry_t *cache_add(rlm_cache_t *inst, REQUEST *request,
                 *      I don't want to make that change for 2.0.
                 */
                radius_xlat(buffer, sizeof(buffer), cf_pair_value(cp),
-                           request, NULL);
+                           request, NULL, NULL);
 
                vp = pairmake(p, buffer, cf_pair_operator(cp));
                pairadd(vps, vp);
@@ -373,7 +373,7 @@ static size_t cache_xlat(void *instance, REQUEST *request,
        const char *p = fmt;
        char buffer[1024];
 
-       radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL);
+       radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL, NULL);
 
        c = cache_find(inst, request, buffer);
        
@@ -576,7 +576,7 @@ static int cache_it(void *instance, REQUEST *request)
        VALUE_PAIR *vp;
        char buffer[1024];
 
-       radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL);
+       radius_xlat(buffer, sizeof(buffer), inst->key, request, NULL, NULL);
 
        c = cache_find(inst, request, buffer);
        
index 81b5352..dffaac0 100644 (file)
@@ -223,7 +223,7 @@ static int do_detail(void *instance, REQUEST *request, RADIUS_PACKET *packet,
         *      feed it through radius_xlat() to expand the
         *      variables.
         */
-       if (radius_xlat(buffer, sizeof(buffer), inst->detailfile, request, NULL) == 0) {
+       if (radius_xlat(buffer, sizeof(buffer), inst->detailfile, request, NULL, NULL) == 0) {
                radlog_request(L_ERR, 0, request, "rlm_detail: Failed to expand detail file %s",
                    inst->detailfile);
            return RLM_MODULE_FAIL;
@@ -368,7 +368,7 @@ static int do_detail(void *instance, REQUEST *request, RADIUS_PACKET *packet,
                return RLM_MODULE_FAIL;
        }
 
-       if (radius_xlat(timestamp, sizeof(timestamp), inst->header, request, NULL) == 0) {
+       if (radius_xlat(timestamp, sizeof(timestamp), inst->header, request, NULL, NULL) == 0) {
                radlog_request(L_ERR, 0, request, "rlm_detail: Unable to expand detail header format %s",
                        inst->header);
                close(outfd);
index af28e90..fd6ec41 100644 (file)
@@ -115,7 +115,7 @@ static int gtc_initiate(void *type_data, EAP_HANDLER *handler)
        EAP_DS *eap_ds = handler->eap_ds;
        rlm_eap_gtc_t *inst = (rlm_eap_gtc_t *) type_data;
 
-       if (!radius_xlat(challenge_str, sizeof(challenge_str), inst->challenge, handler->request, NULL)) {
+       if (!radius_xlat(challenge_str, sizeof(challenge_str), inst->challenge, handler->request, NULL, NULL)) {
                radlog(L_ERR, "rlm_eap_gtc: xlat of \"%s\" failed", inst->challenge);
                return 0;
        }
index 247e480..0f2cda0 100644 (file)
@@ -80,7 +80,7 @@ static int expiration_authorize(void *instance, REQUEST *request)
                        RDEBUG("Account has expired");
 
                        if (data->msg && data->msg[0]){
-                               if (!radius_xlat(msg, sizeof(msg), data->msg, request, NULL)) {
+                               if (!radius_xlat(msg, sizeof(msg), data->msg, request, NULL, NULL)) {
                                        radlog(L_ERR, "rlm_expiration: xlat failed.");
                                        return RLM_MODULE_FAIL;
                                }
index 52aec03..6923a21 100644 (file)
@@ -228,7 +228,7 @@ static int genericcmp(void *instance UNUSED,
 
                snprintf(name, sizeof(name), "%%{%s}", check->name);
 
-               radius_xlat(value, sizeof(value), name, req, NULL);
+               radius_xlat(value, sizeof(value), name, req, NULL, NULL);
                vp = pairmake(check->name, value, check->operator);
 
                /*
index f209268..b1097fb 100644 (file)
@@ -248,7 +248,7 @@ static size_t expr_xlat(void *instance, REQUEST *request, const char *fmt,
        /*
         * Do an xlat on the provided string (nice recursive operation).
         */
-       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) {
+       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func, NULL)) {
                radlog(L_ERR, "rlm_expr: xlat failed.");
                *out = '\0';
                return 0;
@@ -286,7 +286,7 @@ static size_t rand_xlat(UNUSED void *instance, REQUEST *request, const char *fmt
        /*
         * Do an xlat on the provided string (nice recursive operation).
         */
-       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) {
+       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func, NULL)) {
                radlog(L_ERR, "rlm_expr: xlat failed.");
                *out = '\0';
                return 0;
@@ -328,7 +328,7 @@ static size_t randstr_xlat(UNUSED void *instance, REQUEST *request,
        /*
         * Do an xlat on the provided string (nice recursive operation).
         */
-       len = radius_xlat(buffer, sizeof(buffer), fmt, request, func);
+       len = radius_xlat(buffer, sizeof(buffer), fmt, request, func, NULL);
        if (!len) {
                radlog(L_ERR, "rlm_expr: xlat failed.");
                *out = '\0';
@@ -436,7 +436,7 @@ static size_t urlquote_xlat(UNUSED void *instance, REQUEST *request,
        
        if (outlen <= 1) return 0;
 
-       len = radius_xlat(buffer, sizeof(buffer), fmt, request, func);
+       len = radius_xlat(buffer, sizeof(buffer), fmt, request, func, NULL);
        if (!len) {
                radlog(L_ERR, "rlm_expr: xlat failed.");
                *out = '\0';
@@ -491,7 +491,7 @@ static size_t escape_xlat(UNUSED void *instance, REQUEST *request,
        
        if (outlen <= 1) return 0;
 
-       len = radius_xlat(buffer, sizeof(buffer), fmt, request, func);
+       len = radius_xlat(buffer, sizeof(buffer), fmt, request, func, NULL);
        if (!len) {
                radlog(L_ERR, "rlm_expr: xlat failed.");
                *out = '\0';
@@ -540,7 +540,7 @@ static size_t lc_xlat(UNUSED void *instance, REQUEST *request,
 
        if (outlen <= 1) return 0;
 
-       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) {
+       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func, NULL)) {
                *out = '\0';
                return 0;
        }
@@ -572,7 +572,7 @@ static size_t uc_xlat(UNUSED void *instance, REQUEST *request,
 
        if (outlen <= 1) return 0;
 
-       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) {
+       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func, NULL)) {
                *out = '\0';
                return 0;
        }
@@ -602,7 +602,7 @@ static size_t md5_xlat(UNUSED void *instance, REQUEST *request,
        int i;
        FR_MD5_CTX ctx;
 
-       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func)) {
+       if (!radius_xlat(buffer, sizeof(buffer), fmt, request, func, NULL)) {
                *out = '\0';
                return 0;
        }
index 31e0b07..edfd57b 100644 (file)
@@ -564,7 +564,7 @@ static int fastuser_authorize(void *instance, REQUEST *request)
                int len;
 
                len = radius_xlat(buffer, sizeof(buffer), inst->key,
-                                 request, NULL);
+                                 request, NULL, NULL);
                if (len) name = buffer;
                else name = "NONE";
        }
@@ -721,7 +721,7 @@ static int fastuser_preacct(void *instance, REQUEST *request)
                int len;
 
                len = radius_xlat(buffer, sizeof(buffer), inst->key,
-                                 request, NULL);
+                                 request, NULL, NULL);
                if (len) name = buffer;
                else name = "NONE";
        }
index e0bc59a..b44b686 100644 (file)
@@ -431,7 +431,7 @@ static int file_common(struct file_instance *inst, REQUEST *request,
                int len;
 
                len = radius_xlat(buffer, sizeof(buffer), inst->key,
-                                 request, NULL);
+                                 request, NULL, NULL);
                if (len) name = buffer;
                else name = "NONE";
        }
index 2033d2b..cedf923 100644 (file)
@@ -337,7 +337,7 @@ static int ippool_accounting(void *instance, REQUEST *request)
        }
        switch(acctstatustype){
                case PW_STATUS_STOP:
-                       if (!radius_xlat(xlat_str,MAX_STRING_LEN,data->key, request, NULL)){
+                       if (!radius_xlat(xlat_str,MAX_STRING_LEN,data->key, request, NULL, NULL)){
                                RDEBUG("xlat on the 'key' directive failed");
                                return RLM_MODULE_NOOP;
                        }
@@ -495,7 +495,7 @@ static int ippool_postauth(void *instance, REQUEST *request)
        }
 #endif
 
-       if (!radius_xlat(xlat_str,MAX_STRING_LEN,data->key, request, NULL)){
+       if (!radius_xlat(xlat_str,MAX_STRING_LEN,data->key, request, NULL, NULL)){
                RDEBUG("xlat on the 'key' directive failed");
                return RLM_MODULE_NOOP;
        }
index 92377f9..f4a5bb5 100644 (file)
@@ -1042,7 +1042,7 @@ static int ldap_groupcmp(void *instance, REQUEST *req,
                 return 1;
         }
 
-        if (!radius_xlat(basedn, sizeof(basedn), inst->basedn, req, ldap_escape_func)) {
+        if (!radius_xlat(basedn, sizeof(basedn), inst->basedn, req, ldap_escape_func, NULL)) {
                 DEBUG("rlm_ldap::ldap_groupcmp: unable to create basedn.");
                 return 1;
         }
@@ -1051,7 +1051,7 @@ static int ldap_groupcmp(void *instance, REQUEST *req,
                 char            *user_dn = NULL;
 
                 if (!radius_xlat(filter, sizeof(filter), inst->filter,
-                                       req, ldap_escape_func)){
+                                       req, ldap_escape_func, NULL)){
                         DEBUG("rlm_ldap::ldap_groupcmp: unable to create filter");
                         return 1;
                 }
@@ -1090,7 +1090,7 @@ static int ldap_groupcmp(void *instance, REQUEST *req,
         }
 
         if(!radius_xlat(gr_filter, sizeof(gr_filter),
-                       inst->groupmemb_filt, req, ldap_escape_func)) {
+                       inst->groupmemb_filt, req, ldap_escape_func, NULL)) {
                 DEBUG("rlm_ldap::ldap_groupcmp: unable to create filter.");
                 return 1;
         }
@@ -1229,7 +1229,7 @@ static size_t ldap_xlat(void *instance, REQUEST *request, const char *fmt,
        LDAP_CONN *conn;
 
        DEBUG("  [%s] - ldap_xlat", inst->xlat_name);
-       if (!radius_xlat(url, sizeof(url), fmt, request, ldap_escape_func)) {
+       if (!radius_xlat(url, sizeof(url), fmt, request, ldap_escape_func, NULL)) {
                radlog (L_ERR, "  [%s] Unable to create LDAP URL.\n", inst->xlat_name);
                return 0;
        }
@@ -1377,13 +1377,13 @@ static int ldap_authorize(void *instance, REQUEST * request)
               request->username->vp_strvalue);
 
        if (!radius_xlat(filter, sizeof(filter), inst->filter,
-                        request, ldap_escape_func)) {
+                        request, ldap_escape_func, NULL)) {
                radlog(L_ERR, "  [%s] unable to create filter.\n", inst->xlat_name);
                return RLM_MODULE_INVALID;
        }
 
        if (!radius_xlat(basedn, sizeof(basedn), inst->basedn,
-                        request, ldap_escape_func)) {
+                        request, ldap_escape_func, NULL)) {
                radlog(L_ERR, "  [%s] unable to create basedn.\n", inst->xlat_name);
                return RLM_MODULE_INVALID;
        }
@@ -1855,13 +1855,13 @@ static int ldap_authenticate(void *instance, REQUEST * request)
        while ((vp_user_dn = pairfind(request->config_items,
                                      PW_LDAP_USERDN, 0)) == NULL) {
                if (!radius_xlat(filter, sizeof(filter), inst->filter,
-                               request, ldap_escape_func)) {
+                               request, ldap_escape_func, NULL)) {
                        radlog(L_ERR, "  [%s] unable to create filter.\n", inst->xlat_name);
                        return RLM_MODULE_INVALID;
                }
 
                if (!radius_xlat(basedn, sizeof(basedn), inst->basedn,
-                               request, ldap_escape_func)) {
+                               request, ldap_escape_func, NULL)) {
                        radlog(L_ERR, "  [%s] unable to create basedn.\n", inst->xlat_name);
                        return RLM_MODULE_INVALID;
                }
index 6f228a2..a9fce39 100644 (file)
@@ -243,7 +243,7 @@ static int do_linelog(void *instance, REQUEST *request)
                CONF_PAIR *cp;
 
                radius_xlat(line + 1, sizeof(line) - 2, inst->reference,
-                           request, linelog_escape_func);
+                           request, linelog_escape_func, NULL);
                line[0] = '.';  /* force to be in current section */
 
                /*
@@ -281,7 +281,7 @@ static int do_linelog(void *instance, REQUEST *request)
         */
        if (strcmp(inst->filename, "syslog") != 0) {
                radius_xlat(buffer, sizeof(buffer), inst->filename, request,
-                           NULL);
+                           NULL, NULL);
                
                /* check path and eventually create subdirs */
                p = strrchr(buffer,'/');
@@ -326,7 +326,7 @@ static int do_linelog(void *instance, REQUEST *request)
         *      FIXME: Check length.
         */
        radius_xlat(line, sizeof(line) - 1, value, request,
-                   linelog_escape_func);
+                   linelog_escape_func, NULL);
 
        if (fd >= 0) {
                strcat(line, "\n");
index fd69109..3f915a2 100644 (file)
@@ -197,7 +197,7 @@ static int logintime_authorize(void *instance, REQUEST *request)
                                char msg[MAX_STRING_LEN];
                                VALUE_PAIR *tmp;
 
-                               if (!radius_xlat(msg, sizeof(msg), data->msg, request, NULL)) {
+                               if (!radius_xlat(msg, sizeof(msg), data->msg, request, NULL, NULL)) {
                                        radlog(L_ERR, "rlm_logintime: xlat failed.");
                                        return RLM_MODULE_FAIL;
                                }
index d56636b..a1bb55f 100644 (file)
@@ -463,7 +463,7 @@ static size_t mschap_xlat(void *instance, REQUEST *request,
 
                while (isspace(*p)) p++;
 
-               if (!radius_xlat(buf2, sizeof(buf2),p,request,NULL)) {
+               if (!radius_xlat(buf2, sizeof(buf2),p,request,NULL,NULL)) {
                        RDEBUG("xlat failed");
                        *buffer = '\0';
                        return 0;
@@ -489,7 +489,7 @@ static size_t mschap_xlat(void *instance, REQUEST *request,
 
                while (isspace(*p)) p++;
 
-               if (!radius_xlat(buf2, sizeof(buf2),p,request,NULL)) {
+               if (!radius_xlat(buf2, sizeof(buf2),p,request,NULL,NULL)) {
                        RDEBUG("xlat failed");
                        *buffer = '\0';
                        return 0;
@@ -750,7 +750,7 @@ static int do_mschap_cpw(rlm_mschap_t *inst,
                 */
 
                if (inst->ntlm_cpw_username) {
-                       len = radius_xlat(buf, sizeof(buf) - 2, inst->ntlm_cpw_username, request, NULL);
+                       len = radius_xlat(buf, sizeof(buf) - 2, inst->ntlm_cpw_username, request, NULL, NULL);
                        strcat(buf, "\n");
                        len++;
 
@@ -763,7 +763,7 @@ static int do_mschap_cpw(rlm_mschap_t *inst,
                }
 
                if (inst->ntlm_cpw_domain) {
-                       len = radius_xlat(buf, sizeof(buf) - 2, inst->ntlm_cpw_domain, request, NULL);
+                       len = radius_xlat(buf, sizeof(buf) - 2, inst->ntlm_cpw_domain, request, NULL, NULL);
                        strcat(buf, "\n");
                        len++;
 
@@ -1005,7 +1005,7 @@ ntlm_auth_err:
                /*
                 * perform the xlat
                 */
-               result_len = radius_xlat(result, sizeof(result), inst->local_cpw, request, NULL);
+               result_len = radius_xlat(result, sizeof(result), inst->local_cpw, request, NULL, NULL);
                if (!result_len) {
                        RDEBUG("Local MS-CHAPv2 password change - xlat didn't give any result, assuming failure");
                        return -1;
index 7828606..8a7a93a 100644 (file)
@@ -730,7 +730,7 @@ static int pap_auth_nt(REQUEST *request, VALUE_PAIR *vp, char *fmsg)
        }
 
        strlcpy(buff2, "%{mschap:NT-Hash %{User-Password}}", sizeof(buff2));
-       if (!radius_xlat(charbuf, sizeof(charbuf),buff2,request,NULL)){
+       if (!radius_xlat(charbuf, sizeof(charbuf),buff2,request,NULL,NULL)){
                RDEBUG("mschap xlat failed");
                snprintf(fmsg, sizeof(char[MAX_STRING_LEN]),
                        "rlm_pap: mschap xlat failed");
@@ -765,7 +765,7 @@ static int pap_auth_lm(REQUEST *request, VALUE_PAIR *vp, char *fmsg)
        }
 
        strlcpy(buff2, "%{mschap:LM-Hash %{User-Password}}", sizeof(buff2));
-       if (!radius_xlat(charbuf,sizeof(charbuf),buff2,request,NULL)){
+       if (!radius_xlat(charbuf,sizeof(charbuf),buff2,request,NULL,NULL)){
                RDEBUG("mschap xlat failed");
                snprintf(fmsg, sizeof(char[MAX_STRING_LEN]),
                        "rlm_pap: mschap xlat failed");
index 1b410b2..f489e12 100644 (file)
@@ -334,7 +334,7 @@ static size_t perl_xlat(void *instance, REQUEST *request, char *fmt, char *out,
        /*
         * Do an xlat on the provided string (nice recursive operation).
        */
-       if (!radius_xlat(params, sizeof(params), fmt, request, func)) {
+       if (!radius_xlat(params, sizeof(params), fmt, request, func, NULL)) {
                radlog(L_ERR, "rlm_perl: xlat failed.");
                return 0;
        }
index 69650ef..3b211fb 100644 (file)
@@ -401,7 +401,7 @@ static int evaluate_print(policy_state_t *state, const policy_item_t *item)
                char buffer[1024];
 
                radius_xlat(buffer, sizeof(buffer), this->rhs,
-                           state->request, NULL);
+                           state->request, NULL, NULL);
                fprintf(fr_log_fp, "%s", buffer);
                if (!strchr(buffer, '\n')) fprintf(fr_log_fp, "\n");
        }
@@ -533,7 +533,7 @@ static int evaluate_condition(policy_state_t *state, const policy_item_t *item)
                        strlcpy(lhs_buffer, data, sizeof(lhs_buffer)); /* FIXME: yuck */
                } else if (this->lhs_type == POLICY_LEX_DOUBLE_QUOTED_STRING) {
                        if (radius_xlat(lhs_buffer, sizeof(lhs_buffer), this->lhs,
-                                       state->request, NULL) > 0) {
+                                       state->request, NULL, NULL) > 0) {
                                data = lhs_buffer;
                        }
                }
@@ -824,7 +824,7 @@ static VALUE_PAIR *assign2vp(REQUEST *request,
        if ((assign->rhs_type == POLICY_LEX_DOUBLE_QUOTED_STRING) &&
            (strchr(assign->rhs, '%') != NULL)) {
                radius_xlat(buffer, sizeof(buffer), assign->rhs,
-                           request, NULL);
+                           request, NULL, NULL);
                value = buffer;
        }
 
index 2192c39..96bca72 100644 (file)
@@ -342,7 +342,7 @@ static int radutmp_accounting(void *instance, REQUEST *request)
        /*
         *      Get the utmp filename, via xlat.
         */
-       radius_xlat(filename, sizeof(filename), inst->filename, request, NULL);
+       radius_xlat(filename, sizeof(filename), inst->filename, request, NULL, NULL);
 
        /*
         *      See if this was a reboot.
@@ -383,7 +383,7 @@ static int radutmp_accounting(void *instance, REQUEST *request)
         *      they told us to use.
         */
        *buffer = '\0';
-       radius_xlat(buffer, sizeof(buffer), inst->username, request, NULL);
+       radius_xlat(buffer, sizeof(buffer), inst->username, request, NULL, NULL);
 
        /*
         *  Copy the previous translated user name.
@@ -574,7 +574,7 @@ static int radutmp_checksimul(void *instance, REQUEST *request)
        /*
         *      Get the filename, via xlat.
         */
-       radius_xlat(filename, sizeof(filename), inst->filename, request, NULL);
+       radius_xlat(filename, sizeof(filename), inst->filename, request, NULL, NULL);
 
        if ((fd = open(filename, O_RDWR)) < 0) {
                /*
@@ -595,7 +595,7 @@ static int radutmp_checksimul(void *instance, REQUEST *request)
        }
 
        *login = '\0';
-       radius_xlat(login, sizeof(login), inst->username, request, NULL);
+       radius_xlat(login, sizeof(login), inst->username, request, NULL, NULL);
        if (!*login) {
                close(fd);
                return RLM_MODULE_NOOP;
index 905f01e..c80dbc8 100644 (file)
@@ -196,7 +196,7 @@ static size_t redis_xlat(void *instance, REQUEST *request,
        char querystr[MAX_QUERY_LEN];
 
        if (!radius_xlat(querystr, sizeof(querystr), fmt, request,
-                   redis_escape_func)) {
+                   redis_escape_func, NULL)) {
                radlog(L_ERR, "rlm_redis (%s): xlat failed.",
                       inst->xlat_name);
 
index d517c29..73659f2 100644 (file)
@@ -68,7 +68,7 @@ static int rediswho_command(const char *fmt, REDISSOCK **dissocket_p,
         *      Do an xlat on the provided string
         */
        if (request) {
-               if (!radius_xlat(query, sizeof (query), fmt, request, NULL)) {
+               if (!radius_xlat(query, sizeof (query), fmt, request, NULL, NULL)) {
                        radlog(L_ERR, "rediswho_command: xlat failed on: '%s'", query);
                        return 0;
                }
index 3abaeb8..87dc9f6 100644 (file)
@@ -1987,7 +1987,7 @@ int rest_request_config(rlm_rest_t *instance, rlm_rest_section_t *section,
                        
                        if (section->username) {
                                radius_xlat(buffer, sizeof(buffer),
-                                           section->username, request, NULL);
+                                           section->username, request, NULL, NULL);
                                            
                                ret = curl_easy_setopt(candle, CURLOPT_USERNAME,
                                                       buffer);
@@ -1995,7 +1995,7 @@ int rest_request_config(rlm_rest_t *instance, rlm_rest_section_t *section,
                        }
                        if (section->password) {
                                radius_xlat(buffer, sizeof(buffer),
-                                           section->password, request, NULL);
+                                           section->password, request, NULL, NULL);
                                            
                                ret = curl_easy_setopt(candle, CURLOPT_PASSWORD,
                                                       buffer);
@@ -2009,7 +2009,7 @@ int rest_request_config(rlm_rest_t *instance, rlm_rest_section_t *section,
                
                        if (section->username) {
                                radius_xlat(buffer, sizeof(buffer),
-                                           section->username, request, NULL);
+                                           section->username, request, NULL, NULL);
                                            
                                ret = curl_easy_setopt(candle,
                                                       CURLOPT_TLSAUTH_USERNAME,
@@ -2018,7 +2018,7 @@ int rest_request_config(rlm_rest_t *instance, rlm_rest_section_t *section,
                        }
                        if (section->password) {
                                radius_xlat(buffer, sizeof(buffer),
-                                           section->password, request, NULL);
+                                           section->password, request, NULL, NULL);
                                            
                                ret = curl_easy_setopt(candle,
                                                       CURLOPT_TLSAUTH_PASSWORD,
@@ -2373,12 +2373,12 @@ ssize_t rest_uri_build(rlm_rest_t *instance, rlm_rest_section_t *section,
        path = (q + 1);
 
        out = buffer;
-       out += radius_xlat(out, bufsize, scheme, request, NULL);
+       out += radius_xlat(out, bufsize, scheme, request, NULL, NULL);
 
        free(scheme);
 
        out += radius_xlat(out, (bufsize - (buffer - out)), path, request,
-                        rest_uri_escape);
+                        rest_uri_escape, NULL);
 
        return (buffer - out);
 }
index 9b0ceb1..aec8365 100644 (file)
@@ -156,7 +156,7 @@ static size_t sql_xlat(void *instance, REQUEST *request,
        /*
         * Do an xlat on the provided string (nice recursive operation).
         */
-       if (!radius_xlat(querystr, sizeof(querystr), fmt, request, sql_escape_func)) {
+       if (!radius_xlat(querystr, sizeof(querystr), fmt, request, sql_escape_func, NULL)) {
                radlog(L_ERR, "rlm_sql (%s): xlat failed.",
                       inst->config->xlat_name);
                return 0;
@@ -472,7 +472,7 @@ int sql_set_user(SQL_INST *inst, REQUEST *request, char *sqlusername, const char
        if (username != NULL) {
                strlcpy(tmpuser, username, sizeof(tmpuser));
        } else if (strlen(inst->config->query_user)) {
-               radius_xlat(tmpuser, sizeof(tmpuser), inst->config->query_user, request, NULL);
+               radius_xlat(tmpuser, sizeof(tmpuser), inst->config->query_user, request, NULL, NULL);
        } else {
                return 0;
        }
@@ -521,7 +521,7 @@ static int sql_get_grouplist (SQL_INST *inst, SQLSOCK *sqlsocket, REQUEST *reque
            (inst->config->groupmemb_query[0] == 0))
                return 0;
 
-       if (!radius_xlat(querystr, sizeof(querystr), inst->config->groupmemb_query, request, sql_escape_func)) {
+       if (!radius_xlat(querystr, sizeof(querystr), inst->config->groupmemb_query, request, sql_escape_func, NULL)) {
                radlog_request(L_ERR, 0, request, "xlat \"%s\" failed.",
                               inst->config->groupmemb_query);
                return -1;
@@ -672,7 +672,7 @@ static int rlm_sql_process_groups(SQL_INST *inst, REQUEST *request, SQLSOCK *sql
                        return -1;
                }
                pairadd(&request->packet->vps, sql_group);
-               if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_check_query, request, sql_escape_func)) {
+               if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_check_query, request, sql_escape_func, NULL)) {
                        radlog_request(L_ERR, 0, request,
                                       "Error generating query; rejecting user");
                        /* Remove the grouup we added above */
@@ -700,7 +700,7 @@ static int rlm_sql_process_groups(SQL_INST *inst, REQUEST *request, SQLSOCK *sql
                                /*
                                 *      Now get the reply pairs since the paircompare matched
                                 */
-                               if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_reply_query, request, sql_escape_func)) {
+                               if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_reply_query, request, sql_escape_func, NULL)) {
                                        radlog_request(L_ERR, 0, request, "Error generating query; rejecting user");
                                        /* Remove the grouup we added above */
                                        pairdelete(&request->packet->vps, PW_SQL_GROUP, 0);
@@ -735,7 +735,7 @@ static int rlm_sql_process_groups(SQL_INST *inst, REQUEST *request, SQLSOCK *sql
                        /*
                         *      Now get the reply pairs since the paircompare matched
                         */
-                       if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_reply_query, request, sql_escape_func)) {
+                       if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_group_reply_query, request, sql_escape_func, NULL)) {
                                radlog_request(L_ERR, 0, request, "Error generating query; rejecting user");
                                /* Remove the grouup we added above */
                                pairdelete(&request->packet->vps, PW_SQL_GROUP, 0);
@@ -1061,7 +1061,7 @@ static int rlm_sql_authorize(void *instance, REQUEST * request)
        /*
         * Alright, start by getting the specific entry for the user
         */
-       if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_check_query, request, sql_escape_func)) {
+       if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_check_query, request, sql_escape_func, NULL)) {
                radlog_request(L_ERR, 0, request, "Error generating query; rejecting user");
                sql_release_socket(inst, sqlsocket);
                /* Remove the username we (maybe) added above */
@@ -1090,7 +1090,7 @@ static int rlm_sql_authorize(void *instance, REQUEST * request)
                        /*
                         *      Now get the reply pairs since the paircompare matched
                         */
-                       if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_reply_query, request, sql_escape_func)) {
+                       if (!radius_xlat(querystr, sizeof(querystr), inst->config->authorize_reply_query, request, sql_escape_func, NULL)) {
                                radlog_request(L_ERR, 0, request, "Error generating query; rejecting user");
                                sql_release_socket(inst, sqlsocket);
                                /* Remove the username we (maybe) added above */
@@ -1238,7 +1238,7 @@ static int rlm_sql_redundant(SQL_INST *inst, REQUEST *request,
                *p++ = '.';
        
        if (radius_xlat(p, (sizeof(path) - (p - path)) - 1,
-                       section->reference, request, NULL) < 0)
+                       section->reference, request, NULL, NULL) < 0)
                return RLM_MODULE_FAIL;
 
        item = cf_reference_item(NULL, section->cs, path);
@@ -1266,7 +1266,7 @@ static int rlm_sql_redundant(SQL_INST *inst, REQUEST *request,
                        goto null_query;
                
                radius_xlat(querystr, sizeof(querystr), value, request,
-                           sql_escape_func);
+                           sql_escape_func, NULL);
                if (!*querystr)
                        goto null_query;
                
@@ -1380,7 +1380,7 @@ static int rlm_sql_checksimul(void *instance, REQUEST * request) {
        if(sql_set_user(inst, request, sqlusername, NULL) < 0)
                return RLM_MODULE_FAIL;
 
-       radius_xlat(querystr, sizeof(querystr), inst->config->simul_count_query, request, sql_escape_func);
+       radius_xlat(querystr, sizeof(querystr), inst->config->simul_count_query, request, sql_escape_func, NULL);
 
        /* initialize the sql socket */
        sqlsocket = sql_get_socket(inst);
@@ -1424,7 +1424,7 @@ static int rlm_sql_checksimul(void *instance, REQUEST * request) {
                return RLM_MODULE_OK;
        }
 
-       radius_xlat(querystr, sizeof(querystr), inst->config->simul_verify_query, request, sql_escape_func);
+       radius_xlat(querystr, sizeof(querystr), inst->config->simul_verify_query, request, sql_escape_func, NULL);
        if(rlm_sql_select_query(&sqlsocket, inst, querystr)) {
                sql_release_socket(inst, sqlsocket);
                return RLM_MODULE_FAIL;
index cd47a61..4959390 100644 (file)
@@ -424,7 +424,7 @@ void rlm_sql_query_log(SQL_INST *inst, REQUEST *request,
 
        if (!filename) return;
 
-       if (!radius_xlat(buffer, sizeof(buffer), filename, request, NULL)) {
+       if (!radius_xlat(buffer, sizeof(buffer), filename, request, NULL, NULL)) {
                radlog(L_ERR, "rlm_sql (%s): xlat failed.",
                       inst->config->xlat_name);
                return;
index 0aca3d4..cea2bb9 100644 (file)
@@ -283,7 +283,7 @@ static int sql_set_user(rlm_sql_log_t *inst, REQUEST *request, char *sqlusername
                strlcpy(tmpuser, username, MAX_STRING_LEN);
        } else if (inst->sql_user_name[0] != '\0') {
                radius_xlat(tmpuser, sizeof(tmpuser), inst->sql_user_name,
-                           request, NULL);
+                           request, NULL, NULL);
        } else {
                return 0;
        }
@@ -324,7 +324,7 @@ static int sql_xlat_query(rlm_sql_log_t *inst, REQUEST *request, const char *que
        /* Expand variables in the query */
        xlat_query[0] = '\0';
        radius_xlat(xlat_query, len, query, request,
-                   inst->utf8 ? sql_utf8_escape_func : sql_escape_func);
+                   inst->utf8 ? sql_utf8_escape_func : sql_escape_func, NULL);
        if (xlat_query[0] == '\0') {
                radlog_request(L_ERR, 0, request, "Couldn't xlat the query %s",
                       query);
@@ -364,7 +364,7 @@ static int sql_log_write(rlm_sql_log_t *inst, REQUEST *request, const char *line
        char *p, path[1024];
 
        path[0] = '\0';
-       radius_xlat(path, sizeof(path), inst->path, request, NULL);
+       radius_xlat(path, sizeof(path), inst->path, request, NULL, NULL);
        if (path[0] == '\0') {
                return RLM_MODULE_FAIL;
        }
index f8e15f9..0664e60 100644 (file)
@@ -391,14 +391,14 @@ static int sqlcounter_cmp(void *instance, REQUEST *req,
        sqlcounter_expand(querystr, MAX_QUERY_LEN, data->query, instance);
 
        /* second, xlat any request attribs in query */
-       radius_xlat(responsestr, MAX_QUERY_LEN, querystr, req, sql_escape_func);
+       radius_xlat(responsestr, MAX_QUERY_LEN, querystr, req, sql_escape_func, NULL);
 
        /* third, wrap query with sql module call & expand */
        snprintf(querystr, sizeof(querystr), "%%{%%S:%s}", responsestr);
        sqlcounter_expand(responsestr, MAX_QUERY_LEN, querystr, instance);
 
        /* Finally, xlat resulting SQL query */
-       radius_xlat(querystr, MAX_QUERY_LEN, responsestr, req, sql_escape_func);
+       radius_xlat(querystr, MAX_QUERY_LEN, responsestr, req, sql_escape_func, NULL);
 
        counter = atoi(querystr);
 
@@ -653,14 +653,14 @@ static int sqlcounter_authorize(void *instance, REQUEST *request)
        sqlcounter_expand(querystr, MAX_QUERY_LEN, data->query, instance);
 
        /* second, xlat any request attribs in query */
-       radius_xlat(responsestr, MAX_QUERY_LEN, querystr, request, sql_escape_func);
+       radius_xlat(responsestr, MAX_QUERY_LEN, querystr, request, sql_escape_func, NULL);
 
        /* third, wrap query with sql module & expand */
        snprintf(querystr, sizeof(querystr), "%%{%%S:%s}", responsestr);
        sqlcounter_expand(responsestr, MAX_QUERY_LEN, querystr, instance);
 
        /* Finally, xlat resulting SQL query */
-       radius_xlat(querystr, MAX_QUERY_LEN, responsestr, request, sql_escape_func);
+       radius_xlat(querystr, MAX_QUERY_LEN, responsestr, request, sql_escape_func, NULL);
 
        if (sscanf(querystr, "%u", &counter) != 1) {
                DEBUG2("rlm_sqlcounter: No integer found in string \"%s\"",
index 5574060..a6eecca 100644 (file)
@@ -307,7 +307,7 @@ static int sqlippool_command(const char * fmt, SQLSOCK * sqlsocket,
         * Do an xlat on the provided string
         */
        if (request) {
-               if (!radius_xlat(query, sizeof(query), expansion, request, data->sql_inst->sql_escape_func)) {
+               if (!radius_xlat(query, sizeof(query), expansion, request, data->sql_inst->sql_escape_func, NULL)) {
                        radlog(L_ERR, "sqlippool_command: xlat failed on: '%s'", query);
                        return 0;
                }
@@ -346,7 +346,7 @@ static int sqlippool_query1(char * out, int outlen, const char * fmt,
         * Do an xlat on the provided string
         */
        if (request) {
-               if (!radius_xlat(query, sizeof(query), expansion, request, data->sql_inst->sql_escape_func)) {
+               if (!radius_xlat(query, sizeof(query), expansion, request, data->sql_inst->sql_escape_func, NULL)) {
                        radlog(L_ERR, "sqlippool_command: xlat failed.");
                        out[0] = '\0';
                        return 0;
@@ -547,7 +547,7 @@ static int sqlippool_postauth(void *instance, REQUEST * request)
        if (pairfind(request->reply->vps, PW_FRAMED_IP_ADDRESS, 0) != NULL) {
                /* We already have a Framed-IP-Address */
                radius_xlat(logstr, sizeof(logstr), data->log_exists,
-                           request, NULL);
+                           request, NULL, NULL);
                RDEBUG("Framed-IP-Address already exists");
 
                return do_logging(logstr, RLM_MODULE_NOOP);
@@ -556,7 +556,7 @@ static int sqlippool_postauth(void *instance, REQUEST * request)
        if (pairfind(request->config_items, PW_POOL_NAME, 0) == NULL) {
                RDEBUG("No Pool-Name defined.");
                radius_xlat(logstr, sizeof(logstr), data->log_nopool,
-                           request, NULL);
+                           request, NULL, NULL);
 
                return do_logging(logstr, RLM_MODULE_NOOP);
        }
@@ -626,7 +626,7 @@ static int sqlippool_postauth(void *instance, REQUEST * request)
                                 *      NOTFOUND
                                 */
                                RDEBUG("pool appears to be full");
-                               radius_xlat(logstr, sizeof(logstr), data->log_failed, request, NULL);
+                               radius_xlat(logstr, sizeof(logstr), data->log_failed, request, NULL, NULL);
                                return do_logging(logstr, RLM_MODULE_NOTFOUND);
 
                        }
@@ -646,7 +646,7 @@ static int sqlippool_postauth(void *instance, REQUEST * request)
 
                RDEBUG("IP address could not be allocated.");
                radius_xlat(logstr, sizeof(logstr), data->log_failed,
-                           request, NULL);
+                           request, NULL, NULL);
 
                return do_logging(logstr, RLM_MODULE_NOOP);
        }
@@ -666,7 +666,7 @@ static int sqlippool_postauth(void *instance, REQUEST * request)
                RDEBUG("Invalid IP number [%s] returned from database query.", allocation);
                data->sql_inst->sql_release_socket(data->sql_inst, sqlsocket);
                radius_xlat(logstr, sizeof(logstr), data->log_failed,
-                           request, NULL);
+                           request, NULL, NULL);
 
                return do_logging(logstr, RLM_MODULE_NOOP);
        }
@@ -690,7 +690,7 @@ static int sqlippool_postauth(void *instance, REQUEST * request)
                          (char *) NULL, 0);
 
        data->sql_inst->sql_release_socket(data->sql_inst, sqlsocket);
-       radius_xlat(logstr, sizeof(logstr), data->log_success, request, NULL);
+       radius_xlat(logstr, sizeof(logstr), data->log_success, request, NULL, NULL);
 
        return do_logging(logstr, RLM_MODULE_OK);
 }
@@ -766,7 +766,7 @@ static int sqlippool_accounting_stop(SQLSOCK * sqlsocket,
        sqlippool_command(data->stop_commit, sqlsocket, data, request,
                          (char *) NULL, 0);
 
-       radius_xlat(logstr, sizeof(logstr), data->log_clear, request, NULL);
+       radius_xlat(logstr, sizeof(logstr), data->log_clear, request, NULL, NULL);
 
        return do_logging(logstr, RLM_MODULE_OK);
 }