]> git.sur5r.net Git - openldap/commitdiff
SLAPD_SCHEMA_NOT_COMPAT addl. filter changes (a work in progress).
authorKurt Zeilenga <kurt@openldap.org>
Mon, 15 May 2000 00:41:29 +0000 (00:41 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 15 May 2000 00:41:29 +0000 (00:41 +0000)
servers/slapd/at.c
servers/slapd/back-ldbm/index.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/tools.c
servers/slapd/slap.h
servers/slapd/str2filter.c

index deb586a95c62fafc7418fee54ab887f62e5c7dc0..9a7872db7a7241182d2e373d2dd5ef79f7e6ac84 100644 (file)
@@ -441,8 +441,9 @@ at_add(
         */
        if ( sat->sat_sup ) {
                sat->sat_syntax = sat->sat_sup->sat_syntax;
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
                sat->sat_syntax_compat = sat->sat_sup->sat_syntax_compat;
-
+#endif
                sat->sat_equality = sat->sat_sup->sat_equality;
                sat->sat_ordering = sat->sat_sup->sat_ordering;
                sat->sat_substr = sat->sat_sup->sat_substr;
index f724292680ffe6b73a18304f5b1b7fe64e1ebdbe..05afcf2dccc180e6a6ae480a734d9e56cedb9527 100644 (file)
@@ -233,6 +233,7 @@ index_change_values(
     unsigned int       op
 )
 {
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
        char            *val, *p, *code, *w;
        unsigned        i, j, len;
        int             indexmask, syntax;
@@ -413,6 +414,7 @@ index_change_values(
 
 done:
        ldbm_cache_close( be, db );
+#endif
        return( 0 );
 }
 
index ba85fd435a20c86cfec94a2dbd3c8e4696ab9de0..d7a98d6f1ecb8dcfca410644415d0c0fb673244d 100644 (file)
@@ -175,7 +175,12 @@ int ldbm_modify_internal(
        for ( ml = modlist; ml != NULL; ml = ml->sml_next ) {
                mod = &ml->sml_mod;
 
-               switch ( mod->mod_op ) {
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               switch ( mod->sm_op )
+#else
+               switch ( mod->mod_op )
+#endif
+               {
                case LDAP_MOD_REPLACE:
                case LDAP_MOD_ADD:
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
@@ -197,7 +202,6 @@ int ldbm_modify_internal(
                        Attribute *a = e->e_attrs
                                ? attr_find( e->e_attrs, mod->mod_type )
                                : NULL;
-#endif
 
                        if( a != NULL ) {
                                (void) index_change_values( be,
@@ -206,6 +210,7 @@ int ldbm_modify_internal(
                                        e->e_id,
                                        SLAP_INDEX_ADD_OP );
                        }
+#endif
                        } break;
                }
        }
index fd1b0683a288d79ce5fc3c7e17dd0dc39ce4ae2f..0d96f70049bcd13bf13dbb1e0a3d461658d21c05 100644 (file)
@@ -220,6 +220,7 @@ int ldbm_tool_index_attr(
                return 0;
        }
 #endif
+
        assert( at_cn != NULL );
        attr_mask( be->be_private, at_cn, &indexmask );
 
index ae5e5353975ad214b86825715dec3d0f937d19da..391c9e9745562ea2f65324eb93f04c0da07b2922 100644 (file)
@@ -106,10 +106,10 @@ LIBSLAPD_F (int) slap_debug;
 #define SLAP_INDEX_EQUALITY      0x0002U
 #define SLAP_INDEX_APPROX        0x0004U
 #define SLAP_INDEX_SUB           0x0008U
-#define SLAP_INDEX_UNKNOWN       0x0010U
+#define SLAP_INDEX_EXTENDED             0x0010U
+#define SLAP_INDEX_UNDEFINED     0x1000U
 #define SLAP_INDEX_FROMINIT      0x8000U       /* psuedo type */
 
-
 /*
  * represents schema information for a database
  */
index ebc26fe4995771aeb5caaf7642d706c87b6eb526..4b371f46d0ab62f3da98c68603e41a5c23907b34 100644 (file)
@@ -145,6 +145,10 @@ str2simple( const char *str )
        Filter          *f;
        char            *s;
        char            *value, savechar;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       int                     rc;
+       char            *text;
+#endif
 
        Debug( LDAP_DEBUG_FILTER, "str2simple \"%s\"\n", str, 0, 0 );
 
@@ -152,7 +156,8 @@ str2simple( const char *str )
                return( NULL );
        }
        value = &s[1];
-       *s-- = '\0';
+
+       *s-- = '\0';    /* we shouldn't be mucking with str */
        savechar = *s;
 
        f = (Filter *) ch_calloc( 1, sizeof(Filter) );
@@ -182,8 +187,16 @@ str2simple( const char *str )
                        f->f_choice = LDAP_FILTER_PRESENT;
                } else {
                        f->f_choice = LDAP_FILTER_SUBSTRINGS;
-#ifndef SLAPD_SCHEMA_NOT_COMPAT
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                       rc = slap_str2ad( str, &f->f_sub_desc, &text );
+                       if( rc != LDAP_SUCCESS ) {
+                               filter_free( f );
+                               *(value-1) = '=';
+                               return NULL;
+                       }
+#else
                        f->f_sub_type = ch_strdup( str );
+#endif
                        if ( str2subvals( value, f ) != 0 ) {
                                filter_free( f );
                                *(value-1) = '=';
@@ -191,24 +204,46 @@ str2simple( const char *str )
                        }
                        *(value-1) = '=';
                        return( f );
-#endif
                }
                break;
        }
 
-#ifndef SLAPD_SCHEMA_NOT_COMPAT
        if ( f->f_choice == LDAP_FILTER_PRESENT ) {
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               rc = slap_str2ad( str, &f->f_desc, &text );
+               if( rc != LDAP_SUCCESS ) {
+                       filter_free( f );
+                       *(value-1) = '=';
+                       return NULL;
+               }
+#else
                f->f_type = ch_strdup( str );
+#endif
        } else {
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               char *tmp;
+
+               rc = slap_str2ad( str, &f->f_av_desc, &text );
+               if( rc != LDAP_SUCCESS ) {
+                       filter_free( f );
+                       *(value-1) = '=';
+                       return NULL;
+               }
+
+               tmp = ch_strdup( value );
+               ldap_pvt_filter_value_unescape( tmp );
+               f->f_av_value = ber_bvstr( tmp );
+#else
                f->f_avtype = ch_strdup( str );
                f->f_avvalue.bv_val = ch_strdup( value );
                ldap_pvt_filter_value_unescape( f->f_avvalue.bv_val );
                f->f_avvalue.bv_len = strlen( value );
+#endif
        }
 
        *s = savechar;
        *(value-1) = '=';
-#endif
+
        return( f );
 }