python3-ldap > 4.0 (https://github.com/python-ldap/python-ldap/issues/399) changed the PostReadConrol to return bytes instead of str (as it doesn't know the encoding for attributes). We need to adjust S4-Connector and AD-Connector for this API change: diff --git services/univention-s4-connector/modules/univention/s4connector/__init__.py services/univention-s4-connector/modules/univention/s4connector/__init__.py index 1236edf63b..f349d7ce05 100644 --- services/univention-s4-connector/modules/univention/s4connector/__init__.py +++ services/univention-s4-connector/modules/univention/s4connector/__init__.py @@ -1193,8 +1193,8 @@ class ucs(object): if res: for c in response.get('ctrls', []): if c.controlType == PostReadControl.controlType: - entryUUID = c.entry['entryUUID'][0] - entryCSN = c.entry['entryCSN'][0] + entryUUID = c.entry['entryUUID'][0].decode('ASCII') + entryCSN = c.entry['entryCSN'][0].decode('ASCII') self._remember_entryCSN_commited_by_connector(entryUUID, entryCSN) res = True return res @@ -1216,8 +1216,8 @@ class ucs(object): if res: for c in response.get('ctrls', []): if c.controlType == PostReadControl.controlType: # If the modify actually did something - entryUUID = c.entry['entryUUID'][0] - entryCSN = c.entry['entryCSN'][0] + entryUUID = c.entry['entryUUID'][0].decode('ASCII') + entryCSN = c.entry['entryCSN'][0].decode('ASCII') self._remember_entryCSN_commited_by_connector(entryUUID, entryCSN) res = True return res diff --git services/univention-s4-connector/modules/univention/s4connector/s4/ntsecurity_descriptor.py services/univention-s4-connector/modules/univention/s4connector/s4/ntsecurity_descriptor.py index 97fe6a710c..2a5cffdc0e 100644 --- services/univention-s4-connector/modules/univention/s4connector/s4/ntsecurity_descriptor.py +++ services/univention-s4-connector/modules/univention/s4connector/s4/ntsecurity_descriptor.py @@ -132,6 +132,6 @@ def ntsd_to_ucs(s4connector, key, s4_object): s4connector.lo.lo.modify(ucs_dn, ml, serverctrls=serverctrls, response=response) for c in response.get('ctrls', []): # If the modify actually did something if c.controlType == PostReadControl.controlType: - entryUUID = c.entry['entryUUID'][0] - entryCSN = c.entry['entryCSN'][0] + entryUUID = c.entry['entryUUID'][0].decode('ASCII') + entryCSN = c.entry['entryCSN'][0].decode('ASCII') s4connector._remember_entryCSN_commited_by_connector(entryUUID, entryCSN)
univention-s4-connector.yaml fc82de78e09d | fix(s4c): Adjust post-read-control to decode values univention-s4-connector (14.0.15-4) fc82de78e09d | fix(s4c): Adjust post-read-control to decode values univention-ad-connector.yaml b2bcf1eb8a2e | fix(adc): Adjust to fixed post-read-control in python-ldap 4.0 univention-ad-connector (14.0.16-3) b2bcf1eb8a2e | fix(adc): Adjust to fixed post-read-control in python-ldap 4.0
Example traceback caused by this: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/s4connector/__init__.py", line 1486, in sync_to_ucs post_ucs_modify_function(self, property_type, object) File "/usr/lib/python3/dist-packages/univention/s4connector/s4/ntsecurity_descriptor.py", line 137, in ntsd_to_ucs s4connector._remember_entryCSN_commited_by_connector(entryUUID, entryCSN) File "/usr/lib/python3/dist-packages/univention/s4connector/__init__.py", line 621, in _remember_entryCSN_commited_by_connector entryCSN_set = set(value.split(',')) ^^^^^^^^^^^^^^^^ TypeError: a bytes-like object is required, not 'str'
OK
<https://errata.software-univention.de/#/?erratum=5.0x837> <https://errata.software-univention.de/#/?erratum=5.0x838>