diff options
Diffstat (limited to 'kpov_judge/tasks/ldap_search')
-rw-r--r-- | kpov_judge/tasks/ldap_search/task.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/kpov_judge/tasks/ldap_search/task.py b/kpov_judge/tasks/ldap_search/task.py index 886bf07..43704e3 100644 --- a/kpov_judge/tasks/ldap_search/task.py +++ b/kpov_judge/tasks/ldap_search/task.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# kpov_random_helpers should be imported by add_assignment.py +# kpov_util should be imported by add_assignment.py # Poveži se na strežnik LDAP prek spletnega vmesnika. Ustvari uporabnika z danim imenom in geslom. # Napiši skripto, ki izpiše podatke o tem uporabniku z ldapsearch. # @@ -118,7 +118,7 @@ def task(LDAP_IP, DOMAIN, LDAP_USERNAME, LDAP_PASSWORD, BIND_USERNAME, BIND_PASS s = "ldapmodify -D {BIND_DN} -w {BIND_PASSWORD} -h {LDAP_IP}".format( **locals()) modify = pexpect.spawn(s) - FORTUNE = kpov_random_helpers.hostname_gen(random.Random(str(LDAP_USERNAME))) + FORTUNE = kpov_util.hostname_gen(random.Random(str(LDAP_USERNAME))) results['fortune'] = FORTUNE s1 = """ dn: cn={LDAP_USERNAME},ou=Users,{FULLDOMAIN} @@ -138,11 +138,11 @@ description: {FORTUNE} def gen_params(user_id, params_meta): params = dict() r = random.Random(user_id) - params['DOMAIN'] = kpov_random_helpers.hostname_gen(r) - params['LDAP_USERNAME'] = kpov_random_helpers.username_gen(r) - params['LDAP_PASSWORD'] = kpov_random_helpers.alnum_gen(r, 6) - params['BIND_USERNAME'] = kpov_random_helpers.username_gen(r) - params['BIND_PASSWORD'] = kpov_random_helpers.alnum_gen(r, 6) + params['DOMAIN'] = kpov_util.hostname_gen(r) + params['LDAP_USERNAME'] = kpov_util.username_gen(r) + params['LDAP_PASSWORD'] = kpov_util.alnum_gen(r, 6) + params['BIND_USERNAME'] = kpov_util.username_gen(r) + params['BIND_PASSWORD'] = kpov_util.alnum_gen(r, 6) return params def task_check(results, params): @@ -164,7 +164,7 @@ objectClass: organization\r score += 2 else: hints += ["LDAP_USERNAME missing in: " + s + str(results['ldapsearch_before'])] - fortune = kpov_random_helpers.hostname_gen(random.Random(str(params['LDAP_USERNAME']))) + fortune = kpov_util.hostname_gen(random.Random(str(params['LDAP_USERNAME']))) s = ".*cn: {0}.*description: {1}.*".format( re.escape(params['LDAP_USERNAME']), re.escape(fortune)) if re.match(s, results['ldapsearch_after'], re.DOTALL): |