389ds / 389-ds-base

The enterprise-class Open Source LDAP server for Linux
https://www.port389.org/
Other
210 stars 88 forks source link

International Collation Ordered Searches currently broken. #2030

Open 389-ds-bot opened 4 years ago

389-ds-bot commented 4 years ago

Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/48971


Sample filters.

"(uid:2.16.840.1.113730.3.3.2.15.1:=>AAA)"
"(uid:es:=>AAA)"
"(uid:2.16.840.1.113730.3.3.2.15.1.5:=AAA)"
"(uid:es.5:=AAA)"
"(uid:2.16.840.1.113730.3.3.2.15.1:=>user100)"
"(uid:es:=>user100)"
"(uid:2.16.840.1.113730.3.3.2.15.1.5:=user100)"
"(uid:es.5:=user100)"
"(uid:2.16.840.1.113730.3.3.2.15.1:=<1)"
"(uid:es:=<1)"
"(uid:2.16.840.1.113730.3.3.2.15.1.1:=1)"
"(uid:es.1:=1)"
"(uid:2.16.840.1.113730.3.3.2.15.1:=<user1)"
"(uid:es:=<user1)"
"(uid:2.16.840.1.113730.3.3.2.15.1.1:=user1)"
"(uid:es.1:=user1)"
"(uid:2.16.840.1.113730.3.3.2.15.1:=<z)"
"(uid:es:=<z)"
"(uid:2.16.840.1.113730.3.3.2.15.1.1:=z)"
"(uid:es.1:=z)"

Note: the attribute title is indexed with matching rule 2.16.840.1.113730.3.3.2.28.1.6. $ ldapsearch [...] '(title:2.16.840.1.113730.3.3.2.15.1.6:=CEO)' title dn: uid=ntest,ou=People,dc=example,dc=com title: CEO

But both searches with the filter '(title:2.16.840.1.113730.3.3.2.28.1.6:=>=CEO)' and '(title:2.16.840.1.113730.3.3.2.28.1.6:=<=CEO)' return none.

Access log:

SRCH base="dc=example,dc=com" scope=2 filter="(title:2.16.840.1.113730.3.3.2.28.1.6:=<=CEO)" attrs="title"
RESULT err=0 tag=101 nentries=0 etime=0

At least, the index is being used and nothing is found.

389-ds-bot commented 4 years ago

Comment from nhosoi (@nhosoi) at 2016-08-26 01:26:43

Found some working cases.

Using C.4.3.4. Greater-Than or Equal-to Example.
(The other operations share the same symptom). 
locality:2.16.840.1.113730.3.3.2.18.1:=>= Québec
    Returns nothing.  Not working.

locality:fr:=>= Québec
    Returns nothing.  Not working.

locality:2.16.840.1.113730.3.3.2.18.1.4:=Québec
    Returns expected results.  Working.

locality:fr.4:=Québec
    Although mozldap search works,
    Openldap search does not accept this syntax: Bad search filter (-7)

For more cases, see also https://access.redhat.com/documentation/en-US/Red_Hat_Directory_Server/8.2/html/Administration_Guide/Searching_an_Internationalized_Directory.html

389-ds-bot commented 4 years ago

Comment from firstyear (@Firstyear) at 2016-08-26 05:52:42

Can I be a pain and ask you to attach the ldif of the database you were testing these searches with?

389-ds-bot commented 4 years ago

Comment from nhosoi (@nhosoi) at 2016-08-26 06:54:02

test ldif containing i18n data i18ntest.ldif

389-ds-bot commented 4 years ago

Comment from nhosoi (@nhosoi) at 2016-08-26 06:56:31

I've attached my data.

The examples above are from the Doc... But the range search works and does not work in the same way. locality:fr:=>= Québec ...

389-ds-bot commented 4 years ago

Comment from nhosoi (@nhosoi) at 2016-09-07 02:26:59

Note: need to investigate older versions

389-ds-bot commented 4 years ago

Comment from nhosoi (@nhosoi) at 2017-02-11 22:56:56

Metadata Update from @nhosoi:

389-ds-bot commented 4 years ago

Comment from mreynolds (@mreynolds389) at 2017-05-08 22:37:00

Metadata Update from @mreynolds389:

droideck commented 11 months ago

The issue is partially covered here, and the tests pass: https://github.com/389ds/389-ds-base/blob/91c4f62fc0ae58f1f86a7b5875964f38612505fb/dirsrvtests/tests/suites/filter/filter_with_non_root_user_test.py