]> git.sur5r.net Git - openldap/commitdiff
Fix bug in last commit
authorKurt Zeilenga <kurt@openldap.org>
Tue, 27 Aug 2002 02:43:00 +0000 (02:43 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 27 Aug 2002 02:43:00 +0000 (02:43 +0000)
servers/slapd/schema_check.c
servers/slapd/tools/slapadd.c

index 4a57356be71a850e1052e2d4ea895c8c308133d7..b53cd45353e4e35fcdc08211f17835a1537290f9 100644 (file)
@@ -550,7 +550,7 @@ int structural_class(
 
        *scbv = ocs[scn];
 
-       if( scbv->bv_len ) {
+       if( scbv->bv_len == 0 ) {
                *text = "invalid structural object class";
                return LDAP_OBJECT_CLASS_VIOLATION;
        }
index aeede043bb373a1c9fc49fb1ae3ca14d8a5247a0..e993da5fa8fb9f35aab4c156f8a537dd1887114d 100644 (file)
@@ -119,13 +119,12 @@ main( int argc, char **argv )
                        if( sc == NULL ) {
                                struct berval vals[2];
 
-                               /* int ret = */ 
-                               structural_class( oc->a_vals, vals,
+                               rc = structural_class( oc->a_vals, vals,
                                        NULL, &text, textbuf, textlen );
 
-                               if( vals[0].bv_len == 0 ) {
-                                       fprintf( stderr, "%s: dn=\"%s\" (line=%d): %s\n",
-                                               progname, e->e_dn, lineno, text );
+                               if( rc != LDAP_SUCCESS ) {
+                                       fprintf( stderr, "%s: dn=\"%s\" (line=%d): (%d) %s\n",
+                                               progname, e->e_dn, lineno, rc, text );
                                        rc = EXIT_FAILURE;
                                        entry_free( e );
                                        if( continuemode ) continue;
@@ -141,8 +140,8 @@ main( int argc, char **argv )
                        rc = entry_schema_check( be, e, NULL, &text, textbuf, textlen );
 
                        if( rc != LDAP_SUCCESS ) {
-                               fprintf( stderr, "%s: dn=\"%s\" (line=%d): %s\n",
-                                       progname, e->e_dn, lineno, text );
+                               fprintf( stderr, "%s: dn=\"%s\" (line=%d): (%d) %s\n",
+                                       progname, e->e_dn, lineno, rc, text );
                                rc = EXIT_FAILURE;
                                entry_free( e );
                                if( continuemode ) continue;