[Fedora-directory-commits] ldapserver/ldap/servers/plugins/syntaxes string.c, 1.14, 1.15

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Thu Aug 7 21:55:34 UTC 2008


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/syntaxes
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21728

Modified Files:
	string.c 
Log Message:
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.



Index: string.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/syntaxes/string.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- string.c	23 Jul 2008 14:59:56 -0000	1.14
+++ string.c	7 Aug 2008 21:55:30 -0000	1.15
@@ -114,6 +114,10 @@
 	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 @@
 			break;
 		}
 	}
+	if (0 != rc) {
+		rc = -1;
+	}
 	LDAPDebug( LDAP_DEBUG_TRACE, "<= string_filter_approx %d\n",
 	    rc, 0, 0 );
 




More information about the Fedora-directory-commits mailing list