From 70f5d55667d73a2d92bbba7f579612ef94f6b4b0 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sat, 11 Nov 2017 18:06:50 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20bug,=20emp=C3=A8che=20le=20crash=20de=20f?= =?UTF-8?q?reeradius=20si=20login=20non=20ascii?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- freeradius_utils/auth.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/freeradius_utils/auth.py b/freeradius_utils/auth.py index 16f3f084..88bee71e 100644 --- a/freeradius_utils/auth.py +++ b/freeradius_utils/auth.py @@ -154,12 +154,13 @@ def authorize(data): else: nas_type = None 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] mac = data.get('Calling-Station-Id', '') result, log, password = check_user_machine_and_register(nas_type, user, mac) logger.info(log.encode('utf-8')) - + logger.info(user.encode('utf-8')) + if not result: return radiusd.RLM_MODULE_REJECT else: