-
Notifications
You must be signed in to change notification settings - Fork 103
Issue 5772 - ONE LEVEL search fails to return sub-suffixes #6219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch and nice fix.
Patch looks valid. The other approach, to not craft the filter with 'parentid', what if in build_candidate_list we are crafting the filter only if the back_entry is equal to the base search in the pblock ?
|
Not sure I fully understand what you mean. |
Sorry I was confusing. I was wondering if something like this could help + slapi_pblock_get(pb, SLAPI_SEARCH_TARGET_SDN, &target_sdn);
+ if (slapi_sdn_compare(slapi_entry_get_sdn_const(e->ep_entry), target_sdn) == 0) {
+ filter_exec = create_onelevel_filter(filter, e, managedsait);
+ } else {
+ filter_exec = filter;
+ }
|
|
There is no need to compare the sdn: if build_candidate_list scope is LDAP_SCOPE_ONELEVEL that mean that it is the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest looks good!
|
Fixed the test case description |
Problem: ONE LEVEL scoped search fails to return sub-suffixes entries Reason: When such search is done, a one level search is done on the main suffix and base search are done on any matching sub-suffix. But main suffix is processed search (to ensure that parent entries are returned before children ones when searching subtree) and ldbm_back_search change the filter to (&(parentid=xxx)old_filter) so the filter test reject the entry on the sub-suffixes. Solution: Revert the backend list when doing one level search so that the sub-suffixes are processed first and restore the base dn for the main suffix. Alternative rejected: reset the filter when discivering a sub-suffix. Not so easy because filter is altered by the rewriteres. And systematic duplication is an useless overhead if there is no matching sub-suffixes (which is the usual case) Issue: #5772 Reviewed by: @tbordaz, @droideck (Thanks!) (cherry picked from commit 407bdaa)
Problem: ONE LEVEL scoped search fails to return sub-suffixes entries Reason: When such search is done, a one level search is done on the main suffix and base search are done on any matching sub-suffix. But main suffix is processed search (to ensure that parent entries are returned before children ones when searching subtree) and ldbm_back_search change the filter to (&(parentid=xxx)old_filter) so the filter test reject the entry on the sub-suffixes. Solution: Revert the backend list when doing one level search so that the sub-suffixes are processed first and restore the base dn for the main suffix. Alternative rejected: reset the filter when discivering a sub-suffix. Not so easy because filter is altered by the rewriteres. And systematic duplication is an useless overhead if there is no matching sub-suffixes (which is the usual case) Issue: #5772 Reviewed by: @tbordaz, @droideck (Thanks!) (cherry picked from commit 407bdaa)
Problem: ONE LEVEL scoped search fails to return sub-suffixes entries Reason: When such search is done, a one level search is done on the main suffix and base search are done on any matching sub-suffix. But main suffix is processed search (to ensure that parent entries are returned before children ones when searching subtree) and ldbm_back_search change the filter to (&(parentid=xxx)old_filter) so the filter test reject the entry on the sub-suffixes. Solution: Revert the backend list when doing one level search so that the sub-suffixes are processed first and restore the base dn for the main suffix. Alternative rejected: reset the filter when discivering a sub-suffix. Not so easy because filter is altered by the rewriteres. And systematic duplication is an useless overhead if there is no matching sub-suffixes (which is the usual case) Issue: #5772 Reviewed by: @tbordaz, @droideck (Thanks!) (cherry picked from commit 407bdaa)
Problem: ONE LEVEL scoped search fails to return sub-suffixes entries
Reason: When such search is done, a one level search is done on the main suffix and base search are done on any matching sub-suffix. But main suffix is processed search (to ensure that parent entries are returned before children ones when searching subtree) and ldbm_back_search change the filter to (&(parentid=xxx)old_filter) so the filter test reject the entry on the sub-suffixes.
Solution: Revert the backend list when doing one level search so that the sub-suffixes are processed first
and restore the base dn for the main suffix.
Alternative rejected: reset the filter when discivering a sub-suffix. Not so easy because filter is altered by the rewriteres.
And systematic duplication is an useless overhead if there is no matching sub-suffixes (which is the usual case)
Issue: #5772
Reviewed by: @tbordaz, @droideck (Thanks!)