ldap/servers/slapd/index_subsystem.c | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit b6be68c54078ec17bf38e5186a26e9d71bbb9644 Author: Noriko Hosoi nhosoi@redhat.com Date: Wed Sep 2 14:28:27 2015 -0700
Ticket #48265 - Complex filter in a search request doen't work as expected. (regression)
Description: commit c2658c14802783d0a8919783aa7123be9e749c18 to fix Ticket 47521 - Complex filter in a search request doen't work as expected. regressed this case: "(&(&(|(l=A)(l=B)(l=C))(|(C=D)(c=E)))(|(uid=*test*)(cn=*test*))(o=X))" in which a simple filter follows a complex filter which choice is different from the outer choice. I.e., '|' for (uid=...)(cn=...) is different from the first '&'.
The fix for 47521 solves this case: "(&(&(uid=A)(cn=B))(&(givenname=C))(mail=D)(&(description=E)))" in this case, (mail=D) used to be dropped from the filter in the function index_subsys_flatten_filter.
The 47521 fix saved the simple filter "(mail=D)" in the 2nd example, but it forced to skip the complex filter with the different choice and converted the 1st example to: "(&(&(|(l=A)(l=B)(l=C))(|(C=D)(c=E)))(o=X))" This patch saves such a complex filter, as well.
https://fedorahosted.org/389/ticket/48265
Reviewed by mreynolds@redhat.com (Thank you, Mark!!)
(cherry picked from commit 8c3d3e4648fbb5229e329e2154d46f1ae808ba02) (cherry picked from commit 3d9dbf2d441e551495a1f3169dc2020324c484b4)
diff --git a/ldap/servers/slapd/index_subsystem.c b/ldap/servers/slapd/index_subsystem.c index eff908e..d0ba1bd 100644 --- a/ldap/servers/slapd/index_subsystem.c +++ b/ldap/servers/slapd/index_subsystem.c @@ -441,6 +441,11 @@ static void index_subsys_flatten_filter(Slapi_Filter *flist) } else { + /* don't loose a nested filter having a different choice */ + if (flast) { + flast->f_next = f; + flast = f; + } fprev = f; f = f->f_next; }
-- 389 commits mailing list 389-commits@%(host_name)s http://lists.fedoraproject.org/postorius/389-commits@lists.fedoraproject.org
389-commits@lists.fedoraproject.org