@@ -467,28 +467,6 @@ static CC_HINT(nonnull) int xlat_tokenize_function_args(xlat_exp_head_t *head, f
467467 return 0 ;
468468}
469469
470- static int xlat_resolve_virtual_attribute (xlat_exp_t * node , tmpl_t * vpt )
471- {
472- xlat_t * func ;
473-
474- if (tmpl_is_attr (vpt )) {
475- func = xlat_func_find (tmpl_attr_tail_da (vpt )-> name , -1 );
476- } else {
477- func = xlat_func_find (tmpl_attr_tail_unresolved (vpt ), -1 );
478- }
479- if (!func ) return -1 ;
480-
481- xlat_exp_set_type (node , XLAT_VIRTUAL );
482- xlat_exp_set_name_shallow (node , vpt -> name );
483-
484- XLAT_DEBUG ("VIRTUAL <-- %pV" ,
485- fr_box_strvalue_len (vpt -> name , vpt -> len ));
486- node -> call .func = func ;
487- node -> flags = func -> flags ;
488-
489- return 0 ;
490- }
491-
492470/** Parse an attribute ref or a virtual attribute
493471 *
494472 */
@@ -553,11 +531,6 @@ static CC_HINT(nonnull(1,2,4)) ssize_t xlat_tokenize_attribute(xlat_exp_head_t *
553531 * Deal with unresolved attributes.
554532 */
555533 if (tmpl_is_attr_unresolved (vpt )) {
556- /*
557- * Could it be a virtual attribute?
558- */
559- if ((tmpl_attr_num_elements (vpt ) == 2 ) && (xlat_resolve_virtual_attribute (node , vpt ) == 0 )) goto done ;
560-
561534 if (!t_rules -> attr .allow_unresolved ) {
562535 talloc_free (vpt );
563536
@@ -569,21 +542,16 @@ static CC_HINT(nonnull(1,2,4)) ssize_t xlat_tokenize_attribute(xlat_exp_head_t *
569542 /*
570543 * Try to resolve it later
571544 */
572- xlat_exp_set_type (node , XLAT_TMPL );
573- xlat_exp_set_name_shallow (node , vpt -> name );
574- node -> vpt = vpt ;
575545 node -> flags .needs_resolving = true;
576-
577- } else {
578- /*
579- * Deal with normal attribute (or list)
580- */
581- xlat_exp_set_type (node , XLAT_TMPL );
582- xlat_exp_set_name_shallow (node , vpt -> name );
583- node -> vpt = vpt ;
584546 }
585547
586- done :
548+ /*
549+ * Deal with normal attribute (or list)
550+ */
551+ xlat_exp_set_type (node , XLAT_TMPL );
552+ xlat_exp_set_name_shallow (node , vpt -> name );
553+ node -> vpt = vpt ;
554+
587555 /*
588556 * Remember that it was %{User-Name}
589557 *
@@ -1029,11 +997,6 @@ static void _xlat_debug_node(xlat_exp_t const *node, int depth)
1029997 }
1030998 break ;
1031999
1032- case XLAT_VIRTUAL :
1033- fr_assert (node -> fmt != NULL );
1034- INFO_INDENT ("virtual (%s)" , node -> fmt );
1035- break ;
1036-
10371000 case XLAT_FUNC :
10381001 fr_assert (node -> call .func != NULL );
10391002 INFO_INDENT ("func (%s)" , node -> call .func -> name );
@@ -1270,14 +1233,12 @@ ssize_t xlat_print_node(fr_sbuff_t *out, xlat_exp_head_t const *head, xlat_exp_t
12701233 slen = tmpl_attr_print (out , node -> vpt , TMPL_ATTR_REF_PREFIX_NO );
12711234 if (slen < 0 ) return slen ;
12721235 break ;
1236+
12731237#ifdef HAVE_REGEX
12741238 case XLAT_REGEX :
12751239 FR_SBUFF_IN_SPRINTF_RETURN (out , "%i" , node -> regex_index );
12761240 break ;
12771241#endif
1278- case XLAT_VIRTUAL :
1279- FR_SBUFF_IN_BSTRCPY_BUFFER_RETURN (out , node -> call .func -> name );
1280- break ;
12811242
12821243 case XLAT_FUNC :
12831244 FR_SBUFF_IN_BSTRCPY_BUFFER_RETURN (out , node -> call .func -> name );
0 commit comments