Bug #74023 [Com]: ldap_control_paged_result cannot be undone
| From: | mcmic@php.net | Date: | Wed, 26 Jul 2017 10:03:18 +0000 |
| Subject: | Bug #74023 [Com]: ldap_control_paged_result cannot be undone | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210343@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74023&edit=1
ID: 74023
Comment by: mcmic@php.net
Reported by: markusu49 at aol dot com
Summary: ldap_control_paged_result cannot be undone
Status: Open
Type: Bug
Package: LDAP related
Operating System: linux (Ubuntu Server 16.04.1)
PHP Version: 7.1.1
Block user comment: N
Private report: N
New Comment:
Note that starting from PHP 7.2, as a work-around you can use:
ldap_set_option(ldap, LDAP_OPT_SERVER_CONTROLS, array());
As a work-around to stop pagination.
But please note that this will remove all controls if some other were also set (but this seems
unlikely as PHP has little way of adding controls in current releases)
You may use ldap_get_option and check the oid of the controls before removing them.
In future PHP versions proper support for controls will be added and paged result should be easier
to manage.
Previous Comments:
------------------------------------------------------------------------
[2017-01-31 15:56:31] markusu49 at aol dot com
I created a working java example to show that it's no server side issue:
https://github.com/markusu49/ldap-pagination/blob/master/ldap.java
------------------------------------------------------------------------
[2017-01-31 15:00:42] markusu49 at aol dot com
Description:
------------
It's not possible to reset ldap_control_paged_result. Should work with a pagesize of 0. See
here: https://www.ietf.org/rfc/rfc2696.txt
"A sequence of paged search requests is abandoned by the client sending a search request
containing a pagedResultsControl with the size set to zero (0) and the cookie set to the last cookie
returned by the server."
The comments in the docs point this out, too: http://php.net/manual/de/function.ldap-control-paged-result.php#119433
LDAP servers behave differently, OpenLDAP even reacts with a segfault.
Test script:
---------------
https://github.com/markusu49/ldap-pagination/blob/master/ldap.php
Expected result:
----------------
ldap_search returns all entries (eventually limited by server)
Actual result:
--------------
ldap_search returns 0 entries with AD, OpenLDAP segfaults
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74023&edit=1