Univention Bugzilla – Bug 53927
[udm computers] displayName is not ASCII-only
Last modified: 2021-10-20 17:31:10 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)
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
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)
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
OK: displayName, krb5PrincipalName OK: YAML
<https://errata.software-univention.de/#/?erratum=5.0x128>