From 3dc74e20777c1b028566662ada390c0528fed76f Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Sun, 2 Mar 2025 20:23:49 -0500 Subject: [PATCH] over-ride "raw.Foo = { ... }" 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/util/pair_legacy.c b/src/lib/util/pair_legacy.c index 01c6e12e07..01d0a1babb 100644 --- a/src/lib/util/pair_legacy.c +++ b/src/lib/util/pair_legacy.c @@ -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) { -- 2.47.2