Fix bug in last commit

This commit is contained in:
Kurt Zeilenga 2002-08-27 02:43:00 +00:00
parent 433eb54dc7
commit 6ec6115119
2 changed files with 7 additions and 8 deletions

View 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;
}

View 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;