Skip to content
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

Using pagination with pageSize=0 returns 0 records #379

Closed
jonathanvila opened this issue Jun 8, 2022 · 3 comments
Closed

Using pagination with pageSize=0 returns 0 records #379

jonathanvila opened this issue Jun 8, 2022 · 3 comments
Assignees

Comments

@jonathanvila
Copy link

I'm using SearchWithPagination with a PageSize of 0 , as it is said in the documentation

A requested pagingSize of 0 is interpreted as no limit by LDAP servers.

But the result is always 0 rows.

If I set conn.Debug=true then I see
error running search query "(objectClass=person)": LDAP Result Code 203 "Debugging Error": ldap: cannot process packet to add descr

Specifying a value higher than 0 seems to work fine with no issues.

@cpuschma cpuschma self-assigned this Jun 8, 2022
@cpuschma
Copy link
Member

cpuschma commented Jun 11, 2022

I managed to reproduce this and it seems that this is an implementation mistake from MS. I ran a paged search request with pageSize = 0 against both an Active Directory and a OpenLDAP server.

The OpenLDAP Server had the necessary page control and the cookie for the client to use for the next request (to request the next batch of entries).
image

The Active Directory server also responded with the paging control in it's response, but the cookie was empty. The LDAP client therefore aborted the paging request, as this matches the behaviour when all results have been fetched.
image

The cookie MUST be set to an empty value if there are no more entries to return (i.e., the page of search results returned was the last), or, if there are more entries to return, to an octet string of the server's choosing,used to resume the search.

I'll dig around a bit more later, but for now this looks like a implementation mistake from Microsoft.

@cpuschma
Copy link
Member

cpuschma commented Jun 27, 2022

I tried this with different Active Directory server on different domain levels. All answered in the same behaviour unfortunately, with no cookie in their SearchResponse. I suggest you use the maximum number of allowed results configured for your domain (which should be 10.000 by default)

@cpuschma
Copy link
Member

cpuschma commented Apr 6, 2024

See #499
Function has been marked as deprecated and will be removed/made private in future releases.

@cpuschma cpuschma closed this as completed Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants