]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
over-ride "raw.Foo = { ... }"
authorAlan T. DeKok <aland@freeradius.org>
Mon, 3 Mar 2025 01:23:49 +0000 (20:23 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 3 Mar 2025 02:51:12 +0000 (21:51 -0500)
use the original data type, and not a hard-coded TLV

the parser can't tell the difference between "raw.1 = {...}"
and "raw.Foo = {...}", so we just fix the data type after the
fact.

src/lib/util/pair_legacy.c

index 01c6e12e07e3775ea9261dda5dbd129aa6cd7afd..01d0a1babbb3eb49241728ba19c28b60c3dc9f6d 100644 (file)
@@ -387,6 +387,17 @@ redo:
                        if (internal) {
                                slen = fr_dict_oid_component(&err, &da, internal, &our_in, &bareword_terminals);
                        }
+
+               } else if (raw && fr_type_is_structural(da->type) && (raw_type != FR_TYPE_OCTETS)) {
+                       /*
+                        *      We were asked to do a "raw" thing, but we found a known attribute matching
+                        *      that description.
+                        *
+                        *      @todo - this is only allowed because we can't distinguish between "raw.1" and
+                        *      "raw.User-Name".
+                        */
+                       raw = false;
+                       raw_type = FR_TYPE_NULL;
                }
 
                if (err != FR_DICT_ATTR_OK) {