Commit aeaaa8c6 authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

Fix octetStringOrderingMatch(). It thought "b"<"aa", becuase "b" is shorter.

parent b0f9305b
......@@ -59,7 +59,6 @@
#define caseIgnoreOrderingMatch caseIgnoreMatch
#define caseExactOrderingMatch caseExactMatch
#define integerOrderingMatch integerMatch
#define octetStringOrderingMatch octetStringMatch
/* unimplemented matching routines */
#define caseIgnoreListMatch NULL
......@@ -138,6 +137,26 @@ octetStringMatch(
return LDAP_SUCCESS;
}
static int
octetStringOrderingMatch(
int *matchp,
slap_mask_t flags,
Syntax *syntax,
MatchingRule *mr,
struct berval *value,
void *assertedValue )
{
ber_len_t v_len = value->bv_len;
ber_len_t av_len = ((struct berval *) assertedValue)->bv_len;
int match = memcmp( value->bv_val,
((struct berval *) assertedValue)->bv_val,
(v_len < av_len ? v_len : av_len) );
if( match == 0 )
match = v_len - av_len;
*matchp = match;
return LDAP_SUCCESS;
}
/* Index generation function */
int octetStringIndexer(
slap_mask_t use,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment