]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add unknown only if the LHS is unknown
authorAlan T. DeKok <aland@freeradius.org>
Mon, 4 Sep 2023 19:50:10 +0000 (15:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 5 Sep 2023 13:29:50 +0000 (09:29 -0400)
and assert that the LHS is an attribute, which it should be for
being a bare word

src/lib/server/map.c

index 4c43f1955d8ac89a9d821a0832aa9ab918983bf0..e3cc8cedf58625b8c0c4851732bec89ae38643c7 100644 (file)
@@ -176,11 +176,13 @@ int map_afrom_cp(TALLOC_CTX *ctx, map_t **out, map_t *parent, CONF_PAIR *cp,
                        goto marker;
                }
 
-               if (tmpl_is_attr(map->lhs) && tmpl_attr_unknown_add(map->lhs) < 0) {
+               if (tmpl_attr_tail_is_unknown(map->lhs) && tmpl_attr_unknown_add(map->lhs) < 0) {
                        cf_log_perr(cp, "Failed creating attribute %s", map->lhs->name);
                        goto error;
                }
 
+               fr_assert(tmpl_is_attr(map->lhs));
+
                /*
                 *      The caller wants the RHS attributes to be
                 *      parsed in the context of the LHS, but only if