From: Kurt Zeilenga Date: Mon, 31 Jan 2000 17:59:10 +0000 (+0000) Subject: Put type;option trimming codes behind SLAPD_SCHEMA_COMPAT. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~3211 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=10fdd7ff7c93813304b475926869b00c66a44464;p=openldap Put type;option trimming codes behind SLAPD_SCHEMA_COMPAT. Attribute subtyping, especially that using attribute description options, will have to reengineered. --- diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 3dc8604e14..ea106f75f6 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -75,9 +75,7 @@ Attribute *attr_dup( Attribute *a ) } tmp->a_type = ch_strdup( a->a_type ); -#ifdef SLAPD_SCHEMA_NOT_COMPAT - tmp->a_at = a->a_at; -#else +#ifdef SLAPD_SCHEMA_COMPAT tmp->a_syntax = a->a_syntax; #endif tmp->a_next = NULL; @@ -407,19 +405,23 @@ at_find( const char *name ) { - struct aindexrec *air = NULL; - char *p, *tmpname = NULL; + struct aindexrec *air; + char *tmpname; +#ifdef SLAPD_SCHEMA_COMPAT /* * The name may actually be an AttributeDescription, i.e. it may - * contain options. Let's deal with it. + * contain options. */ - p = strchr( name, ';' ); + /* Treat any attribute type with option as an unknown attribute type */ + char *p = strchr( name, ';' ); if ( p ) { tmpname = ch_malloc( p-name+1 ); strncpy( tmpname, name, p-name ); tmpname[p-name] = '\0'; - } else { + } else +#endif + { tmpname = (char *)name; } diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index d6f44970ae..89bf6a0a1b 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -127,6 +127,7 @@ do_compare( send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM, NULL, "Function not implemented", NULL, NULL ); } + cleanup: free( dn ); free( ndn ); diff --git a/servers/slapd/schema.c b/servers/slapd/schema.c index faf08c7812..b07b67189a 100644 --- a/servers/slapd/schema.c +++ b/servers/slapd/schema.c @@ -201,7 +201,7 @@ static char *oc_op_no_usermod_attrs[] = { int oc_check_op_attr( const char *type ) { -#ifdef SLAPD_SCHEMA_COMPAT +#ifndef SLAPD_SCHEMA_NOT_COMPAT return charray_inlist( oc_op_attrs, type ) || charray_inlist( oc_op_usermod_attrs, type ) || charray_inlist( oc_op_no_usermod_attrs, type ); @@ -210,7 +210,7 @@ oc_check_op_attr( const char *type ) if( at == NULL ) return 0; - return at->sat_usage != 0; + return at->sat_usage != LDAP_SCHEMA_USER_APPLICATIONS; #endif } @@ -263,6 +263,8 @@ oc_check_allowed( char *type, struct berval **ocl ) return( 0 ); } +#ifdef SLAPD_SCHEMA_COMPAT + /* Treat any attribute type with option as an unknown attribute type */ /* * The "type" we have received is actually an AttributeDescription. * Let's find out the corresponding type. @@ -276,10 +278,13 @@ oc_check_allowed( char *type, struct berval **ocl ) "oc_check_allowed type \"%s\" from \"%s\"\n", t, type, 0 ); - } else { + } else +#endif + { t = type; } + /* * All operational attributions are allowed by schema rules. */ diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 8323344a4d..5c77b873bb 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -339,9 +339,7 @@ typedef struct slap_filter { typedef struct slap_attr { char *a_type; /* description */ struct berval **a_vals; -#ifdef SLAPD_SCHEMA_NOT_COMPAT - AttributeType *a_at; /* attribute type */ -#else +#ifdef SLAPD_SCHEMA_COMPAT int a_syntax; #endif struct slap_attr *a_next;