]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add null to the type table so we can print it correctly
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 16 Oct 2021 03:24:38 +0000 (22:24 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 19 Oct 2021 18:30:42 +0000 (13:30 -0500)
Don't add cast attribute for "null"

src/lib/util/dict_tokenize.c
src/lib/util/value.c

index faf6eb98e76c2f3ac8f00a5e5a9caa938aa7f52c..5396f2743f4e45b27beb2d99d1f8124d6a465db2 100644 (file)
@@ -2581,7 +2581,11 @@ int fr_dict_internal_afrom_file(fr_dict_t **out, char const *dict_subdir, char c
                fr_dict_attr_t                  *n;
                fr_table_num_ordered_t const    *p = &fr_value_box_type_table[i];
 
-               if (p->value == FR_TYPE_VENDOR) continue;       /* These can't exist in the root */
+               switch (p->value) {
+               case FR_TYPE_NULL:      /* Can't cast to NULL */
+               case FR_TYPE_VENDOR:    /* Vendors can't exist in dictionaries as attributes */
+                       continue;
+               }
 
                type_name = talloc_typed_asprintf(NULL, "Tmp-Cast-%s", p->name.str);
 
index 228583506b8a9cb68e78d5c70ab7e7c784970426..175323012aef7e0246c117688be6fdc1767067bf 100644 (file)
@@ -102,6 +102,7 @@ static_assert(SIZEOF_MEMBER(fr_value_box_t, vb_float64) == 8,
 /** Map data types to names representing those types
  */
 fr_table_num_ordered_t const fr_value_box_type_table[] = {
+       { L("null"),            FR_TYPE_NULL            },
        { L("string"),          FR_TYPE_STRING          },
        { L("octets"),          FR_TYPE_OCTETS          },