From ca467c55d8bbd633870c1fcaff0677bc2c6eaa9f Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Sat, 29 Feb 2020 14:09:39 +0100 Subject: space_server: update to Fedora 31 --- roles/space_server/files/radius/assha.py | 4 ++-- .../files/radius/mods-available/python-assha | 17 ----------------- .../files/radius/mods-available/python3-assha | 15 +++++++++++++++ roles/space_server/files/radius/pythonpath.conf | 2 ++ .../files/radius/sites-available/labitat-inner | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 roles/space_server/files/radius/mods-available/python-assha create mode 100644 roles/space_server/files/radius/mods-available/python3-assha create mode 100755 roles/space_server/files/radius/pythonpath.conf (limited to 'roles/space_server/files/radius') diff --git a/roles/space_server/files/radius/assha.py b/roles/space_server/files/radius/assha.py index e34c382..6d81be1 100755 --- a/roles/space_server/files/radius/assha.py +++ b/roles/space_server/files/radius/assha.py @@ -10,7 +10,7 @@ REXP = re.compile('^([^ ]+) ASSHA-Password := "(.*)"$') def authorize(p): #radiusd.radlog(radiusd.L_INFO, '*** radlog call in authorize ***') reply = ( ('Reply-Message', 'Welcome to Labitat!'), ) - config = ( ('Auth-Type', 'python'), ) + config = ( ('Auth-Type', 'python3'), ) return (radiusd.RLM_MODULE_OK, reply, config) def load_users(): @@ -30,7 +30,7 @@ def check_pwd(user, pw): assha = users[user] crypted = assha[:40] salt = assha[40:] - h = hashlib.sha1('--%s--%s--' % (salt, pw)).hexdigest() + h = hashlib.sha1('--{}--{}--'.format(salt, pw).encode('utf-8')).hexdigest() return h == crypted def authenticate(p): diff --git a/roles/space_server/files/radius/mods-available/python-assha b/roles/space_server/files/radius/mods-available/python-assha deleted file mode 100644 index fa48e01..0000000 --- a/roles/space_server/files/radius/mods-available/python-assha +++ /dev/null @@ -1,17 +0,0 @@ -python { - python_path="/usr/lib/python27.zip:/usr/lib64/python2.7:/usr/lib64/python2.7/plat-linux2:/usr/lib64/python2.7/lib-tk:/usr/lib64/python2.7/lib-old:/usr/lib64/python2.7/lib-dynload:/usr/lib64/python2.7/site-packages:/usr/lib/python2.7/site-packages:/etc/raddb/mods-config/python/" - - module = assha - - #mod_instantiate = ${.module} - #func_instantiate = instantiate - - #mod_detach = ${.module} - #func_detach = instantiate - - mod_authorize = ${.module} - func_authorize = authorize - - mod_authenticate = ${.module} - func_authenticate = authenticate -} diff --git a/roles/space_server/files/radius/mods-available/python3-assha b/roles/space_server/files/radius/mods-available/python3-assha new file mode 100644 index 0000000..af3cf8c --- /dev/null +++ b/roles/space_server/files/radius/mods-available/python3-assha @@ -0,0 +1,15 @@ +python3 { + module = assha + + #mod_instantiate = ${.module} + #func_instantiate = instantiate + + #mod_detach = ${.module} + #func_detach = instantiate + + mod_authorize = ${.module} + func_authorize = authorize + + mod_authenticate = ${.module} + func_authenticate = authenticate +} diff --git a/roles/space_server/files/radius/pythonpath.conf b/roles/space_server/files/radius/pythonpath.conf new file mode 100755 index 0000000..6a7f6ba --- /dev/null +++ b/roles/space_server/files/radius/pythonpath.conf @@ -0,0 +1,2 @@ +[Service] +Environment=PYTHONPATH='/etc/raddb/mods-config/python3' diff --git a/roles/space_server/files/radius/sites-available/labitat-inner b/roles/space_server/files/radius/sites-available/labitat-inner index 8c099fc..d3ef9c2 100644 --- a/roles/space_server/files/radius/sites-available/labitat-inner +++ b/roles/space_server/files/radius/sites-available/labitat-inner @@ -13,7 +13,7 @@ server labitat-inner { ok = return } - python + python3 expiration logintime pap @@ -24,7 +24,7 @@ server labitat-inner { pap } - python + python3 eap } -- cgit v1.2.1