Bug 55671 - Prevent or encode colons in exam names to prevent invalid ucsschoolRole value
Prevent or encode colons in exam names to prevent invalid ucsschoolRole value
Status: CLOSED WONTFIX
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on: 55768
Blocks:
  Show dependency treegraph
 
Reported: 2023-02-13 16:09 CET by Christina Scheinig
Modified: 2023-05-11 08:52 CEST (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.343
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023020821000481
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2023-02-13 16:09:36 CET
07.02.23 10:14:15.578  MODULE      ( PROCESS ) : _thread:646  start_exam() Requesting exam user 04/26 to be created: u'uid=schein.c,cn=schueler,cn=users,ou=sun,dc=schule,dc=schein'
07.02.23 10:14:15.578  MODULE      ( PROCESS ) : info:75  Vorbereitung der Klassenarbeitskonten - (04/26) Charly, Schein (schein.c)
07.02.23 10:14:15.703  MODULE      ( WARN    ) : _thread:670  start_exam() Could not create exam user account for u'uid=kimberleyn.b,cn=schueler,cn=users,ou=bk191796,dc=schule,dc=koeln': 591 on master.schule.koeln (command/schoolexam-master/create-exam-user): {u'status': 591, u'message': u'Interner Server-Fehler in "schoolexam-master/create-exam-user".', u'location': u'https://master.schule.schein/univention/command'}
Interner Server-Fehler in "schoolexam-master/create-exam-user".
Request: schoolexam-master/create-exam-user

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 359, in __error_handling
    six.reraise(etype, exc, etraceback)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/base.py", line 262, in execute
    function.__func__(self, request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/decorators.py", line 181, in _response
    return function(self, request)
  File "/usr/lib/python2.7/dist-packages/ucsschool/lib/school_umc_ldap_connection.py", line 145, in wrapper_func
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/univention/management/console/modules/schoolexam-master/__init__.py", line 265, in create_exam_user
    ldap_admin_write, filter_format("uid=%s", (exam_user_uid,))
  File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/base.py", line 1186, in get_only_udm_obj
    validate(obj, cls.logger)
  File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/validator.py", line 498, in validate
    errors = validation_class.validate(dict_obj)
  File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/validator.py", line 319, in validate
    errors = super(ExamStudentValidator, cls).validate(obj)
  File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/validator.py", line 182, in validate
    errors.append(cls.validate_part_of_school(roles, schools))
  File "/usr/lib/python2.7/dist-packages/ucsschool/lib/models/validator.py", line 228, in validate_part_of_school
    missing_schools = set([s for r, c, s in roles if c == "school" and s.lower() not in schools])
ValueError: too many values to unpack
------------------------

There are existing exam-users, which have these ucschoolRoles from a previous exam start, which was named 12:20

  ucsschoolRole: exam_user:school:sun
  ucsschoolRole: exam_user:exam:12:20-sun

------------------------
This is a problem: exam_user:exam:12:20-sun. When split by : it'll create 4 strings instead of 3.

Versions:
Schoolslave
:~ # univention-app info
UCS: 4.4-9 errata1280
Master
:~ # univention-app info
UCS: 4.4-9 errata1355
Comment 1 Daniel Tröder univentionstaff 2023-02-14 06:41:37 CET
We should either disallow colons in exam names or encode them with another character, so that the 3 parts of a ucsschoolRole never contain a colon.
Comment 4 Jan-Luca Kiok univentionstaff 2023-05-11 08:52:35 CEST
This issue has been filed against UCS 4.4.

UCS 4.4 is out of maintenance and UCS components may have vastly changed in later releases. Thus, this issue is now being closed.

With https://forge.univention.org/bugzilla/show_bug.cgi?id=55768 a fix for UCS 5 was implemented, therefore this issue should not affect the current version anymore.