From: Alan T. DeKok Date: Mon, 18 Aug 2025 10:54:31 +0000 (-0400) Subject: union types need a key field, so they must be MEMBERs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec56212563ace145fb3dc0d4359952d8fd2ef934;p=thirdparty%2Ffreeradius-server.git union types need a key field, so they must be MEMBERs --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index d32f86805be..638d41f0851 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -1456,6 +1456,13 @@ static int dict_read_process_attribute(dict_tokenize_ctx_t *dctx, char **argv, i goto error; } + /* + * Unions need a key field. And key fields can only appear inside of a struct. + */ + if (da->type == FR_TYPE_UNION) { + fr_strerror_const("ATTRIBUTEs of type 'union' can only appear inside of a parent of type 'struct'"); + return -1; + } #ifdef WITH_DICTIONARY_WARNINGS /*