]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
union types need a key field, so they must be MEMBERs
authorAlan T. DeKok <aland@freeradius.org>
Mon, 18 Aug 2025 10:54:31 +0000 (06:54 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 18 Aug 2025 18:45:52 +0000 (14:45 -0400)
src/lib/util/dict_tokenize.c

index d32f86805bea5fb89bdeb815f92c85160396a346..638d41f0851b006556f522f8f6b1532ac3ae23dd 100644 (file)
@@ -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
        /*