X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Foc.c;h=3301a702bb9567b6d39104ff3e789793b3a49b83;hb=27cb98d28d60b1f258ea12852b22bfdfec6380f6;hp=16a64ebf514af8e002b31686b97608263676b61f;hpb=f5e6d1db410c11b26dfe5ef2e5563f51e136c830;p=openldap diff --git a/servers/slapd/oc.c b/servers/slapd/oc.c index 16a64ebf51..3301a702bb 100644 --- a/servers/slapd/oc.c +++ b/servers/slapd/oc.c @@ -286,7 +286,7 @@ oc_add_sups( && soc1->soc_kind != LDAP_SCHEMA_ABSTRACT ) { *err = *sups1; - return SLAP_SCHERR_CLASS_BAD_USAGE; + return SLAP_SCHERR_CLASS_BAD_SUP; } if( soc->soc_flags & SLAP_OC_OPERATIONAL ) (*op)++; @@ -465,31 +465,6 @@ oc_add( return code; } -#ifdef LDAP_DEBUG -static void -oc_print( ObjectClass *oc ) -{ - int i; - const char *mid; - - printf( "objectclass %s\n", ldap_objectclass2name( &oc->soc_oclass ) ); - if ( oc->soc_required != NULL ) { - mid = "\trequires "; - for ( i = 0; oc->soc_required[i] != NULL; i++, mid = "," ) - printf( "%s%s", mid, - ldap_attributetype2name( &oc->soc_required[i]->sat_atype ) ); - printf( "\n" ); - } - if ( oc->soc_allowed != NULL ) { - mid = "\tallows "; - for ( i = 0; oc->soc_allowed[i] != NULL; i++, mid = "," ) - printf( "%s%s", mid, - ldap_attributetype2name( &oc->soc_allowed[i]->sat_atype ) ); - printf( "\n" ); - } -} -#endif - int oc_schema_info( Entry *e ) { @@ -501,12 +476,12 @@ oc_schema_info( Entry *e ) vals[1].bv_val = NULL; for ( oc = oc_list; oc; oc = oc->soc_next ) { + if( oc->soc_flags & SLAP_OC_HIDE ) continue; + if ( ldap_objectclass2bv( &oc->soc_oclass, vals ) == NULL ) { return -1; } - if( oc->soc_flags & SLAP_OC_HIDE ) continue; - #if 0 Debug( LDAP_DEBUG_TRACE, "Merging oc [%ld] %s\n", (long) vals[0].bv_len, vals[0].bv_val, 0 );