]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Various fixups for structural attributes
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 30 Nov 2020 03:46:06 +0000 (20:46 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 30 Nov 2020 03:46:06 +0000 (20:46 -0700)
src/lib/server/tmpl_tokenize.c
src/lib/unlang/compile.c
src/lib/util/dict_util.c

index 7ceec25426ad8c651684b14ec6b3d04cfe5e08de..476a1278556a891a75c4f39f5a404a1a771c9e5d 100644 (file)
@@ -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);
 
index 928e9e1d3b5ffca9ee66364196680d308d585759..0046ba9d2769b5f4c331b40539462404de7fa9b8 100644 (file)
@@ -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));
index 2ae6e49d493c9cebe06a1689042d0916051dc075..eceff536150c55e2171388b20c3deb5bee2d180a 100644 (file)
@@ -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
 };
 
 /*