Commit 910076d2 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add additional DN matching rules.

parent 741f9ea3
......@@ -1001,10 +1001,66 @@ 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;
}
......
......@@ -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 )",
......
......@@ -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",
......
......@@ -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;
......
Supports Markdown
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