diff options
Diffstat (limited to 'kpov_judge')
-rw-r--r-- | kpov_judge/tasks/radius_mysql_pam/task.py | 11 |
1 files changed, 11 insertions, 0 deletions
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): |