GluuFederation/oxCore

findEntries defect

Closed this issue · 1 comments

Environment
CE 4.1 rc3 on Stretch + ldap backend

I found that findEntries(String baseDN, Class<T> entryClass, Filter filter, SearchScope scope, String[] ldapReturnAttributes, int start, int count, int chunkSize) has a problem when start is equal or greater than the number of results available: it behaves as if start = 0

Steps to reproduce

Suppose ou=people,o=gluu branch has 2 users: admin and test.

If I change this line of code
https://github.com/GluuFederation/oxCore/blob/version_4.1.0/persistence-ldap-sample/src/main/java/org/gluu/ldap/LdapSample.java#L44

with

List<SimpleUser> users = ldapEntryManager.findEntries("ou=people,o=gluu", SimpleUser.class, null, SearchScope.SUB, null, 2, 0, 0);

the output is:

User with uid: admin
User with uid: test

Same goes if using 3, 4... I imagine the right behavior is an empty list.

However it works as expected when using 0 (retrieves admin + test) and 1 (only retrieves test).

yurem commented

Fixed