Browse Source

Ticket 47521 - Complex filter in a search request doen't work as expected.

Bug Description:  Before the search is executed there is the attempt to simplify filters.
	eg a filter like (&(&(a=x))(&(b=y))) it is reduced to (&(a=x)(b=y)).
	but if there is a simple filter between complex filters it is lost
	eg (&(&(a=x))(c=z)(&(b=y))) is also transformed to (&(a=x)(b=y)).

Fix Description:   if a simple filter is processed and there was a previous complex filter
	flattend, insert the simple filter properly

https://fedorahosted.org/389/ticket/47521

Reviewed by: richM, thanks
Ludwig Krispenz 12 years ago
parent
commit
c2658c1480
1 changed files with 5 additions and 0 deletions
  1. 5 0
      ldap/servers/slapd/index_subsystem.c

+ 5 - 0
ldap/servers/slapd/index_subsystem.c

@@ -447,6 +447,11 @@ static void index_subsys_flatten_filter(Slapi_Filter *flist)
 			}
 			else
 			{
+				/* don't loose a simple filter */
+				if (flast) {
+					flast->f_next = f;
+					flast = f;
+				}
 				fprev = f;
 				f = f->f_next;
 			}