#497 Escaped character cannot be used in the substring search filter
Closed: wontfix None Opened 8 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.

Observation:

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
value".

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

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/497

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

4 months ago

Login to comment on this ticket.

Metadata