From: Alan T. DeKok Date: Mon, 4 Sep 2023 19:50:10 +0000 (-0400) Subject: add unknown only if the LHS is unknown X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03e4c560e6b756f2293a932e136d841f9da37773;p=thirdparty%2Ffreeradius-server.git add unknown only if the LHS is unknown and assert that the LHS is an attribute, which it should be for being a bare word --- diff --git a/src/lib/server/map.c b/src/lib/server/map.c index 4c43f1955d8..e3cc8cedf58 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -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