Add additional DN matching rules.

This commit is contained in:
Kurt Zeilenga 2004-09-09 03:56:58 +00:00
parent 741f9ea383
commit 910076d26f
4 changed files with 56 additions and 8 deletions

View File

@ -1003,8 +1003,64 @@ dnRelativeMatch(
*matchp = match;
return LDAP_SUCCESS;
}
if( mr == slap_schema.si_mr_dnSuperiorMatch ) {
asserted = value;
value = (struct berval *) assertedValue;
mr = slap_schema.si_mr_dnSubordinateMatch;
}
if( mr == slap_schema.si_mr_dnSubordinateMatch ) {
if( asserted->bv_len >= value->bv_len ) {
match = -1;
} else {
if( DN_SEPARATOR(
value->bv_val[value->bv_len - asserted->bv_len - 1] ))
{
match = memcmp(
&value->bv_val[value->bv_len - asserted->bv_len],
asserted->bv_val,
asserted->bv_len );
} else {
return 1;
}
}
*matchp = match;
return LDAP_SUCCESS;
}
if( mr == slap_schema.si_mr_dnOneLevelMatch ) {
if( asserted->bv_len >= value->bv_len ) {
match = -1;
} else {
if( DN_SEPARATOR(
value->bv_val[value->bv_len - asserted->bv_len - 1] ))
{
match = memcmp(
&value->bv_val[value->bv_len - asserted->bv_len],
asserted->bv_val,
asserted->bv_len );
if( !match ) {
struct berval rdn;
rdn.bv_val = value->bv_val;
rdn.bv_len = value->bv_len - asserted->bv_len - 1;
match = dnIsOneLevelRDN( &rdn ) ? 0 : 1;
}
} else {
return 1;
}
}
*matchp = match;
return LDAP_SUCCESS;
}
/* should not be reachable */
assert( 0 );
return LDAP_OTHER;
}

View File

@ -3217,7 +3217,6 @@ static slap_mrule_defs_rec mrule_defs[] = {
NULL, NULL,
NULL },
#if 0
{"( 1.3.6.1.4.1.4203.666.4.8 NAME 'dnOneLevelMatch' "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )",
SLAP_MR_HIDE | SLAP_MR_EXT, NULL,
@ -3238,7 +3237,6 @@ static slap_mrule_defs_rec mrule_defs[] = {
NULL, dnNormalize, dnRelativeMatch,
NULL, NULL,
NULL },
#endif
{"( 1.2.36.79672281.1.13.3 NAME 'rdnMatch' "
"SYNTAX 1.2.36.79672281.1.5.0 )",

View File

@ -993,16 +993,12 @@ static struct slap_schema_mr_map {
offsetof(struct slap_internal_schema, si_mr_distinguishedNameMatch) },
{ "dnSubtreeMatch",
offsetof(struct slap_internal_schema, si_mr_dnSubtreeMatch) },
#if 0
{ "dnOneLevelMatch",
offsetof(struct slap_internal_schema, si_mr_dnOneLevelMatch) },
{ "dnSubordinateMatch",
offsetof(struct slap_internal_schema, si_mr_dnSubordinateMatch) },
{ "dnSuperiorMatch",
offsetof(struct slap_internal_schema, si_mr_dnSuperiorMatch) },
#endif
{ "integerMatch",
offsetof(struct slap_internal_schema, si_mr_integerMatch) },
{ "integerFirstComponentMatch",

View File

@ -869,11 +869,9 @@ struct slap_internal_schema {
/* Matching Rules */
MatchingRule *si_mr_distinguishedNameMatch;
MatchingRule *si_mr_dnSubtreeMatch;
#if 0
MatchingRule *si_mr_dnOneLevelMatch;
MatchingRule *si_mr_dnSubordinateMatch;
MatchingRule *si_mr_dnSuperiorMatch;
#endif
MatchingRule *si_mr_caseExactMatch;
MatchingRule *si_mr_caseExactSubstringsMatch;
MatchingRule *si_mr_caseExactIA5Match;