Univention Bugzilla – Bug 56514
removing accountActivationDate causes LDAP Error: No such attribute: modify/delete: krb5ValidStart: no such value.
Last modified: 2023-10-11 16:36:29 CEST
In UCS 5.2 the removal of accountActivationDate doesn't work anymore. # udm users/user create --set password=univention --set lastname=foo --set username=acc1 --set accountActivationDate="$(TZ="Europe/Berlin" date -d '+1 minute' +'%Y-%m-%d %H:%M Europe/Berlin')" WARNING: The object is not going to be created underneath of its default containers. Object created: uid=acc1,dc=school,dc=dev # udm users/user modify --dn uid=acc1,$(ucr get ldap/base) --remove accountActivationDate LDAP Error: No such attribute: modify/delete: krb5ValidStart: no such value. [('krb5ValidStart', [b'20230901084500Z'], b''), ('displayName', b'foo', b'foo')] (Pdb) self.oldattr['krb5ValidStart'] [b'20230901104500Z'] (Pdb) self.oldinfo['accountActivationDate'] ['2023-09-01', '10:45', 'UTC'] (Pdb) univention.admin.handlers.users.user.mapDateTimeTimezoneTupleToUTCDateTimeString(self.oldinfo['accountActivationDate']) [b'20230901084500Z'] (Pdb) univention.admin.handlers.users.user.mapDateTimeTimezoneTupleToUTCDateTimeString(self.oldinfo['accountActivationDate']) == ml[0][1] True → The modlist contains the value which the map-function produces for UTC but in LDAP a different value is stored. The changes in users/user in git:c62d968c35856f06c3b10bb990016dc9618b6b02 for Py3.11 compatibility could be the cause.
This causes the following tests to fail: https://univention-dist-jenkins.k8s.knut.univention.de/job/UCS-5.2/job/UCS-5.2-0/job/AutotestJoin/SambaVersion=no-samba,Systemrolle=master/lastCompletedBuild/testReport/59_udm.59_udm/61_test_udm_users_delayed_activation/test_disabled_user_creation_activation/ https://univention-dist-jenkins.k8s.knut.univention.de/job/UCS-5.2/job/UCS-5.2-0/job/AutotestJoin/SambaVersion=no-samba,Systemrolle=master/lastCompletedBuild/testReport/59_udm.59_udm/61_test_udm_users_delayed_activation/test_disabled_user_creation/ https://univention-dist-jenkins.k8s.knut.univention.de/job/UCS-5.2/job/UCS-5.2-0/job/AutotestJoin/SambaVersion=no-samba,Systemrolle=master/lastCompletedBuild/testReport/59_udm.59_udm/61_test_udm_users_delayed_activation/test_disabled_and_expired_user_creation/
It was caused by git:c62d968c35856f06c3b10bb990016dc9618b6b02. Fixed via: diff --git management/univention-directory-manager-modules/modules/univention/admin/handlers/users/user.py management/univention-directory-manager-modules/modules/univention/admin/handlers/users/user.py index 17ef8d4256..4c5080eb1b 100644 --- management/univention-directory-manager-modules/modules/univention/admin/handlers/users/user.py +++ management/univention-directory-manager-modules/modules/univention/admin/handlers/users/user.py @@ -1039,7 +1039,7 @@ def datetime_from_local_datetimetimezone_tuple(local_datetimetimezone_tuple): # # dttz_str = module.property_descriptions[key].syntax.tostring(local_datetimetimezone_tuple) naive_dt = datetime.strptime("%s %s" % (d, t), "%Y-%m-%d %H:%M") if zoneinfo: - return naive_dt.astimezone(zoneinfo.ZoneInfo(tz)) + return naive_dt.replace(tzinfo=zoneinfo.ZoneInfo(tz)) return pytz.timezone(tz).localize(naive_dt)
Backported the fix to UCS 5.0-5: univention-directory-manager-modules.yaml c19ca49c594a | fix(udm): fix Python 3.11 compatibility for timezone handling univention-directory-manager-modules (15.0.24-18) c19ca49c594a | fix(udm): fix Python 3.11 compatibility for timezone handling
QA: - package built. - changelog and advisory. - Changes in code works.
<https://errata.software-univention.de/#/?erratum=5.0x832>