Jon Roberts wrote:
I was just today thinking about something along the lines of filter
preprocessing (at the client level actually) that prevented say a
contains search like (telephonenumber=*67530*) on an attribute that the
directory has not indexed for substring searches (case of
telephonenumber). Something at the server level would be better of course.
Something like that was discussed long time ago when I proposed the
"limits" feature (which eventually got into slapd in its current form).
It's hard to tell what such constraint would mean. However, if one
only looks at the presence of a substrings filter in a search,
unexpected results may occur; for example:
(telephonenumber=*67530*) => reject
but what about
(!(telephonenumber=*67530*)) => ?
(&(uid=foo)(telephonenumber=*67530*)) => ?
A better approach, which we recently developed for a customer, would be
to define what filter is to be considered acceptable and what is not,
and then analyze the logic of the filter to see if it matches that of
the requirement. For example, logic analysis could allow to determine
if a filter is surely acceptable, surely unacceptable, or "grey"; then,
decision making could determine what to do in the "grey" cases.
If what you want to control is searches resulting in large candidate
sets, you need to define what may potentially lead to large candidate
sets. So you need to define what's "large", and what simple filters
could lead to large candidates sets.