]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow bare words for xlat's
authorAlan T. DeKok <aland@freeradius.org>
Sun, 10 Jan 2021 17:40:08 +0000 (12:40 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 10 Jan 2021 17:40:08 +0000 (12:40 -0500)
src/lib/server/cond_tokenize.c

index 50728257431b72f8b6c43e2c3cdb4de699b5609d..d868d826bed7b06f1f2c2f050f0155cbe1889718 100644 (file)
@@ -346,7 +346,14 @@ int fr_cond_promote_types(fr_cond_t *c, fr_sbuff_t *in, fr_sbuff_marker_t *m_lhs
                 */
                lhs_type = tmpl_da(c->data.map->lhs)->type;
 
-       } else if (tmpl_is_xlat(c->data.map->lhs) || tmpl_is_exec(c->data.map->lhs)) {
+       } else if (tmpl_is_exec(c->data.map->lhs)) {
+               lhs_type = FR_TYPE_STRING;
+
+       } else if (tmpl_is_xlat(c->data.map->lhs) && (c->data.map->lhs->quote != T_BARE_WORD)) {
+               /*
+                *      bare xlats return a list of typed value-boxes.
+                *      We don't know those types until run-time.
+                */
                lhs_type = FR_TYPE_STRING;
 
        } else {
@@ -369,7 +376,14 @@ int fr_cond_promote_types(fr_cond_t *c, fr_sbuff_t *in, fr_sbuff_marker_t *m_lhs
        } else if (tmpl_is_attr(c->data.map->rhs)) {
                rhs_type = tmpl_da(c->data.map->rhs)->type;
 
-       } else if (tmpl_is_xlat(c->data.map->rhs) || tmpl_is_exec(c->data.map->rhs)) {  
+       } else if (tmpl_is_exec(c->data.map->rhs)) {
+               rhs_type = FR_TYPE_STRING;
+
+       } else if (tmpl_is_xlat(c->data.map->rhs) && (c->data.map->rhs->quote != T_BARE_WORD)) {
+               /*
+                *      bare xlats return a list of typed value-boxes.
+                *      We don't know those types until run-time.
+                */
                rhs_type = FR_TYPE_STRING;
 
        } else {