Skip to content

Commit

Permalink
attribute tmpls can only be bare words
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Sep 4, 2023
1 parent 232c913 commit 54b71c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/server/tmpl_tokenize.c
Original file line number Diff line number Diff line change
Expand Up @@ -3934,13 +3934,15 @@ int tmpl_resolve(tmpl_t *vpt, tmpl_res_rules_t const *tr_rules)
} else if (tmpl_contains_attr(vpt)) {
fr_type_t dst_type = tmpl_rules_cast(vpt);

fr_assert(vpt->quote == T_BARE_WORD); /* 'User-Name' or "User-Name" is not allowed. */

ret = tmpl_attr_resolve(vpt, tr_rules);
if (ret < 0) return ret;

if (dst_type == tmpl_attr_tail_da(vpt)->type) {
vpt->rules.cast = FR_TYPE_NULL;
}

}
/*
* Convert unresolved tmpls int enumvs, or failing that, string values.
*/
Expand Down

0 comments on commit 54b71c9

Please sign in to comment.