ITS#2888 fix back-ldap to check result of send_search_entry.

Make sure sizelimit errors are propagated.
This commit is contained in:
Howard Chu 2004-02-13 02:44:13 +00:00
parent 4479b4c417
commit 8a55795fbe
2 changed files with 9 additions and 4 deletions

View File

@ -218,12 +218,13 @@ fail:;
} else if (rc == LDAP_RES_SEARCH_ENTRY) {
Entry ent = {0};
struct berval bdn;
int abort = 0;
e = ldap_first_entry(lc->ld,res);
if ( ldap_build_entry(op, e, &ent, &bdn,
LDAP_BUILD_ENTRY_PRIVATE) == LDAP_SUCCESS ) {
if ( ( rc = ldap_build_entry(op, e, &ent, &bdn,
LDAP_BUILD_ENTRY_PRIVATE)) == LDAP_SUCCESS ) {
rs->sr_entry = &ent;
rs->sr_attrs = op->oq_search.rs_attrs;
send_search_entry( op, rs );
abort = send_search_entry( op, rs );
while (ent.e_attrs) {
Attribute *a;
BerVarray v;
@ -245,6 +246,10 @@ fail:;
free( ent.e_ndn );
}
ldap_msgfree(res);
if ( abort ) {
ldap_abandon(lc->ld, msgid);
goto finish;
}
} else if ( rc == LDAP_RES_SEARCH_REFERENCE ) {
char **references = NULL;

View File

@ -194,7 +194,7 @@ glue_back_response ( Operation *op, SlapReply *rs )
switch(rs->sr_type) {
case REP_SEARCH:
if ( gs->slimit && rs->sr_nentries >= gs->slimit ) {
gs->err = LDAP_SIZELIMIT_EXCEEDED;
rs->sr_err = gs->err = LDAP_SIZELIMIT_EXCEEDED;
return -1;
}
/* fallthru */