mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:22:26 +00:00
Fix bug, empèche le crash de freeradius si login non ascii
This commit is contained in:
parent
cd7fab5edf
commit
70f5d55667
1 changed files with 3 additions and 2 deletions
|
@ -154,11 +154,12 @@ def authorize(data):
|
||||||
else:
|
else:
|
||||||
nas_type = None
|
nas_type = None
|
||||||
if not nas_type or nas_type.port_access_mode == '802.1X':
|
if not nas_type or nas_type.port_access_mode == '802.1X':
|
||||||
user = data.get('User-Name', '')
|
user = data.get('User-Name', '').decode('utf-8', errors='replace')
|
||||||
user = user.split('@', 1)[0]
|
user = user.split('@', 1)[0]
|
||||||
mac = data.get('Calling-Station-Id', '')
|
mac = data.get('Calling-Station-Id', '')
|
||||||
result, log, password = check_user_machine_and_register(nas_type, user, mac)
|
result, log, password = check_user_machine_and_register(nas_type, user, mac)
|
||||||
logger.info(log.encode('utf-8'))
|
logger.info(log.encode('utf-8'))
|
||||||
|
logger.info(user.encode('utf-8'))
|
||||||
|
|
||||||
if not result:
|
if not result:
|
||||||
return radiusd.RLM_MODULE_REJECT
|
return radiusd.RLM_MODULE_REJECT
|
||||||
|
|
Loading…
Reference in a new issue