Univention Bugzilla – Bug 55037
Behavior change when searching for "anything=*" via UDM in UCS 5.0
Last modified: 2022-09-08 11:43:56 CEST
git:da06afda8d4c64db2c1ce2fea6b78ac4fb51ac80 introduced an `=*` operator for univention.admin.filter.expression. So `univention.admin.filter.parse('foo=*')` results in `expression('foo', '', '=*')` instead of `expression('foo', '*', '=')`. This change had side effects on the UDM filter generation. Now dead code: > modules/univention/admin/handlers/users/user.py: elif filter.value == u'*' > modules/univention/admin/handlers/__init__.py: if filter.value == '*' and property_ and issubclass(property_.syntax if inspect.isclass(property_.syntax) else type(property_.syntax), (univention.admin.syntax.IStates, univention.admin.syntax.boolean)): Probably affected (no substring search is done anymore, so no search result is found anymore): > modules/univention/admin/handlers/dhcp/pool.py: filter.value = '%s %s' % (filter.value.strip('*'), cls.permits_udm2dhcp[filter.variable]) Maybe affected: > modules/univention/admin/handlers/users/user.py: userexpiry_filter = filter_format(u'(|(shadowExpire=%s)(krb5ValidEnd=%s)(sambaKickoffTime=%s))', [filter.value or '*', filter.value or '*', filter.value or '*']) And also general different behavior: `udm policies/registry list --filter 'registry=*'` creates `(&(objectClass=univentionPolicyRegistry)(registry=*[['']]))` instead of `(&(objectClass=univentionPolicyRegistry)(registry=[['*']]))` - yes, both is broken but that's a different bug. There are probably also cases with valid output. 1. we have to ensure consistent behavior. `univention.admin.filter.parse('foo=*')`, `expression('foo', '', '=*')` and `expression('foo', '*', '=')` should result in the same expression. 2. we have to fix the broken searches due to this change.
Broken search filter generation has been fixed as well as consistency of presence filters is ensured. univention-directory-manager-modules.yaml 8052b5c2c8a2 | YAML Bug #55037 univention-directory-manager-modules (15.0.13-4) 9a85531a1a64 | Bug #55037: add unittest for UDM filters f238444de5ce | Bug #55037: add special handling for =* presence operator ae392792af9f | Bug #55037: fix comparision with presence operator ac696a45cc20 | Bug #55037: ensure consistent behavior
OK: 8052b5c2c8a2 OK: 9a85531a1a64 OK: f238444de5ce OK: ae392792af9f OK: ac696a45cc20 OK: apt install -t apt python-univention-directory-manager python3-univention-directory-manager python3-univention-directory-manager-cli univention-directory-manager-tools OK: https://jenkins2022.knut.univention.de/job/UCS-5.0/job/UCS-5.0-2/job/AutotestJoin/lastCompletedBuild/testReport/ OK: udm users/user list --filter disabled=1 | grep ^DN OK: univention-directory-manager-modules.yaml ~OK: errata-announce -V --only univention-directory-manager-modules.yaml changes.valid: 15.0.13-3A~5.0.0.202208161105 << 15.0.13-5A~5.0.0.202208291032
<https://errata.software-univention.de/#/?erratum=5.0x406>