mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 16:49:39 -05:00
place old schema codes behind -DSLAPD_SCHEMA_COMPAT
This commit is contained in:
parent
e9b1012fb1
commit
51190984ee
5 changed files with 16 additions and 0 deletions
|
|
@ -79,11 +79,14 @@ attr_masks(
|
|||
}
|
||||
}
|
||||
*indexmask = a->ai_indexmask;
|
||||
|
||||
#ifdef SLAPD_SCHEMA_COMPAT
|
||||
if ( strcasecmp( a->ai_type, "default" ) == 0 ) {
|
||||
*syntaxmask = attr_syntax( type );
|
||||
} else {
|
||||
*syntaxmask = a->ai_syntaxmask;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -107,7 +110,9 @@ attr_index_config(
|
|||
for ( i = 0; attrs[i] != NULL; i++ ) {
|
||||
a = (AttrInfo *) ch_malloc( sizeof(AttrInfo) );
|
||||
a->ai_type = ch_strdup( attrs[i] );
|
||||
#ifdef SLAPD_SCHEMA_COMPAT
|
||||
a->ai_syntaxmask = attr_syntax( a->ai_type );
|
||||
#endif
|
||||
if ( argc == 1 ) {
|
||||
a->ai_indexmask = (INDEX_PRESENCE | INDEX_EQUALITY |
|
||||
INDEX_APPROX | INDEX_SUB);
|
||||
|
|
|
|||
|
|
@ -92,10 +92,12 @@ ldbm_back_compare(
|
|||
goto return_results;
|
||||
}
|
||||
|
||||
#ifdef SLAPD_SCHEMA_COMPAT
|
||||
if ( value_find( a->a_vals, &ava->ava_value, a->a_syntax, 1 ) == 0 )
|
||||
send_ldap_result( conn, op, LDAP_COMPARE_TRUE,
|
||||
NULL, NULL, NULL, NULL );
|
||||
else
|
||||
#endif
|
||||
send_ldap_result( conn, op, LDAP_COMPARE_FALSE,
|
||||
NULL, NULL, NULL, NULL );
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ ldbm_back_group(
|
|||
|
||||
rc = 1;
|
||||
|
||||
#ifdef SLAPD_SCHEMA_COMPAT
|
||||
|
||||
if ((attr = attr_find(e->e_attrs, "objectclass")) == NULL) {
|
||||
Debug( LDAP_DEBUG_ACL,
|
||||
"<= ldbm_back_group: failed to find objectClass\n", 0, 0, 0 );
|
||||
|
|
@ -142,6 +144,7 @@ ldbm_back_group(
|
|||
op_ndn, gr_ndn, groupattrName );
|
||||
|
||||
rc = 0;
|
||||
#endif
|
||||
|
||||
return_results:
|
||||
if( target != e ) {
|
||||
|
|
|
|||
|
|
@ -321,6 +321,7 @@ index_change_values(
|
|||
return( -1 );
|
||||
}
|
||||
|
||||
#ifdef SLAPD_SCHEMA_COMPAT
|
||||
if ( (db = ldbm_cache_open( be, at_cn, LDBM_SUFFIX, mode ))
|
||||
== NULL ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
|
|
@ -444,6 +445,7 @@ index_change_values(
|
|||
}
|
||||
|
||||
ldbm_cache_close( be, db );
|
||||
#endif
|
||||
|
||||
return( 0 );
|
||||
|
||||
|
|
|
|||
|
|
@ -248,10 +248,12 @@ add_values(
|
|||
/* check if the values we're adding already exist */
|
||||
if ( (a = attr_find( e->e_attrs, mod->mod_type )) != NULL ) {
|
||||
for ( i = 0; mod->mod_bvalues[i] != NULL; i++ ) {
|
||||
#ifdef SLAPD_SCHEMA_COMPAT
|
||||
if ( value_find( a->a_vals, mod->mod_bvalues[i],
|
||||
a->a_syntax, 3 ) == 0 ) {
|
||||
return( LDAP_TYPE_OR_VALUE_EXISTS );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -292,10 +294,12 @@ delete_values(
|
|||
for ( i = 0; mod->mod_bvalues[i] != NULL; i++ ) {
|
||||
found = 0;
|
||||
for ( j = 0; a->a_vals[j] != NULL; j++ ) {
|
||||
#ifdef SLAPD_SCHEMA_COMPAT
|
||||
if ( value_cmp( mod->mod_bvalues[i], a->a_vals[j],
|
||||
a->a_syntax, 3 ) != 0 ) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
found = 1;
|
||||
|
||||
/* found a matching value - delete it */
|
||||
|
|
|
|||
Loading…
Reference in a new issue