From: Arran Cudbard-Bell Date: Mon, 30 Nov 2020 03:46:06 +0000 (-0700) Subject: Various fixups for structural attributes X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8478be853a227b2b2a11a80504cae730bf084b65;p=thirdparty%2Ffreeradius-server.git Various fixups for structural attributes --- diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index 7ceec25426a..476a1278556 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -4052,7 +4052,7 @@ void tmpl_verify(char const *file, int line, tmpl_t const *vpt) } break; - case FR_TYPE_TLV: + case FR_TYPE_STRUCTURAL: fr_fatal_assert_fail("CONSISTENCY CHECK FAILED %s[%u]: TMPL_TYPE_DATA is of type TLV", file, line); diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 928e9e1d3b5..0046ba9d276 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -615,10 +615,13 @@ static bool pass2_fixup_update_map(map_t *map, tmpl_rules_t const *rules, fr_dic return false; } - if ((tmpl_da(map->lhs)->type != FR_TYPE_GROUP) && - (tmpl_da(map->lhs)->type != FR_TYPE_TLV)) { - cf_log_err(map->ci, "Sublists can only be assigned to attributes of type 'group' or 'tlv'"); + switch (tmpl_da(map->lhs)->type) { + case FR_TYPE_STRUCTURAL: + cf_log_err(map->ci, "Sublists can only be assigned to structural attributes"); return false; + + default: + break; } return pass2_fixup_update_map(map->child, rules, tmpl_da(map->lhs)); diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 2ae6e49d493..eceff536150 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -116,10 +116,11 @@ bool const fr_dict_attr_allowed_chars[UINT8_MAX + 1] = { * */ bool const fr_dict_non_data_types[FR_TYPE_MAX + 1] = { - [FR_TYPE_TLV] = true, + [FR_TYPE_GROUP] = true, [FR_TYPE_STRUCT] = true, - [FR_TYPE_VSA] = true, - [FR_TYPE_VENDOR] = true + [FR_TYPE_TLV] = true, + [FR_TYPE_VENDOR] = true, + [FR_TYPE_VSA] = true }; /*