]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow non-leaf types to have groups of sub-things
authorAlan T. DeKok <aland@freeradius.org>
Thu, 8 Apr 2021 19:08:48 +0000 (15:08 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 8 Apr 2021 19:08:48 +0000 (15:08 -0400)
TBH, this should really be only for specific types which are
supported

src/lib/util/pair_legacy.c

index 68dc5cd33bb28adecf4877596880552cb8383bb9..0bc6a4746a57c5b3264d93cef4f5c54a9a37366e 100644 (file)
@@ -376,7 +376,11 @@ static ssize_t fr_pair_list_afrom_substr(TALLOC_CTX *ctx, fr_dict_attr_t const *
                /*
                 *      Allow grouping attributes.
                 */
-               if ((da->type == FR_TYPE_GROUP) || (da->type == FR_TYPE_TLV) || (da->type == FR_TYPE_STRUCT)) {
+               switch (da->type) {
+                       fr_token_t quote;
+                       char const *q;
+
+               case FR_TYPE_NON_LEAF:
                        if (*p != '{') {
                                fr_strerror_printf("Group list for %s MUST start with '{'", da->name);
                                goto error;
@@ -409,11 +413,9 @@ static ssize_t fr_pair_list_afrom_substr(TALLOC_CTX *ctx, fr_dict_attr_t const *
                        fr_skip_whitespace(p);
                        if (*p != '}') goto failed_group;
                        p++;
+                       break;
 
-               } else {
-                       fr_token_t quote;
-                       char const *q;
-
+               case FR_TYPE_LEAF:
                        /*
                         *      Get the RHS thing.
                         */