From ea685664b2648a9a4da8735085de2085af6af5ad Mon Sep 17 00:00:00 2001 From: "gs9857@student.uni-lj.si" Date: Fri, 19 Dec 2014 20:23:54 +0000 Subject: git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@104 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414 --- kpov_judge/tasks/radius_mysql_pam/task.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'kpov_judge/tasks') diff --git a/kpov_judge/tasks/radius_mysql_pam/task.py b/kpov_judge/tasks/radius_mysql_pam/task.py index c0372ea..85ba83b 100644 --- a/kpov_judge/tasks/radius_mysql_pam/task.py +++ b/kpov_judge/tasks/radius_mysql_pam/task.py @@ -69,6 +69,17 @@ def task(RADIUS_SECRET, RADIUS_USERNAME, RADIUS_PASSWORD, MYSQL_ADMIN_USER, MYSQ def gen_params(user_id, params_meta): params = dict() r = random.Random(user_id) + secrets = ['skupna', 'secret', 'skrivnost', 'mystery', 'tajna', 'skupnaskrivnost', 'nekadruga', 'spetnekaskrivnost'] + crke = list(string.ascii_lowercase) + for name, meta in param_meta.iteritems(): + params[name] = default_generators[meta.get('type', None](r) + params['RADIUS_SECRET'] = r.choice(secrets) + password = SQLpassword = "" + for i in range(4): + passowrd+=crke[randint(0,25)] + SQLpassword+=crke[randint(0,25)] + params['RADIUS_PASSWORD'] = password + params['MYSQL_ADMIN_PASSWORD'] = SQLpassword return params def task_check(results, params): -- cgit v1.2.1