Bug 37081

Summary: udm syntax checkLdap is always executed, even if the attribute was not changed
Product: UCS Reporter: Felix Botner <botner>
Component: UDM (Generic)Assignee: Florian Best <best>
Status: CLOSED FIXED QA Contact: Johannes Keiser <keiser>
Severity: normal    
Priority: P5 CC: best, gohmann
Version: UCS 4.2Flags: best: Patch_Available+
Target Milestone: UCS 4.2-1-errata   
Hardware: Other   
OS: Linux   
What kind of report is it?: Bug Report What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069 Enterprise Customer affected?: Yes
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional): External feedback, Large environments, UCS Performance
Max CVSS v3 score:
Attachments: patch

Description Felix Botner univentionstaff 2014-11-27 11:30:02 CET
If you have a univention.admin.syntax.UDM_Attribute syntax class with the checkLdap class method (to check for proper value if the api is used, not the UMC) than this method "checkLdap" is always executed if the objects is changed (not only if the attribute with this syntax is changed).


# add debug output to checkLdap() method in emailAddressValidDomain class in 
# (print 'checking ldap') syntax.py
-> vi /usr/share/pyshared/univention/admin/syntax.py

# create python UDM script 
...
modules.update()
users = modules.get('users/user')
modules.init(lo, position, users)

user = users.lookup(co, lo, 'uid=Administrator')
user = user[0]
user.open()
user.modify() #  no modification

# run script
-> python 
checking ldap
checking ldap
Comment 1 Florian Best univentionstaff 2016-09-07 15:02:43 CEST
Created attachment 7986 [details]
patch
Comment 2 Florian Best univentionstaff 2017-06-28 14:52:46 CEST
There is a Customer ID set so I set the flag "Enterprise Customer affected".
Comment 3 Florian Best univentionstaff 2017-07-28 15:49:46 CEST
The only syntax class in UCS using checkLdap this is emailAddressValidDomain.
It's used by the following modules
users/user.py
groups/group
mail/folder.py
mail/lists

This increased performance when modifying such user objects.

univention-directory-manager-modules (12.0.18-6):
r81532 | Bug #37081 only call checkLdap if the property changed

univention-directory-manager-modules.yaml:
r81532 | Bug #37081 only call checkLdap if the property changed
Comment 4 Johannes Keiser univentionstaff 2017-07-31 12:42:50 CEST
OK
# add debug output to checkLdap() method in emailAddressValidDomain class in 
# (print 'checking ldap') syntax.py
-> vi /usr/share/pyshared/univention/admin/syntax.py

# create python UDM script 
...
modules.update()
users = modules.get('users/user')
modules.init(lo, position, users)

user = users.lookup(co, lo, 'uid=Administrator')
user = user[0]
user.open()
user.modify() #  no modification
-> no output
user['mailPrimaryAddress'] = 'foo@mydomain.intranet'
user.modify()
-> prints 'checking ldap'

OK users/user, groups/group, mail/folder, mail/lists add/modify/delete
YAML: OK
-> verified
Comment 5 Arvid Requate univentionstaff 2017-08-02 14:34:10 CEST
<http://errata.software-univention.de/ucs/4.2/121.html>