From: Alan T. DeKok Date: Thu, 8 Apr 2021 19:08:48 +0000 (-0400) Subject: allow non-leaf types to have groups of sub-things X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5117d121796fa6859eaebaf30aaf4b1e28080d0;p=thirdparty%2Ffreeradius-server.git allow non-leaf types to have groups of sub-things TBH, this should really be only for specific types which are supported --- diff --git a/src/lib/util/pair_legacy.c b/src/lib/util/pair_legacy.c index 68dc5cd33b..0bc6a4746a 100644 --- a/src/lib/util/pair_legacy.c +++ b/src/lib/util/pair_legacy.c @@ -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. */