mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-10 00:45:01 -05:00
Fix octetStringOrderingMatch(). It thought "b"<"aa", becuase "b" is shorter.
This commit is contained in:
parent
b0f9305b66
commit
aeaaa8c6ca
1 changed files with 20 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue