#497 Escaped character cannot be used in the substring search filter
Closed: Fixed None Opened 7 years ago by nhosoi.

Bug description:

1) add an entry including '*' in an attribute value. E.g.,
dn: uid=tuser,dc=test,dc=com
description: This is the special * attribute value

2) search with the filter "(description=*\2a*)", which is supposed to
return the entry having:
description: This is the special * attribute value

But the current version returns no entry.


slapi_escape_filter_value replaces the original "\2a" with "\\2a".  Then,
it's escaped again by filter_strcpy_special_ext in
ldbm_search_compile_filter to "\\\\2a".  Finally, ".*\\\\2a" is passed to
PCRE.  It does not match the value "This is the special * attribute

If we skip calling slapi_escape_filter_value for the filter
"(description=*\2a*)", the regular expression pattern ".*\\*" is passed to
PCRE, which returns the matched entry.

(regression: fltr_32?)

Note: without calling slapi_escape_filter_value for substring search, the existing filter tests passed 100%.

Bug description: Previous commit de8fd7d
for Ticket 328 introduced this bug. Only a string format filter
for logging needs to be escaped, but the above commit accidentally
applied the escaped filter to the real filter.

Fix description: This patch did undo the escape on the real filter.

Reviewed by Rich (Thank you!!)

Pushed to master: commit 8ff26ec

Pushed to 389-ds-base-1.3.0: f503882

Metadata Update from @nhosoi:
- Issue assigned to nhosoi
- Issue set to the milestone: 1.3.0

3 years ago

Login to comment on this ticket.