浏览代码

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 [email protected] (Thank you, Mark!!)
Noriko Hosoi 10 年之前
父节点
当前提交
8c3d3e4648
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      ldap/servers/slapd/index_subsystem.c

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

@@ -412,6 +412,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;
 				}