瀏覽代碼

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.

Rich Megginson 17 年之前
父節點
當前提交
39e056a4fc
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      ldap/servers/plugins/syntaxes/string.c

+ 7 - 0
ldap/servers/plugins/syntaxes/string.c

@@ -114,6 +114,10 @@ string_filter_ava( struct berval *bvfilter, Slapi_Value **bvals, int syntax,
 	return( -1 );
 	return( -1 );
 }
 }
 
 
+/*
+ * return value:  0 -- approximately matched
+ *               -1 -- did not match
+ */
 static int
 static int
 string_filter_approx( struct berval *bvfilter, Slapi_Value **bvals,
 string_filter_approx( struct berval *bvfilter, Slapi_Value **bvals,
 							 Slapi_Value **retVal)
 							 Slapi_Value **retVal)
@@ -181,6 +185,9 @@ string_filter_approx( struct berval *bvfilter, Slapi_Value **bvals,
 			break;
 			break;
 		}
 		}
 	}
 	}
+	if (0 != rc) {
+		rc = -1;
+	}
 	LDAPDebug( LDAP_DEBUG_TRACE, "<= string_filter_approx %d\n",
 	LDAPDebug( LDAP_DEBUG_TRACE, "<= string_filter_approx %d\n",
 	    rc, 0, 0 );
 	    rc, 0, 0 );