summaryrefslogtreecommitdiff
path: root/kpov_judge/tasks/ldap_search
diff options
context:
space:
mode:
Diffstat (limited to 'kpov_judge/tasks/ldap_search')
-rw-r--r--kpov_judge/tasks/ldap_search/task.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/kpov_judge/tasks/ldap_search/task.py b/kpov_judge/tasks/ldap_search/task.py
index 5612c01..bbc636f 100644
--- a/kpov_judge/tasks/ldap_search/task.py
+++ b/kpov_judge/tasks/ldap_search/task.py
@@ -153,6 +153,7 @@ def gen_params(user_id, params_meta):
def task_check(results, params):
import re
score = 0
+ hints = []
s = """.*dn: dc={DOMAIN},dc=kpov,dc=lusy,dc=fri,dc=uni-lj,dc=si\r
objectClass: top\r
objectClass: dcObject\r
@@ -163,27 +164,29 @@ objectClass: organization\r
if re.match(s, results['ldapsearch_before'], re.DOTALL):
score += 2
else:
- print (s, results['ldapsearch_before'])
+ hints += [s + str(results['ldapsearch_before'])]
s = ".*uid: {}.*".format(re.escape(params['LDAP_USERNAME']))
if re.search(s, results['ldapsearch_before']):
score += 2
else:
- print (s, results['ldapsearch_before'])
+ hints += [s + str(results['ldapsearch_before'])]
s = ".*uid: {0}.*description: {1}.*".format(
re.escape(params['LDAP_USERNAME']), re.escape(fortune[:40]))
if re.match(s, results['ldapsearch_after'], re.DOTALL):
score += 2
else:
- print (s, results['ldapsearch_after'])
+ hints += [s + str(results['ldapsearch_after'])]
if results['ldapsearch_before'][:100] == results['ldapsearch_after'][:100]:
score += 2
+ else:
+ hints += ["ldapsearch wrong"]
s = '.*\r\nmodifying entry "uid={LDAP_USERNAME},ou=Users,dc={DOMAIN},dc=kpov,dc=lusy,dc=fri,dc=uni-lj,dc=si".*'.format(
**params)
if re.match(s, results['modify'], re.DOTALL):
score += 2
else:
- print (s, results['modify'])
- return score
+ hints += [s + str(results['modify'])]
+ return score, hints
def prepare_disks(templates, params):
# d = templates['simpleArbiterDhcp']