]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
parse-time errors are better than run-time asserts
authorAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2023 21:30:41 +0000 (17:30 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 19 Oct 2023 21:30:41 +0000 (17:30 -0400)
we don't support structural types on the RHS of maps, so don't
even try to parse them.  Just return an error

src/lib/server/map.c

index 09d05be3aa9f92161f601a45aac088879218ffba..8ff0c79a3c68a5bf9a5093eb606ed81d8cc4fdc0 100644 (file)
@@ -581,6 +581,10 @@ ssize_t map_afrom_substr(TALLOC_CTX *ctx, map_t **out, map_t **parent_p, fr_sbuf
                         */
                        if (map->op == T_OP_CMP_TRUE) goto parse_rhs;
 
+                       fr_strerror_const("Structural attributes are not supported");
+                       goto error;
+
+#if 0
                        /*
                         *      @todo - check for, and allow '&'
                         *      attribute references.  If found, then
@@ -621,6 +625,7 @@ ssize_t map_afrom_substr(TALLOC_CTX *ctx, map_t **out, map_t **parent_p, fr_sbuf
                         *      of the RHS parsing.
                         */
                        goto check_for_child;
+#endif
 
                default:
                        break;
@@ -709,7 +714,9 @@ parse_rhs:
                }
        }
 
+#if 0
 check_for_child:
+#endif
        /*
         *      Add this map to to the parents list.  Note that the
         *      caller will have to check for this!