Fix paged search rfc2696_cookie for Microsoft Active Directory #369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When building the
cookie
of a paged search we are currently callingto_ber
when we should be callingto_ber_bin
to avoid encoding it to UTF-8 and 'breaking' the cookie format. When looking at the methodto_ber_bin
, it seems to be build with this in mind.Without this change, when trying to do a paged search the behavior is the same as described in this issue: #36 Wrong paged result from search
#36 (comment)
The issue is very likely to be related #313 rfc2696 paging not working when server returns additional, empty pagedResultsControl items, because after sending the broken cookie the AD still reponds with what would be the first page after the initial query but wont send the cookie required for continuing the paged search.
The comment below seems to imply that this issue was known and disabling paging was a solution, but the paging is not disabled and it breaks silently.
I've only tested this against Microsoft Active Directory, and it enabled me to used the paged search.