Bug 1097868

Summary: Proposal: Consider not honoring 'i18n' on LDAP attribute names . . .
Product: [Fedora] Fedora Reporter: Matthew Harmsen <mharmsen>
Component: ldapjdkAssignee: Matthew Harmsen <mharmsen>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: gsterlin, mharmsen, nhosoi, nkinder, rmeggins, tbordaz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1099244 (view as bug list) Environment:
Last Closed: 2016-07-19 11:31:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1099244    

Description Matthew Harmsen 2014-05-14 18:08:09 UTC
The LDAPJDK utilizes the following Java calls which honor 'i18n':

    * toLowerCase()
    * toUpperCase()

These honor 'i18n' because they are actually calling the following:

    * toLowerCase(Locale.getDefault())
    * toUpperCase(Locale.getDefault())

This can cause problems for certain locales.

For example, if the default Locale is 'Turkish' (tr), the following problems arise when toLowerCase() is utilized:

    * uppercase non-dotted 'I' is translated to lowercase non-dotted 'i'
    * uppercase dotted 'I' is translated to lowercase dotted 'i'

Similar issues may exist for other Locales, including issues such as multibyte character sequences as supported by 'UTF-8'.

This bug proposes that te LDAPJDK be changed to no longer honor 'i18n' for attribute types, but still honor 'i18n' for all attribute data values:

     * toLowerCase() --> toLowerCase(Locale.ENGLISH)
     * toUpperCase() --> toUpperCase(Locale.ENGLISH)

Obviously, each individual usage of these two commands must be reviewed carefully to make certain that they are only being used on attribute names and not attribute data values.

Comment 1 Matthew Harmsen 2014-05-14 18:12:13 UTC
References:

    * Bugzilla Bug #1083170 - Installation of IPA hangs up
                              when LANG is set to tr_TR.UTF8
    * PKI TRAC Ticket #946 - Installation of IPA hangs up
                             when LANG is set to tr_TR.UTF8
    * http://www.i18nguy.com/unicode/turkish-i18n.html
    * http://stackoverflow.com/questions/11063102/using-locales-with-javas-tolowercase-and-touppercase
    * http://javapapers.com/core-java/javas-tolowercase-has-got-a-surprise-for-you/

Comment 2 thierry bordaz 2014-05-15 17:27:47 UTC
This is a good catch. In fact if an attribute name contains a 'i' there is a chance the string manipulation in ldapjdk will translate 'i' into a dotless 'i' if we are in tr_TR.UTF8.

Will try to reproduce.

A workaround would be to set LANG=C

Comment 3 thierry bordaz 2014-05-16 09:37:26 UTC
I have been unable to reproduce (mozilla/directory/java-sdk/tools/LDAPSearch.java).

run the command with LANG="tr_TR.utf8" and doing some searches like LDAPSearch -h localhost -p 1389 -D "cn=directory manager" -w Secret123 -b "dc=com" -S descrIptIon "descrIptIon=*" descrIptIon.

However, it is likely that use of toLowerCase/toUpperCase creates an issue but I was not able to do a test case

Comment 4 Jaroslav Reznik 2015-03-03 15:48:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 5 Fedora End Of Life 2016-07-19 11:31:07 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.