Bug 50236 - Remove filter hack from users/user
Remove filter hack from users/user
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Users
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 4.4-2-errata
Assigned To: Florian Best
Johannes Keiser
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-09-20 19:15 CEST by Florian Best
Modified: 2019-10-16 14:11 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Cleanup
Max CVSS v3 score:
best: Patch_Available+


Attachments
patch (git:fbest/50236-users-user-filter-rewrite-conjunction) (deleted)
2019-09-20 19:15 CEST, Florian Best
Details
patch (git:fbest/50236-users-user-filter-rewrite-conjunction) (6.29 KB, patch)
2019-09-20 19:22 CEST, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2019-09-20 19:15:37 CEST
Created attachment 10186 [details]
patch (git:fbest/50236-users-user-filter-rewrite-conjunction)

users/user.py integrates multiple ldap filters into one univention.admin.filter.expression. e.g.:
2306 »   »   »   if filter.value == '1':
2307 »   »   »   »   filter.variable = '&(shadowExpire=1)(krb5KDCFlags:1.2.840.113556.1.4.803:=128)(|(sambaAcctFlags=[UD       ])(sambaAcctFlags'
2308 »   »   »   »   filter.value = '[ULD       ]))'

This is not necessary, filter.transform_to_conjunction() can nowerdays be used.
Comment 1 Florian Best univentionstaff 2019-09-20 19:22:21 CEST
Created attachment 10187 [details]
patch (git:fbest/50236-users-user-filter-rewrite-conjunction)
Comment 2 Florian Best univentionstaff 2019-09-20 19:22:57 CEST
The content of attachment 10186 [details] has been deleted for the following reason:

broken
Comment 3 Florian Best univentionstaff 2019-10-10 11:38:16 CEST
Patch applied, no behavior change.
QA:

# ucr set directory/manager/cmd/debug/level='99'
# pkill -f cli-server
# tail -f /var/log/univention/directory-manager-cmd.log | grep 'uldap.search filter=' | grep univentionObjectType=users/user &
# udm users/user list --filter 'disabled=all' > /dev/null
# udm users/user list --filter 'disabled=1' > /dev/null
# udm users/user list --filter 'disabled=0' > /dev/null
# udm users/user list --filter 'locked=1' > /dev/null
# udm users/user list --filter 'locked=0' > /dev/null
→ filter should not have changed

Fixed in:
univention-directory-manager-modules (14.0.14-4)
2182db93360b | Bug #50236: Make univention.admin.filter.expression(escape=False) explicit
96a7ee04a5ec | Bug #50236: fix users/user filter rewrite to not create invalid filter.expression instances

univention-directory-manager-modules.yaml
96a7ee04a5ec | Bug #50236: fix users/user filter rewrite to not create invalid filter.expression instances
Comment 4 Johannes Keiser univentionstaff 2019-10-10 15:21:58 CEST
OK: filter for disabled and locked property is still the same
OK: explicit use of esacped=False
OK: yaml
-> verified
Comment 5 Arvid Requate univentionstaff 2019-10-16 14:11:08 CEST
<http://errata.software-univention.de/ucs/4.4/306.html>