From: Kurt Zeilenga Date: Fri, 28 Jan 2000 01:17:58 +0000 (+0000) Subject: place old schema codes behind -DSLAPD_SCHEMA_COMPAT X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~3229 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=51190984eefbdbedd47185e41ece37f72773744d;p=openldap place old schema codes behind -DSLAPD_SCHEMA_COMPAT --- diff --git a/servers/slapd/back-ldbm/attr.c b/servers/slapd/back-ldbm/attr.c index 37a5cf94b3..c8cd6b5cc7 100644 --- a/servers/slapd/back-ldbm/attr.c +++ b/servers/slapd/back-ldbm/attr.c @@ -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); diff --git a/servers/slapd/back-ldbm/compare.c b/servers/slapd/back-ldbm/compare.c index 75e5695d9d..4fff70baa5 100644 --- a/servers/slapd/back-ldbm/compare.c +++ b/servers/slapd/back-ldbm/compare.c @@ -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 ); diff --git a/servers/slapd/back-ldbm/group.c b/servers/slapd/back-ldbm/group.c index 8dbe75922a..198100b3ca 100644 --- a/servers/slapd/back-ldbm/group.c +++ b/servers/slapd/back-ldbm/group.c @@ -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 ) { diff --git a/servers/slapd/back-ldbm/index.c b/servers/slapd/back-ldbm/index.c index 7c6f8a7a02..703d9017b0 100644 --- a/servers/slapd/back-ldbm/index.c +++ b/servers/slapd/back-ldbm/index.c @@ -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 ); diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index b3f104fcc9..3e760e64b4 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -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 */