Univention Bugzilla – Bug 54150
UDM does not support searching using 'userexpiry' property
Last modified: 2022-03-23 14:14:40 CET
Python-UDM and UDM-CLI support filters with both LDAP attributes and UDM properties. Internally it maps UDM properties to LDAP attributes before executing the actual LDAP query. When using the 'userexpiry' property that does not work. -------------------------------------------------------------------------- root@m31:~# udm users/user list --filter uid=demo_staff | grep userexpiry userexpiry: 2021-11-25 root@m31:~# udm users/user list --filter userexpiry=2021-11-25 # no user is found root@m31:~# python -c 'import time; print(int(time.mktime(time.strptime("2021-11-25", "%Y-%m-%d")) // 3600 // 24 + 1))' 18956 root@m31:~# udm users/user list --filter userexpiry=18956 # no user is found -------------------------------------------------------------------------- It works however if the LDAP attribute is used with the int value: -------------------------------------------------------------------------- root@m31:~# udm users/user list --filter shadowExpire=18956 # lists the user -------------------------------------------------------------------------- Expected behavior is that the filter "userexpiry=2021-11-25" can be used with UDM (which will have to convert it to "shadowExpire=18956").
Fixed in MR: https://git.knut.univention.de/univention/ucs/-/merge_requests/203 which transforms "userexpiry=2021-11-25" into "(|(shadowExpire=18956)(krb5ValidEnd=20211125000000Z)(sambaKickoffTime=1637794800))". and "userexpiry=* into "(|(shadowExpire=*)(krb5ValidEnd=*)(sambaKickoffTime=*))". A filter like "userexpiry=2021-*" is not required and too complicated to implement.
A search for userexpiry=$date is now possible. univention-directory-manager-modules.yaml 8042bdb5459f | Bug #54150: Merge branch 'fbest/54150-udm-users-user-filter-userexpiry' into 5.0-1 4d85e8a46634 | Bug #54150: allow "udm users/user list --filter userexpiry=2021-04-14" univention-directory-manager-modules (15.0.11-34) 8042bdb5459f | Bug #54150: Merge branch 'fbest/54150-udm-users-user-filter-userexpiry' into 5.0-1 4d85e8a46634 | Bug #54150: allow "udm users/user list --filter userexpiry=2021-04-14"
Functionality tested: -udm users/user list --filter userexpiry=2021-11-25 OK code review OK yaml, changelog OK log files OK
*** Bug 54152 has been marked as a duplicate of this bug. ***
<https://errata.software-univention.de/#/?erratum=5.0x259>