mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-02 20:10:11 -05:00
ITS#7901 slapschema: preserve errors in -c mode
This commit is contained in:
parent
9731103ffb
commit
7929b3ee77
1 changed files with 9 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue