]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Revert "try to parse things inside of a {...} block"
authorAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2023 21:29:10 +0000 (17:29 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2023 21:29:10 +0000 (17:29 -0400)
This reverts commit 1a9970927eef06a6a05e5087bf95047b31c68fa8.

nope, the evaluator doesn't like structural RHS

src/lib/server/map.c

index 86f6d66ccebe9651de6991b9b99c36b2d1ea83d3..09d05be3aa9f92161f601a45aac088879218ffba 100644 (file)
@@ -412,9 +412,7 @@ ssize_t map_afrom_substr(TALLOC_CTX *ctx, map_t **out, map_t **parent_p, fr_sbuf
        fr_sbuff_t                      our_in = FR_SBUFF(in);
        fr_sbuff_marker_t               m_lhs, m_rhs, m_op;
        fr_sbuff_term_t const           *tt = p_rules ? p_rules->terminals : NULL;
-       map_t                           *parent, *new_parent, *child;
-       tmpl_rules_t                    our_lhs_rules;
-
+       map_t                           *parent, *new_parent;
 
        if (parent_p) {
                new_parent = parent = *parent_p;
@@ -442,6 +440,8 @@ ssize_t map_afrom_substr(TALLOC_CTX *ctx, map_t **out, map_t **parent_p, fr_sbuf
 
        default:
        {
+               tmpl_rules_t our_lhs_rules;
+
                if (lhs_rules) {
                        our_lhs_rules = *lhs_rules;
                } else {
@@ -594,26 +594,6 @@ ssize_t map_afrom_substr(TALLOC_CTX *ctx, map_t **out, map_t **parent_p, fr_sbuf
 
                        fr_sbuff_adv_past_whitespace(&our_in, SIZE_MAX, tt);
 
-                       if (lhs_rules) {
-                               our_lhs_rules = *lhs_rules;
-                       } else {
-                               memset(&our_lhs_rules, 0, sizeof(our_lhs_rules));
-                       }
-                       our_lhs_rules.attr.namespace = tmpl_attr_tail_da(map->lhs);
-
-                       if (map_afrom_attr_str(map, &child, fr_sbuff_current(&our_in), &our_lhs_rules, rhs_rules) < 0) {
-                               fr_sbuff_set(&our_in, &m_rhs);
-                               fr_strerror_const("Failed parsing map contents");
-                               goto error;
-                       }
-                       map_list_insert_tail(&map->child, child);
-
-                       /*
-                        *      @todo - check for commas and repeat?
-                        */
-
-                       fr_sbuff_adv_past_whitespace(&our_in, SIZE_MAX, tt);
-
                        /*
                         *      Peek at the next character.  If it's
                         *      '}', stop.  Otherwise, call ourselves