]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
structs are allowed, not disallowed
authorAlan T. DeKok <aland@freeradius.org>
Mon, 30 Nov 2020 14:20:12 +0000 (09:20 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 30 Nov 2020 14:20:12 +0000 (09:20 -0500)
src/lib/unlang/compile.c

index 0046ba9d2769b5f4c331b40539462404de7fa9b8..3435c36223025e69ec9e9783a00488c91a03de29 100644 (file)
@@ -610,21 +610,26 @@ static bool pass2_fixup_update_map(map_t *map, tmpl_rules_t const *rules, fr_dic
         *      Sanity check sublists.
         */
        if (map->child) {
+               fr_dict_attr_t const *da;
+
                if (!tmpl_is_attr(map->lhs)) {
                        cf_log_err(map->ci, "Sublists can only be assigned to a known attribute");
                        return false;
                }
 
-               switch (tmpl_da(map->lhs)->type) {
+               da = tmpl_da(map->lhs);
+
+               switch (da->type) {
                case FR_TYPE_STRUCTURAL:
-                       cf_log_err(map->ci, "Sublists can only be assigned to structural attributes");
-                       return false;
+                       break;
 
                default:
-                       break;
+                       cf_log_err(map->ci, "Sublists can only be assigned to structural attributes, not to type %s",
+                               fr_table_str_by_value(fr_value_box_type_table, da->type, "<INVALID>"));
+                       return false;
                }
 
-               return pass2_fixup_update_map(map->child, rules, tmpl_da(map->lhs));
+               return pass2_fixup_update_map(map->child, rules, da);
        }
 
        return true;