*/
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;
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
Attribute *a = e->e_attrs
? attr_find( e->e_attrs, mod->mod_type )
: NULL;
-#endif
if( a != NULL ) {
(void) index_change_values( be,
e->e_id,
SLAP_INDEX_ADD_OP );
}
+#endif
} break;
}
}
#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
*/
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 );
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) );
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) = '=';
}
*(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 );
}