Bug 53927 - [udm computers] displayName is not ASCII-only
[udm computers] displayName is not ASCII-only
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: Esteban
Florian Best
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-15 12:30 CEST by Florian Best
Modified: 2021-10-20 17:31 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Internationalization, Regression
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-10-15 12:30:24 CEST
The LDAP attribute displayName has the LDAP syntax Directory String ("1.3.6.1.4.1.1466.115.121.1.15") which is UTF-8 capable.

git:df0828a774451712c6f4d5f8b24c5da418c070f5 encoded the value in ASCII.

management/univention-directory-manager-modules/modules/univention/admin/handlers/computers/__base.py
+                       al.append(('displayName', self.info['name'].encode('ASCII')))
+                       ml.append(('displayName', b'', self.info['name'].encode('ASCII')))

Traceback (most recent call last):
  File "<stdin>"
    udm_obj.create()
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 543, in create
    dn = self._create(response=response, serverctrls=serverctrls)
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 1254, in _create
    al = self._ldap_addlist()
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/computers/__base.py", line 157, in _ldap_addlist
    al.append(('displayName', self.info['name'].encode('ASCII')))
UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 1: ordinal not in range(128)
Comment 1 Esteban univentionstaff 2021-10-15 16:54:26 CEST
There was a bug because the displayName of computers in `management/univention-directory-manager-modules/modules/univention/admin/handlers/computers/__base.py` file was encoded as ASCII and must be encoded as utf-8

Three lines were changed to be encoded now as utf-8 for the displayName field.

univention-directory-manager-modules.yaml
d571808910a0 | Bug #53927:  Fixed problem with ASCII encoding of displayName of computers
2c0dfa74f63d | Bug #53927:  Fixed problem with ASCII encoding of displayName of computers

univention-directory-manager-modules (15.0.11-25)
2c0dfa74f63d | Bug #53927:  Fixed problem with ASCII encoding of displayName of computers
Comment 2 Florian Best univentionstaff 2021-10-18 10:20:08 CEST
The same also applies to the krb5PrincipalName, which is a Octet String (1.3.6.1.4.1.1466.115.121.1.40):

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/notifier/threads.py", line 80, in _run
    result = self._function()
  File "/usr/lib/python3/dist-packages/notifier/__init__.py", line 105, in __call__
    return self._function(*tmp, **self._kwargs)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/udm/__init__.py", line 442, in _thread
    module.modify(properties)
  File "/usr/lib/python3/dist-packages/univention/management/console/modules/udm/udm_ldap.py", line 649, in modify
    obj.modify()
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 636, in modify
    dn = self._modify(modify_childs, ignore_license=ignore_license, response=response)
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/__init__.py", line 1340, in _modify
    ml = self._ldap_modlist()
  File "/usr/lib/python3/dist-packages/univention/admin/handlers/computers/__base.py", line 241, in _ldap_modlist
    ml.append(('krb5PrincipalName', self.oldattr.get('krb5PrincipalName', []), [self.krb5_principal().encode('ASCII')]))
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 11: ordinal not in range(128)
Comment 3 Esteban univentionstaff 2021-10-18 13:01:50 CEST
Fix also applied for `krb5PrincipalName`

eeac59c39302 | Bug #53927: update YAML for univention-directory-manager-modules
98cbc3dc8234 | Bug #53927:  Fixed problem with ASCII encoding of krb5PrincipalName of computers
Comment 4 Florian Best univentionstaff 2021-10-20 01:10:46 CEST
OK: displayName, krb5PrincipalName
OK: YAML