]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/oc.c
cleanup comments
[openldap] / servers / slapd / oc.c
index 02f6ea402212c9206dff7f9fcbdb6d69477e64fd..1920762bc9c5c89420be899cc07bc5e496dafcce 100644 (file)
@@ -25,8 +25,14 @@ int is_object_subclass(
        if( sub == NULL || sup == NULL ) return 0;
 
 #if 1
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ARGS, 
+               "is_object_subclass(%s,%s) %d\n",
+               sup->soc_oid, sub->soc_oid, sup == sub );
+#else
        Debug( LDAP_DEBUG_TRACE, "is_object_subclass(%s,%s) %d\n",
                sup->soc_oid, sub->soc_oid, sup == sub );
+#endif
 #endif
 
        if( sup == sub ) {
@@ -72,10 +78,10 @@ int is_entry_objectclass(
        if( attr == NULL ) {
                /* no objectClass attribute */
 #ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR, "is_entry_objectclass: "
-                       "dn(%s), oid (%s), no objectClass attribute.\n",
-                       e->e_dn == NULL ? "" : e->e_dn,
-                       oc->soc_oclass.oc_oid ));
+               LDAP_LOG( OPERATION, ERR, 
+                       "is_entry_objectclass: dn(%s), oid (%s), no objectClass "
+                       "attribute.\n", e->e_dn == NULL ? "" : e->e_dn,
+                       oc->soc_oclass.oc_oid, 0 );
 #else
                Debug( LDAP_DEBUG_ANY, "is_entry_objectclass(\"%s\", \"%s\") "
                        "no objectClass attribute\n",
@@ -428,6 +434,13 @@ oc_add(
        soc = (ObjectClass *) ch_calloc( 1, sizeof(ObjectClass) );
        AC_MEMCPY( &soc->soc_oclass, oc, sizeof(LDAPObjectClass) );
 
+       if( oc->oc_names != NULL ) {
+               soc->soc_cname.bv_val = soc->soc_names[0];
+       } else {
+               soc->soc_cname.bv_val = soc->soc_oid;
+       }
+       soc->soc_cname.bv_len = strlen( soc->soc_cname.bv_val );
+
        if( soc->soc_sup_oids == NULL &&
                soc->soc_kind == LDAP_SCHEMA_STRUCTURAL )
        {