Commit 1086ffb4 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Round one of subclass indexing for objectClass and structualObjectClasss.

add soc_cname to ObjectClass structure
parent b9cd3616
...@@ -434,6 +434,13 @@ oc_add( ...@@ -434,6 +434,13 @@ oc_add(
soc = (ObjectClass *) ch_calloc( 1, sizeof(ObjectClass) ); soc = (ObjectClass *) ch_calloc( 1, sizeof(ObjectClass) );
AC_MEMCPY( &soc->soc_oclass, oc, sizeof(LDAPObjectClass) ); AC_MEMCPY( &soc->soc_oclass, oc, sizeof(LDAPObjectClass) );
if( oc->oc_names != NULL ) {
soc->soc_cname.bv_val = soc->soc_names[0];
} else {
soc->soc_cname.bv_val = soc->soc_oid;
}
soc->soc_cname.bv_len = strlen( soc->soc_cname.bv_val );
if( soc->soc_sup_oids == NULL && if( soc->soc_sup_oids == NULL &&
soc->soc_kind == LDAP_SCHEMA_STRUCTURAL ) soc->soc_kind == LDAP_SCHEMA_STRUCTURAL )
{ {
......
...@@ -893,6 +893,24 @@ LDAP_SLAPD_V( int ) schema_init_done; ...@@ -893,6 +893,24 @@ LDAP_SLAPD_V( int ) schema_init_done;
LDAP_SLAPD_F (int) slap_schema_init LDAP_P((void)); LDAP_SLAPD_F (int) slap_schema_init LDAP_P((void));
LDAP_SLAPD_F (void) schema_destroy LDAP_P(( void )); LDAP_SLAPD_F (void) schema_destroy LDAP_P(( void ));
LDAP_SLAPD_F( int ) octetStringIndexer(
slap_mask_t use,
slap_mask_t flags,
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
BerVarray values,
BerVarray *keysp );
LDAP_SLAPD_F( int ) octetStringFilter(
slap_mask_t use,
slap_mask_t flags,
Syntax *syntax,
MatchingRule *mr,
struct berval *prefix,
void * assertValue,
BerVarray *keysp );
/* /*
* schema_prep.c * schema_prep.c
*/ */
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
/* recycled matching routines */ /* recycled matching routines */
#define bitStringMatch octetStringMatch #define bitStringMatch octetStringMatch
#define numericStringMatch caseIgnoreIA5Match #define numericStringMatch caseIgnoreIA5Match
#define objectIdentifierMatch caseIgnoreIA5Match #define objectIdentifierMatch octetStringMatch
#define telephoneNumberMatch caseIgnoreIA5Match #define telephoneNumberMatch caseIgnoreIA5Match
#define telephoneNumberSubstringsMatch caseIgnoreIA5SubstringsMatch #define telephoneNumberSubstringsMatch caseIgnoreIA5SubstringsMatch
#define generalizedTimeMatch caseIgnoreIA5Match #define generalizedTimeMatch caseIgnoreIA5Match
...@@ -138,7 +138,7 @@ octetStringMatch( ...@@ -138,7 +138,7 @@ octetStringMatch(
} }
/* Index generation function */ /* Index generation function */
static int octetStringIndexer( int octetStringIndexer(
slap_mask_t use, slap_mask_t use,
slap_mask_t flags, slap_mask_t flags,
Syntax *syntax, Syntax *syntax,
...@@ -186,6 +186,7 @@ static int octetStringIndexer( ...@@ -186,6 +186,7 @@ static int octetStringIndexer(
} }
keys[i].bv_val = NULL; keys[i].bv_val = NULL;
keys[i].bv_len = 0;
*keysp = keys; *keysp = keys;
...@@ -193,7 +194,7 @@ static int octetStringIndexer( ...@@ -193,7 +194,7 @@ static int octetStringIndexer(
} }
/* Index generation function */ /* Index generation function */
static int octetStringFilter( int octetStringFilter(
slap_mask_t use, slap_mask_t use,
slap_mask_t flags, slap_mask_t flags,
Syntax *syntax, Syntax *syntax,
...@@ -231,6 +232,7 @@ static int octetStringFilter( ...@@ -231,6 +232,7 @@ static int octetStringFilter(
ber_dupbv( keys, &digest ); ber_dupbv( keys, &digest );
keys[1].bv_val = NULL; keys[1].bv_val = NULL;
keys[1].bv_len = 0;
*keysp = keys; *keysp = keys;
......
This diff is collapsed.
...@@ -505,7 +505,8 @@ typedef int (ObjectClassSchemaCheckFN)( ...@@ -505,7 +505,8 @@ typedef int (ObjectClassSchemaCheckFN)(
char *textbuf, size_t textlen ); char *textbuf, size_t textlen );
typedef struct slap_object_class { typedef struct slap_object_class {
LDAPObjectClass soc_oclass; LDAPObjectClass soc_oclass;
struct berval soc_cname;
struct slap_object_class **soc_sups; struct slap_object_class **soc_sups;
AttributeType **soc_required; AttributeType **soc_required;
AttributeType **soc_allowed; AttributeType **soc_allowed;
......
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