On Wed, Feb 22, 2012 at 09:04:37AM -0500, Stephen Gallagher wrote:
On Wed, 2012-02-22 at 12:22 +0100, Jakub Hrozek wrote:
> On Tue, Feb 21, 2012 at 09:31:13PM -0500, Stephen Gallagher wrote:
> > The paging control can cause issues on servers that put limits on
> > how many paging controls can be active at one time (on some
> > servers, it is limited to one per connection). We need to reduce
> > our usage so that we only activate the paging control when making
> > a request that may return an arbitrary number of results.
> >
> > This is the first step to solving
> >
https://fedorahosted.org/sssd/ticket/1202 but I wanted to get this patch
> > on the list immediately since it changes the semantics of
> > sdap_get_generic_send() (and is therefore likely to need merging with
> > other in-progress patches).
> >
> > Please review immediately.
> >
> >
> > I am still working on the second half of the fix for 1202, which will
> > involve serializing requests that require the paging control to ensure
> > that we only run one paged request at a time.
>
> I'm not sure this would work for deref because deref searches hardcode
> the scope to LDAP_SCOPE_BASE, but this check:
>
> +
> + /* Be extra careful and never allow paging for BASE searches,
> + * even if requested.
> + */
> + if (scope == LDAP_SCOPE_BASE) {
> + state->allow_paging = false;
> + } else {
> + state->allow_paging = allow_paging;
> + }
> +
>
> Would reset paging to false.
Good catch. That's mostly in there so I don't have to have ugly checks
on every scope for multiple search base routines. I added a new
additional check after that for whether the serverctrls argument
contains an ASQ or X_DEREF control and force the allow_paging option to
true if so.
New patch attached.
This doesn't work, at the time of the check state->serverctrls is still
NULL. You need to either check just "serverctrls" or move the check
later after state->serverctrls is assigned.