From: Arran Cudbard-Bell Date: Sat, 16 Oct 2021 03:24:38 +0000 (-0500) Subject: Add null to the type table so we can print it correctly X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7674cf8bda4ce0d6b0fd3c2fe864eeb1940863ec;p=thirdparty%2Ffreeradius-server.git Add null to the type table so we can print it correctly Don't add cast attribute for "null" --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index faf6eb98e76..5396f2743f4 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -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); diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 228583506b8..175323012ae 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -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 },