From: Alan T. DeKok Date: Tue, 25 Nov 2025 21:57:02 +0000 (-0500) Subject: double-check and limit which type of attributes can have aliases X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b910ce288ca0176f9bf9d9e2fc13c87a645fcde3;p=thirdparty%2Ffreeradius-server.git double-check and limit which type of attributes can have aliases --- diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 2fbf8972137..f3b3df18379 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -1311,6 +1311,19 @@ int dict_attr_alias_add(fr_dict_attr_t const *parent, char const *alias, fr_dict fr_dict_attr_t *self; fr_hash_table_t *namespace; + switch (parent->type) { + case FR_TYPE_TLV: + case FR_TYPE_STRUCT: + case FR_TYPE_VENDOR: + case FR_TYPE_VSA: + break; + + default: + fr_strerror_printf("Cannot add ALIAS to %s of data type '%s'", + parent->name, fr_type_to_str(parent->type)); + return -1; + } + da = dict_attr_by_name(NULL, parent, alias); if (da) { fr_strerror_printf("ALIAS '%s' conflicts with another attribute in namespace %s",