fix return code in case the asserted DN does not exist (ITS#4224)

This commit is contained in:
Pierangelo Masarati 2005-11-29 00:09:39 +00:00
parent a0d9bd7890
commit 976d6b4b66
2 changed files with 22 additions and 3 deletions

View File

@ -67,9 +67,16 @@ dyngroup_response( Operation *op, SlapReply *rs )
rs->sr_err = backend_group( op, NULL, &op->o_req_ndn,
&op->oq_compare.rs_ava->aa_value, NULL, ap->ap_uri );
op->o_do_not_cache = cache;
if ( rs->sr_err == LDAP_SUCCESS )
switch ( rs->sr_err ) {
case LDAP_SUCCESS:
rs->sr_err = LDAP_COMPARE_TRUE;
break;
case LDAP_NO_SUCH_OBJECT:
rs->sr_err = LDAP_COMPARE_FALSE;
break;
}
break;
}
}
}

View File

@ -514,8 +514,20 @@ dynlist_compare( Operation *op, SlapReply *rs )
rs->sr_err = backend_group( op, NULL, &op->o_req_ndn,
&op->oq_compare.rs_ava->aa_value, dli->dli_oc, dli->dli_ad );
op->o_do_not_cache = cache;
if ( rs->sr_err == LDAP_SUCCESS ) {
switch ( rs->sr_err ) {
case LDAP_SUCCESS:
rs->sr_err = LDAP_COMPARE_TRUE;
break;
case LDAP_NO_SUCH_OBJECT:
/* NOTE: backend_group() returns noSuchObject
* if op_ndn does not exist; however, since
* dynamic list expansion means that the
* member attribute is virtually present, the
* non-existence of the asserted value implies
* the assertion is FALSE rather than
* UNDEFINED */
rs->sr_err = LDAP_COMPARE_FALSE;
}
return SLAP_CB_CONTINUE;