MUST be defined).
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;
}
}
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;
**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;
}
*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;
}
return( 0 );
}
+#ifdef SLAPD_SCHEMA_COMPAT
+
#define DEFAULT_SYNTAX SYNTAX_CIS
/*
return( DEFAULT_SYNTAX );
}
+#endif
/*
* attr_syntax_config - process an attribute syntax config line
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 );
}
#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 };
static Attribute ss_attr = {
"subschemasubentry",
ss_vals,
+#ifdef SLAPD_SCHEMA_COMPAT
SYNTAX_DN | SYNTAX_CIS,
+#endif
NULL
};
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;
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 );
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:
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
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);
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;
}
#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;
return( 0 );
}
+#ifdef SLAPD_SCHEMA_COMPAT
void
value_normalize(
char *s,
return( 1 );
}
+#endif