ITS#7901 slapschema: preserve errors in -c mode

This commit is contained in:
Arvid Requate 2025-10-21 16:56:02 +01:00 committed by Quanah Gibson-Mount
parent 9731103ffb
commit 7929b3ee77

View file

@ -45,6 +45,7 @@ slapschema( int argc, char **argv )
{
ID id;
int rc = EXIT_SUCCESS;
int result = EXIT_SUCCESS;
const char *progname = "slapschema";
Connection conn = { 0 };
OperationBuffer opbuf;
@ -117,7 +118,7 @@ slapschema( int argc, char **argv )
e = be->be_entry_get( be, id );
if ( e == NULL ) {
printf("# no data for entry id=%08lx\n\n", (long) id );
rc = EXIT_FAILURE;
result = EXIT_FAILURE;
if( continuemode ) continue;
break;
}
@ -133,6 +134,7 @@ slapschema( int argc, char **argv )
if ( filter != NULL ) {
int rc = test_filter( NULL, e, filter );
if ( rc != LDAP_COMPARE_TRUE ) {
result = rc;
be_entry_release_r( op, e );
continue;
}
@ -151,15 +153,19 @@ slapschema( int argc, char **argv )
text ? ": " : "",
text ? text : "" );
fprintf( ldiffp->fp, "dn: %s\n\n", e->e_name.bv_val );
result = rc;
}
be_entry_release_r( op, e );
if ( result != LDAP_SUCCESS && !continuemode ) {
break;
}
}
be->be_entry_close( be );
if ( slap_tool_destroy() )
rc = EXIT_FAILURE;
result = EXIT_FAILURE;
return rc;
return result;
}