mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-25 08:23:46 +00:00
Fix bug, empèche le crash de freeradius si login non ascii
This commit is contained in:
parent
bc724c3a25
commit
e1cee045c2
1 changed files with 3 additions and 2 deletions
|
@ -154,12 +154,13 @@ 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
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue