Bug 50009 - Computerroom "crashes" when a roomname contains umlauts
Computerroom "crashes" when a roomname contains umlauts
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Computer room
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v3-errata
Assigned To: Jürn Brodersen
Sönke Schwardt-Krummrich
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-14 15:17 CEST by Christina Scheinig
Modified: 2019-09-26 10:32 CEST (History)
5 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key 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.429
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support: Yes
Flags outvoted (downgraded) after PO Review:
Ticket number: 2019081421000608
Bug group (optional): External feedback, Regression
Max CVSS v3 score:


Attachments
first message (47.81 KB, image/png)
2019-08-14 15:19 CEST, Christina Scheinig
Details
second message (70.21 KB, image/png)
2019-08-14 15:19 CEST, Christina Scheinig
Details
hotfix (1.18 KB, patch)
2019-08-14 15:32 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2019-08-14 15:17:55 CEST
A customer reported that computerroom "crashes" when a roomname contains umlauts.

The logfile shows:
14.08.19 15:06:26.950  MAIN        ( PROCESS ) : LDAP bind for user u'uid=Administrator,cn=users,dc=schein,dc=me'.
14.08.19 15:07:49.112  MODULE      ( PROCESS ) : Invalid room DN: cn=sun-überraum,cn=raeume,cn=groups,ou=sun,dc=schein,dc=me
14.08.19 15:08:37.302  MODULE      ( PROCESS ) : Invalid room DN: cn=sun-überraum,cn=raeume,cn=groups,ou=sun,dc=schein,dc=me
14.08.19 15:10:24.433  MODULE      ( PROCESS ) : Invalid room DN: cn=sun-überraum,cn=raeume,cn=groups,ou=sun,dc=schein,dc=me
14.08.19 15:17:02.506  MODULE      ( PROCESS ) : Invalid room DN: cn=sun-räume,cn=raeume,cn=groups,ou=sun,dc=schein,dc=me
Comment 1 Christina Scheinig univentionstaff 2019-08-14 15:19:18 CEST
Created attachment 10158 [details]
first message
Comment 2 Christina Scheinig univentionstaff 2019-08-14 15:19:36 CEST
Created attachment 10159 [details]
second message
Comment 3 Christina Scheinig univentionstaff 2019-08-14 15:20:29 CEST
How to reproduce:
Add a room with umlauts, and then access the education → computers room
Comment 4 Christina Scheinig univentionstaff 2019-08-14 15:21:37 CEST
The customer needs a patch asap, because school starts tomorrow
Comment 5 Florian Best univentionstaff 2019-08-14 15:21:55 CEST
Regression caused by Bug #43039.
Comment 6 Florian Best univentionstaff 2019-08-14 15:32:12 CEST
Created attachment 10160 [details]
hotfix

hotfix for /usr/share/pyshares/univention/management/console/modules/computerroom/__init__.py.

Probably not suitable for the product.
Comment 7 Florian Best univentionstaff 2019-08-14 15:33:19 CEST
(In reply to Florian Best from comment #6)
> Created attachment 10160 [details]
> hotfix
> 
> hotfix for
> /usr/share/pyshares/univention/management/console/modules/computerroom/
> __init__.py.
> 
> Probably not suitable for the product.
Correct path:
/usr/share/pyshared/univention/management/console/modules/computerroom/__init__.py
Comment 8 Jürn Brodersen univentionstaff 2019-08-14 19:11:45 CEST
the ou part is also wrong
Comment 9 Christina Scheinig univentionstaff 2019-08-14 19:12:24 CEST
root@dc1:/usr/share/pyshared/univention/management/console/modules/computerroom# diff __init__.py{,.orig}
83c83
< ROOM_DN_REGEX_TEMPLATE = r'cn=([\w0-9_][\w0-9. _-]+?[\w0-9_]+?),cn={container},cn=groups,ou=([\w0-9_]+?),{ldap_base}'
---
> ROOM_DN_REGEX_TEMPLATE = r'cn=([a-zA-Z0-9_][a-zA-Z0-9. _-]+?[a-zA-Z0-9_]+?),cn={container},cn=groups,ou=(\w+?),{ldap_base}'
85,86c85
< 	container=ucr.get('ucsschool/ldap/default/container/rooms', 'raeume'), ldap_base=ucr['ldap/base']), flags=re.U))
< 
---
> 	container=ucr.get('ucsschool/ldap/default/container/rooms', 'raeume'), ldap_base=ucr['ldap/base'])))
249,250d247
< 		if type(value) == str:
< 			value = unicode(value)
257c254
< 			raise UMC_Error(_('Invalid room DN: %s') % (value, ))
---
> 			raise UMC_Error(_('Invalid room DN: %s') % value)
Comment 10 Jürn Brodersen univentionstaff 2019-09-19 20:44:36 CEST
[4.4 472ba079d] Bug #50009: Fix computerroom crash with umlauts
[4.4 0c5fb4870] Bug #50009: yaml

Package: ucs-school-umc-computerroom
Version: 11.0.0-6A~4.4.0.201909192040
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 11 Sönke Schwardt-Krummrich univentionstaff 2019-09-20 17:48:20 CEST
Tested the ucs-test script 22_computerroom_local_file_exploit with the old and the fixed version of the computerroom module. Also manual tests were performed. Works like a charm.

OK: code change
OK: installation
OK: update
OK: ucs-test
OK: changelog entry
~OK: advisory
OK: functional change
OK: package built and installable
Comment 12 Sönke Schwardt-Krummrich univentionstaff 2019-09-26 10:32:49 CEST
UCS@school 4.4 v3 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v3-de.html

If this error occurs again, please clone this bug.