]> git.sur5r.net Git - openldap/commitdiff
Put more old schema code behind SLAPD_SCHEMA_COMPAT (which still
authorKurt Zeilenga <kurt@openldap.org>
Fri, 28 Jan 2000 00:33:29 +0000 (00:33 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 28 Jan 2000 00:33:29 +0000 (00:33 +0000)
MUST be defined).

servers/slapd/acl.c
servers/slapd/attr.c
servers/slapd/ava.c
servers/slapd/backend.c
servers/slapd/filter.c
servers/slapd/filterentry.c
servers/slapd/schema.c
servers/slapd/slap.h
servers/slapd/value.c

index fe3029b9c5f5055d567449034f1d787a17cc3ceb..9753015e45ba0be474a3a6a4d4c5deb93484d729 100644 (file)
@@ -403,18 +403,28 @@ acl_mask(
                        bv.bv_len = strlen( bv.bv_val );
 
                        /* see if asker is listed in dnattr */ 
-                       if ( (at = attr_find( e->e_attrs, b->a_dn_at )) != NULL &&
-                               value_find( at->a_vals, &bv, at->a_syntax, 3 ) == 0 )
+                       if ( (at = attr_find( e->e_attrs, b->a_dn_at )) != NULL
+#ifdef SLAPD_SCHEMA_COMPAT
+                               && value_find( at->a_vals, &bv, at->a_syntax, 3 ) == 0
+#endif
+                       )
                        {
                                if ( b->a_dn_self && 
-                                       (val == NULL || value_cmp( &bv, val, at->a_syntax, 2 )) )
+                                       (val == NULL
+#ifdef SLAPD_SCHEMA_COMPAT
+                                       || value_cmp( &bv, val, at->a_syntax, 2 )
+#endif
+                                       ) )
                                {
                                        continue;
                                }
 
                        /* asker not listed in dnattr - check for self access */
-                       } else if ( ! b->a_dn_self || val == NULL ||
-                               value_cmp( &bv, val, at->a_syntax, 2 ) != 0 )
+                       } else if ( ! b->a_dn_self || val == NULL
+#ifdef SLAPD_SCHEMA_COMPAT
+                               || value_cmp( &bv, val, at->a_syntax, 2 ) != 0
+#endif
+                       )
                        {
                                continue;
                        }
index 74407d493c56b2b57c028b1b99d80d78a7f2fa02..f61c7b218f3cb431ce68aa77459a505d919f28a3 100644 (file)
@@ -75,7 +75,9 @@ Attribute *attr_dup( Attribute *a )
        }
 
        tmp->a_type = ch_strdup( a->a_type );
+#ifdef SLAPD_SCHEMA_COMPAT
        tmp->a_syntax = a->a_syntax;
+#endif
        tmp->a_next = NULL;
 
        return tmp;
@@ -142,7 +144,9 @@ attr_merge_fast(
                **a = (Attribute *) ch_malloc( sizeof(Attribute) );
                (**a)->a_type = attr_normalize( ch_strdup( type ) );
                (**a)->a_vals = NULL;
+#ifdef SLAPD_SCHEMA_COMPAT
                (**a)->a_syntax = attr_syntax( type );
+#endif
                (**a)->a_next = NULL;
        }
 
@@ -176,7 +180,9 @@ attr_merge(
                *a = (Attribute *) ch_malloc( sizeof(Attribute) );
                (*a)->a_type = attr_normalize( ch_strdup( type ) );
                (*a)->a_vals = NULL;
+#ifdef SLAPD_SCHEMA_COMPAT
                (*a)->a_syntax = attr_syntax( type );
+#endif
                (*a)->a_next = NULL;
        }
 
@@ -235,6 +241,8 @@ attr_delete(
        return( 0 );
 }
 
+#ifdef SLAPD_SCHEMA_COMPAT
+
 #define DEFAULT_SYNTAX SYNTAX_CIS
 
 /*
@@ -253,6 +261,7 @@ attr_syntax( char *type )
 
        return( DEFAULT_SYNTAX );
 }
+#endif
 
 /*
  * attr_syntax_config - process an attribute syntax config line
index b3f314050abd88193ed4196eba1acfdf06485ff3..5bc0ec3d6b764d8d4449070b11b6f86e24f4336c 100644 (file)
@@ -26,7 +26,9 @@ get_ava(
                return( -1 );
        }
        attr_normalize( ava->ava_type );
+#ifdef SLAPD_SCHEMA_COMPAT
        value_normalize( ava->ava_value.bv_val, attr_syntax( ava->ava_type ) );
+#endif
 
        return( LDAP_SUCCESS );
 }
index 3f185868d07de62ec31c3e566607a077dc5e64b1..9aa6568a60b74c7114b5b6d75a4c268c1b55b687 100644 (file)
@@ -631,7 +631,11 @@ backend_group(
 #ifdef SLAPD_SCHEMA_DN
 Attribute *backend_subschemasubentry( Backend *be )
 {
+       /*
+        * This routine returns points to STATIC data!!!
+        */
        /* should be backend specific */
+
        static struct berval ss_val = {
                sizeof(SLAPD_SCHEMA_DN)-1,
                SLAPD_SCHEMA_DN };
@@ -639,7 +643,9 @@ Attribute *backend_subschemasubentry( Backend *be )
        static Attribute ss_attr = {
                "subschemasubentry",
                ss_vals,
+#ifdef SLAPD_SCHEMA_COMPAT
                SYNTAX_DN | SYNTAX_CIS,
+#endif
                NULL
        };
 
index ad0aed6461a1761f5814ec3dd9299d78b2432368..d02e65733020b326e5bafe968546082307e2b899 100644 (file)
@@ -241,8 +241,10 @@ get_substring_filter(
 
        attr_normalize( f->f_sub_type );
 
+#ifdef SLAPD_SCHEMA_COMPAT
        /* should get real syntax and see if we have a substring matching rule */
        syntax = attr_syntax( f->f_sub_type );
+#endif
 
        f->f_sub_initial = NULL;
        f->f_sub_any = NULL;
@@ -265,8 +267,10 @@ get_substring_filter(
                        return( LDAP_INVALID_SYNTAX );
                }
 
+#ifdef SLAPD_SCHEMA_COMPAT
                /* we should call a substring syntax normalization routine */
                value_normalize( val->bv_val, syntax );
+#endif
 
                /* this is bogus, value_normalize should take a berval */
                val->bv_len = strlen( val->bv_val );
index f1c54dbbfc1cb990b9026c43bda5212bc1bedc98..9c28bd2659a2a3f9ac5035f569382b48e021a4b6 100644 (file)
@@ -125,12 +125,19 @@ test_ava_filter(
                return( -1 );
        }
 
+#ifdef SLAPD_SCHEMA_COMPAT
        if ( a->a_syntax == 0 ) {
                a->a_syntax = attr_syntax( ava->ava_type );
        }
+#endif
+
        for ( i = 0; a->a_vals[i] != NULL; i++ ) {
+#ifdef SLAPD_SCHEMA_COMPAT
                rc = value_cmp( a->a_vals[i], &ava->ava_value, a->a_syntax,
                    3 );
+#else
+               rc = 0;
+#endif
 
                switch ( type ) {
                case LDAP_FILTER_EQUALITY:
@@ -340,11 +347,13 @@ test_substring_filter(
                return( -1 );
        }
 
+#ifdef SLAPD_SCHEMA_COMPAT
        if ( a->a_syntax & SYNTAX_BIN ) {
                Debug( LDAP_DEBUG_FILTER, "test_substring_filter bin attr\n",
                    0, 0, 0 );
                return( -1 );
        }
+#endif
 
        /*
         * construct a regular expression corresponding to the
@@ -418,7 +427,10 @@ test_substring_filter(
                        strcpy( tmp, val->bv_val );
                        realval = tmp;
                }
+
+#ifdef SLAPD_SCHEMA_COMPAT
                value_normalize( realval, a->a_syntax );
+#endif
 
                rc = !regexec(&re, realval, 0, NULL, 0);
 
index 1e5287f740bfbbaaae2d5e99e8de7871895a6c0a..12fa72f6927f9707b332abd166502da61410d2cc 100644 (file)
@@ -1629,10 +1629,12 @@ int is_entry_objectclass(
        bv.bv_val = (char *) oc;
        bv.bv_len = strlen( bv.bv_val );
 
+#ifdef SLAPD_SCHEMA_COMPAT
        if( value_find(attr->a_vals, &bv, attr->a_syntax, 1) != 0) {
                /* entry is not of this objectclass */
                return 0;
        }
+#endif
 
        return 1;
 }
index bb6c31bdee659f971cc2835baa16b615ac4c01e9..6baf40b09c4d9c34ad2a85506fb40af3f6a73107 100644 (file)
@@ -199,7 +199,7 @@ typedef struct slap_attribute_type {
 #define sat_syntax_oid         sat_atype.at_syntax_oid
 #define sat_single_value       sat_atype.at_single_value
 #define sat_collective         sat_atype.at_collective
-#define sat_no_user_mods       sat_atype.at_no_user_mods
+#define sat_no_user_mod                sat_atype.at_no_user_mod
 #define sat_usage              sat_atype.at_usage
 } AttributeType;
 
index 2a0ea1600968e3ec3a9cb1f1b0652975f402f2d3..37d0e7b6dc7d0f15d5d194ab18ad18eedb2e512f 100644 (file)
@@ -83,6 +83,7 @@ value_add(
        return( 0 );
 }
 
+#ifdef SLAPD_SCHEMA_COMPAT
 void
 value_normalize(
     char       *s,
@@ -176,3 +177,4 @@ value_find(
 
        return( 1 );
 }
+#endif