\0 character at the end of the attibute value (authorization request)
Hi, Version: FreeRADIUS Version 3.0.13 Copyright (C) 1999-2017 The FreeRADIUS server project and contributors There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE You may redistribute copies of FreeRADIUS under the terms of the GNU General Public License For more information about these matters, see the file named COPYRIGHT Starting - reading configuration files ... Some client sends value + \0 character at the end of the attribute Calling-Station-Id (e.g. 421945411479\0 ). I am trying to fix / workaround this issue via unlang (in pre-proxy section): update { &proxy-request:Calling-Station-Id := "%{string:&proxy-request:Calling-Station-Id}" } Debug output: update { (0) EXPAND %{string:&proxy-request:Calling-Station-Id} (0) --> 421945411479 (0) &proxy-request:Calling-Station-Id := 421945411479 (0) } # update = noop Is it good approach ? I have tried also fix it via following peace of unlang code (doesnt work): if (&proxy-request:Calling-Station-Id && &proxy-request:Calling-Station-Id =~ /([0-9]+)/) { update { &proxy-request:Calling-Station-Id := "%{0}" } } Debug ouput: if (&proxy-request:Calling-Station-Id && &proxy-request:Calling-Station-Id =~ /([0-9]+)/) { (0) ERROR: regex failed: Found null in subject at offset 12. String unsafe for evaluation (0) ERROR: Failed retrieving values required to evaluate condition Could you please give me advice how to add \0 character at the end of the attribute value, if i want to send (test request) via radclient ? Thank you very much.
On Mar 24, 2017, at 3:15 AM, Peter Balsianok <balsianok.peter@gmail.com> wrote:
Some client sends value + \0 character at the end of the attribute Calling-Station-Id (e.g. 421945411479\0 ).
These clients are broken. The vendor should be named and shamed. This behaviour has been forbidden by the RFCs for 20 years. There is just no excuse for it.
I am trying to fix / workaround this issue via unlang (in pre-proxy section):
update { &proxy-request:Calling-Station-Id := "%{string:&proxy-request:Calling-Station-Id}" }
Debug output: update { (0) EXPAND %{string:&proxy-request:Calling-Station-Id} (0) --> 421945411479 (0) &proxy-request:Calling-Station-Id := 421945411479 (0) } # update = noop
Is it good approach ?
Yes.
Could you please give me advice how to add \0 character at the end of the attribute value, if i want to send (test request) via radclient ?
Add a \0. It should work. Alan DeKok.
participants (2)
-
Alan DeKok -
Peter Balsianok