]> git.sur5r.net Git - openldap/commitdiff
place old schema codes behind -DSLAPD_SCHEMA_COMPAT
authorKurt Zeilenga <kurt@openldap.org>
Fri, 28 Jan 2000 01:17:58 +0000 (01:17 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 28 Jan 2000 01:17:58 +0000 (01:17 +0000)
servers/slapd/back-ldbm/attr.c
servers/slapd/back-ldbm/compare.c
servers/slapd/back-ldbm/group.c
servers/slapd/back-ldbm/index.c
servers/slapd/back-ldbm/modify.c

index 37a5cf94b34b929be3ca297594108ad4982f2a21..c8cd6b5cc76bb497c2a63dcc8b2709a87ba5e4c8 100644 (file)
@@ -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);
index 75e5695d9dab8bcb23bd93755d536733d1b80074..4fff70baa5751ed243ed08327b2e9634a4b89ee9 100644 (file)
@@ -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 );
 
index 8dbe75922a4ad251cc7c1cb04dec006a6c5ef916..198100b3ca9f81941f1657c65157490b9e321085 100644 (file)
@@ -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 ) {
index 7c6f8a7a0294860470a637a56b1a14e1142ebf2a..703d9017b09c4f65247827870f328622f5c85b93 100644 (file)
@@ -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 );
 
index b3f104fcc9c7844ec8e352eaf8110aba02c825b8..3e760e64b47fe5eb66b7db09710722723681af66 100644 (file)
@@ -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 */