summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2008-08-07 21:55:30 +0000
committerRich Megginson <rmeggins@redhat.com>2008-08-07 21:55:30 +0000
commit39e056a4fccbb95424f9b22cb5127c3a4972bc23 (patch)
tree756e02230eddcdde11be014db79b4594f76554ca
parent38f69c8a3fa7d7090605add4a022e9edacfb08a3 (diff)
downloadds-39e056a4fccbb95424f9b22cb5127c3a4972bc23.tar.gz
ds-39e056a4fccbb95424f9b22cb5127c3a4972bc23.tar.xz
ds-39e056a4fccbb95424f9b22cb5127c3a4972bc23.zip
Resolves: bug 458171
Description: approx search accidentally fails with timelimit although it hasn't hit timelimit. Fix Description: string_filter_approx used to simply return the return value from strcmp. The value could be evaluated as LDAP RETURN CODE. string_filter_approx is a static function and it's called only from string_filter_ava. The function returns -1 when it fails. Thus, adjusting the return value of string_filter_approx to the caller function.
-rw-r--r--ldap/servers/plugins/syntaxes/string.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ldap/servers/plugins/syntaxes/string.c b/ldap/servers/plugins/syntaxes/string.c
index e1aebfdb..6a1d3c99 100644
--- a/ldap/servers/plugins/syntaxes/string.c
+++ b/ldap/servers/plugins/syntaxes/string.c
@@ -114,6 +114,10 @@ string_filter_ava( struct berval *bvfilter, Slapi_Value **bvals, int syntax,
return( -1 );
}
+/*
+ * return value: 0 -- approximately matched
+ * -1 -- did not match
+ */
static int
string_filter_approx( struct berval *bvfilter, Slapi_Value **bvals,
Slapi_Value **retVal)
@@ -181,6 +185,9 @@ string_filter_approx( struct berval *bvfilter, Slapi_Value **bvals,
break;
}
}
+ if (0 != rc) {
+ rc = -1;
+ }
LDAPDebug( LDAP_DEBUG_TRACE, "<= string_filter_approx %d\n",
rc, 0, 0 );