[SAMBA4] Make paged results the default in ldb_ildap
idra at samba.org
Mon Aug 14 05:49:21 GMT 2006
On Mon, 2006-08-14 at 11:43 +1000, Andrew Bartlett wrote:
> A while ago, we discussed my desire for the paged results control to be
> enabled by default, on all LDAP queries.
> For the benefit of the list, I was discussing with simo a problem I was
> having, with downloading a large amount of data from AD's LDAP server.
> At the current time, I'm looking to download schema information from
> AD's LDAP server, but I'm likewise interested in how an async winbindd
> could be built, given we now have the infrastructure.
> I know I can specify magic options to ldbsearch, but this misses the
> My assertion is that the caller, and in the case of the ldbsearch
> binary, the user, should have this 'just work'. If the search would
> return too many entries for one try, it should retry with paged results
> I'm happy to make it possible for the caller to disable it, but I would
> like the control to be on by default, as otherwise there is a differece
> in behaviour between the TDB and LDAP backends.
> This would also allow our clients to make large searches via our LDAP
> server, where we can then apply the sort control and similar.
> Otherwise, clients can only do large searches against tdb (which has no
> such size limit).
We can do this, but I want it done right.
The problem with the paged control is that it requires the caller to
make multiple calls.
Also we cannot use the control when it is not supported by the remote
So the right way to do it is to do it inside ldb_search(), and to not
repeat a rootDSE search at every ldb_search() we need to keep the
information about whether the server supports paged results or not
somewhere. In theory the right place would be the ldb backend, but then
we would need a way to query it to know whether or not we are allowed to
use the paged search control.
What we can't do, is to query the rootDSE at each search, or forcibly
add the paged control at any serach in the ldb backend, because when you
use the ldb_request(0 call it means you want complete control over what
happens on the wire, you don't want "surprises".
So provided we find a decent method to make ldb_search() know when to
use the paged results control I am ok adding the code to do it there
Samba Team GPL Compliance Officer
email: idra at samba.org
More information about the samba-technical