Univention Bugzilla – Bug 39309
Case sensitive compare for "name attributes"
Last modified: 2017-09-20 15:03:44 CEST
2015090221000181 S4-Connector by default does case_insensitive compare to detect changes. While this is correct in many cases, it is not for a users name attribute (and probably attributes like description, address etc.): (INFO ): sync_from_ucs: The following attribute has been changed: cn (INFO ): sync_from_ucs: The following attribute has been changed: entryCSN (INFO ): sync_from_ucs: The following attribute has been changed: gecos (INFO ): sync_from_ucs: The following attribute has been changed: modifyTimestamp (INFO ): sync_from_ucs: The following attribute has been changed: displayName (INFO ): sync_from_ucs: Found a corresponding mapping defintion: displayName (INFO ): sync_from_ucs: old_values: set([u'anton meyer']) (INFO ): sync_from_ucs: new_values: set([u'Anton Meyer']) (INFO ): sync_from_ucs: no modification necessary for displayName (INFO ): sync_from_ucs: The following attribute has been changed: sn (INFO ): sync_from_ucs: Found a corresponding mapping defintion: sn (INFO ): sync_from_ucs: old_values: set([u'meyer']) (INFO ): sync_from_ucs: new_values: set([u'Meyer']) (INFO ): sync_from_ucs: no modification necessary for sn (INFO ): sync_from_ucs: The following attribute has been changed: givenName (INFO ): sync_from_ucs: Found a corresponding mapping defintion: givenName (INFO ): sync_from_ucs: old_values: set([u'anton']) (INFO ): sync_from_ucs: new_values: set([u'Anton']) (INFO ): sync_from_ucs: no modification necessary for givenName (INFO ): sync_from_ucs: The following attribute has been changed: cn (INFO ): sync_from_ucs: The following attribute has been changed: entryCSN (INFO ): sync_from_ucs: The following attribute has been changed: gecos (INFO ): sync_from_ucs: The following attribute has been changed: modifyTimestamp (INFO ): sync_from_ucs: The following attribute has been changed: displayName (INFO ): sync_from_ucs: The following attribute has been changed: sn (INFO ): sync_from_ucs: The following attribute has been changed: givenName (ALL ): nothing to modify: cn=anton1,cn=schueler,cn=users,ou=anfngerschule,DC=school,DC=qa
happened again: Ticket#2016070721000129
Created attachment 9182 [details] 39309-s4c-case-sensitive-compare-422.patch The S4C did in fact not strictly always use a case insensitive compare. The attached patch sets `compare_lowercase()` as the default compare_function, if none is given, in the `attribute` class. With this and the consistent use of the `attribute.compare_function`, the S4C now defaults to case insensitive compare. A new function `compare_normal()` is introduced that uses the normal Python equality (==) and therefor performs case sensitive compare. This new compare function is used for the following attributes: city, description, displayName, firstname, lastname, organisation, street. Other attributes seem to require case insensitive compare as their semantics require case insensitive treatment (email, postal-code, paths, ..).
Pushed in 8e06721, YAML fcdcb93.
*** Bug 34362 has been marked as a duplicate of this bug. ***
Created attachment 9191 [details] normal_default.patch
Se patch proposal above, I think we should keep compare_normal as default. > Other attributes seem to require case insensitive compare as their semantics > require case insensitive treatment (email, postal-code, paths, ..). As discussed, the LDAP backend is case preserving, so we should also keep that as is.
(In reply to Arvid Requate from comment #5) > Created attachment 9191 [details] > normal_default.patch Applied in 1eca5d78, YAML (description update) 902bf00.
Code review: Ok Jenkins: Ok
<http://errata.software-univention.de/ucs/4.2/167.html>