freeradius-server
freeradius-server copied to clipboard
rlm_python can't create raw attributes
Issue type
- [X ] Defect - Unexpected behaviour (obvious or verified by project member).
Defect/Feature description
How to reproduce issue
have the python module return
reply:Attr-26 = 0x00000009010f54657374417474726962757465
Output of [radiusd|freeradius] -X showing issue occurring
Wed Aug 23 00:44:09 2017 : Debug: (0) agent_mod: Using thread state 0x563921b35680
Wed Aug 23 00:44:11 2017 : Debug: authenticate - Failed: 'reply:Attr-26' = '0x00000009010f54657374417474726962757465'
The issue seems to be that the module calls
tmpl_from_attr_str()to convert the LHS to a template containing list + attribute. *fr_pair_afrom_da()to create a VP fromtmpl.da*fr_pair_value_from_str()to add the value to the VP
In the first step, the tmpl_from_attr_str() is passed false for allow_unknown. Instead of erroring when given Attr-26, that function appears to return instead Vendor-Specific.
IIRC I wrote that part of the code, or rather copied it from rlm_perl. I wouldn't be surprised if rlm_perl has the same issue. And rlm_mruby