]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_check.c
ITS#5469
[openldap] / servers / slapd / schema_check.c
index 7a8ace4e48e7445a1e5618614291850db60196bc..2c46ede1559f3984cc9e97bf6cc89e462010fcdf 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2008 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -328,11 +328,11 @@ entry_schema_check(
                                ObjectClass *xc = NULL;
                                for( j=0; aoc->a_vals[j].bv_val; j++ ) {
                                        if( i != j ) {
-                                               xc = oc_bvfind( &aoc->a_vals[i] );
+                                               xc = oc_bvfind( &aoc->a_vals[j] );
                                                if( xc == NULL ) {
                                                        snprintf( textbuf, textlen, 
                                                                "unrecognized objectClass '%s'",
-                                                               aoc->a_vals[i].bv_val );
+                                                               aoc->a_vals[j].bv_val );
 
                                                        Debug( LDAP_DEBUG_ANY,
                                                                "entry_check_schema(%s): %s\n",
@@ -356,8 +356,8 @@ entry_schema_check(
                                        }
                                }
 
-                               if( xc == NULL ) {
-                                       snprintf( textbuf, textlen, "instanstantiation of "
+                               if( xc != NULL ) {
+                                       snprintf( textbuf, textlen, "instantiation of "
                                                "abstract objectClass '%s' not allowed",
                                                aoc->a_vals[i].bv_val );