Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Search scope bug fixes #1

merged 6 commits into from Jul 28, 2012


None yet
2 participants

tsibley commented Jul 27, 2012

See commit messages. These all apply to auto_schema.

rt.cpan.org bug report: https://rt.cpan.org/Ticket/Display.html?id=78612

tsibley added some commits Jul 27, 2012

@tsibley tsibley Translate scopes of 0, 1, and 2 into base, one, and sub, as expected
Scope is enumerated as 0, 1, or 2 in the request data, but the
auto_schema search method expected words.

Additionally, when writing tests I discovered that a scope of 'one'
doesn't work when the DN has spaces in it due to an incomplete regex
pattern.  Fix to follow.
@tsibley tsibley More robust depth checking for scopes of 'one' in auto_schema search
DNs may contain spaces which the depth checking regex didn't expect.
Use a Net::LDAP utility method to count the depth level properly and
compare against the base's depth.

t/05-scope.t now passes the previously TODOed tests.
@tsibley tsibley Restore the default scope of 'sub'
b703620 accidentally changed the default scope from 'sub' (2) to 'base' (0).
@tsibley tsibley Filters should still apply with a scope of 'base'
From RFC 4511:  SearchRequest.scope

       Specifies the scope of the Search to be performed.  The semantics (as
       described in [X.511]) of the defined values of this field are:

          baseObject: The scope is constrained to the entry named by

and  SearchRequest.filter

       A filter that defines the conditions that must be fulfilled in order
       for the Search to match a given entry.

Nowhere does the RFC specify that the baseObject is excluded from the
filters, and doing so would render the 'base' scope not nearly as
@tsibley tsibley A scope of 'one' shouldn't include the base entry
From RFC 4511 section

    singleLevel: The scope is constrained to the immediate
    subordinates of the entry named by baseObject.
@tsibley tsibley Test that filters apply to all scopes under auto_schema d559ae4

karpet commented Jul 28, 2012


@karpet karpet added a commit that referenced this pull request Jul 28, 2012

@karpet karpet Merge pull request #1 from tsibley/search-scope
Search scope bug fixes

@karpet karpet merged commit 4da8421 into karpet:master Jul 28, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment