Bug 39309 - Case sensitive compare for "name attributes"
Case sensitive compare for "name attributes"
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: S4 Connector
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.2-2-errata
Assigned To: Lukas Oyen
Arvid Requate
:
: 34362 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-04 10:09 CEST by Janis Meybohm
Modified: 2017-09-20 15:03 CEST (History)
7 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.137
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Ticket number: 2015090221000181, 2016070721000129, 2017051721000264
Bug group (optional):
Max CVSS v3 score:
oyen: Patch_Available+


Attachments
39309-s4c-case-sensitive-compare-422.patch (16.19 KB, patch)
2017-09-07 16:50 CEST, Lukas Oyen
Details | Diff
normal_default.patch (8.70 KB, patch)
2017-09-12 13:53 CEST, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janis Meybohm univentionstaff 2015-09-04 10:09:57 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
Comment 1 Jens Thorp-Hansen univentionstaff 2016-07-07 11:10:43 CEST
happened again: Ticket#2016070721000129
Comment 2 Lukas Oyen univentionstaff 2017-09-07 16:50:04 CEST
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, ..).
Comment 3 Lukas Oyen univentionstaff 2017-09-11 15:24:30 CEST
Pushed in 8e06721, YAML fcdcb93.
Comment 4 Lukas Oyen univentionstaff 2017-09-12 13:13:51 CEST
*** Bug 34362 has been marked as a duplicate of this bug. ***
Comment 5 Arvid Requate univentionstaff 2017-09-12 13:53:30 CEST
Created attachment 9191 [details]
normal_default.patch
Comment 6 Arvid Requate univentionstaff 2017-09-12 13:57:15 CEST
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.
Comment 7 Lukas Oyen univentionstaff 2017-09-13 09:41:43 CEST
(In reply to Arvid Requate from comment #5)
> Created attachment 9191 [details]
> normal_default.patch

Applied in 1eca5d78, YAML (description update) 902bf00.
Comment 8 Arvid Requate univentionstaff 2017-09-14 15:42:05 CEST
Code review: Ok
Jenkins: Ok
Comment 9 Erik Damrose univentionstaff 2017-09-20 15:03:44 CEST
<http://errata.software-univention.de/ucs/4.2/167.html>