-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InMemoryDirectoryServer: Search: Missing result for certain order of attributes in OR filter with non-ASCII strings #121
Comments
Thanks for reporting this. I can confirm a bug in the The The reason that you were seeing different behavior when providing the filter components in a different order lies in the way that the filter evaluation is performed. For an OR filter, at least one of the components needs to match, and the LDAP SDK evaluates them in left-to-right. It will return I have committed a fix for the problem. It will be addressed in the next release, which will probably be in a couple of months. If you'd like a fix before then, you can build the LDAP SDK for yourself. Alternatively, I believe that it should be possible to work around the issue in your test by running the in-memory directory server without any schema (in which case it will assume a generic directory string syntax for all attributes with case-insensitive matching). You can do that by invoking the |
Thank you very much for the quick reply and detailed analysis, I'm very happy to hear that this will be fixed in the future. I think I can work out a solution based on your suggestions for the tests and knowing how it is handled, also for the production code that this relates to (if it is affected at all). Looking forward to the next release :) |
Summary
It seems I stumbled upon a very specific problem: If a search with an OR filter for a number of attributes is done, and the search term contains non-ASCII characters, it will fail if it is in the wrong order and tests a phone number attribute.
Affected version
SDK version: 6.0.3
Tests were done with OpenJDK version 11.0.13 (2021-10-19).
Expected outcome
I'd expect it to work in all cases as the equality check should just come up false, as far as I understand things — or at least not be order-dependent for the OR filter.
How to reproduce
I narrowed it down to the JUnit 5 test seen below.
The search is done twice with the same attributes, but once in the order
sn
,(value of attributeName)
,givenName
, and the second time in the ordergivenName
,(value of attributeName)
,sn
.This all runs fine for the name
Doe
, but the other names will fail on the second variant if there is a equality check involving a phone number attribute (likemobile
,pager
,homePhone
, etc).The text was updated successfully, but these errors were encountered: