bi->bi_op_modrdn = relay_back_op_modrdn;
bi->bi_op_add = relay_back_op_add;
bi->bi_op_delete = relay_back_op_delete;
- bi->bi_op_abandon = relay_back_op_abandon;
- bi->bi_op_cancel = relay_back_op_cancel;
bi->bi_extended = relay_back_op_extended;
bi->bi_entry_release_rw = relay_back_entry_release_rw;
bi->bi_entry_get_rw = relay_back_entry_get_rw;
-#if 0 /* see comment in op.c */
- bi->bi_chk_referrals = relay_back_chk_referrals;
-#endif
bi->bi_operational = relay_back_operational;
bi->bi_has_subordinates = relay_back_has_subordinates;
- bi->bi_connection_init = relay_back_connection_init;
- bi->bi_connection_destroy = relay_back_connection_destroy;
-
bi->bi_cf_ocs = relayocs;
return config_register_schema( relaycfg, relayocs );
if ( bd == NULL && !BER_BVISNULL( &op->o_req_ndn ) ) {
bd = select_backend( &op->o_req_ndn, 1 );
- if ( bd->be_private == op->o_bd->be_private ) {
+ }
+
+ if ( bd != NULL ) {
+ if ( bd->be_private != op->o_bd->be_private ) {
+ return bd;
+ }
+
Debug( LDAP_DEBUG_ANY,
"%s: back-relay for DN=\"%s\" would call self.\n",
op->o_log_prefix, op->o_req_dn.bv_val, 0 );
- if ( fail_mode & RB_ERR ) {
- rs->sr_err = rc;
- if ( fail_mode & RB_SEND ) {
- send_ldap_result( op, rs );
- }
- }
-
- return NULL;
- }
- }
- if ( bd == NULL ) {
- if ( ( fail_mode & RB_REFERRAL )
- && ( fail_mode & RB_SEND )
+ } else if ( ( fail_mode & RB_REFERRAL_SEND ) == RB_REFERRAL_SEND
&& !BER_BVISNULL( &op->o_req_ndn )
&& default_referral )
- {
+ {
rs->sr_err = LDAP_REFERRAL;
/* if we set sr_err to LDAP_REFERRAL,
}
return NULL;
- }
+ }
- /* NOTE: err is LDAP_INVALID_CREDENTIALS for bind,
- * LDAP_NO_SUCH_OBJECT for other operations.
- * noSuchObject cannot be returned by bind */
+ if ( fail_mode & RB_ERR ) {
rs->sr_err = rc;
if ( fail_mode & RB_SEND ) {
send_ldap_result( op, rs );
}
}
- return bd;
+ return NULL;
}
static int
RB_UNSUPPORTED_SEND );
}
+#if 0 /* Should not exist - see ITS#6133 */
int
relay_back_op_abandon( Operation *op, SlapReply *rs )
{
return rc;
}
+#endif /*0*/
int
relay_back_op_extended( Operation *op, SlapReply *rs )
}
+#if 0
/*
* NOTE: even the existence of this function is questionable: we cannot
* pass the bi_chk_referrals() call thru the rwm overlay because there
{
BackendDB *bd;
+ /* FIXME: Can send success on failure. Should send referral or nothing. */
bd = relay_back_select_backend( op, rs,
( LDAP_SUCCESS | RB_ERR_REFERRAL_SEND ) );
/* FIXME: this test only works if there are no overlays, so
return relay_back_op( op, rs, bd, bd->be_chk_referrals, LDAP_SUCCESS );
}
+#endif /*0*/
int
relay_back_operational( Operation *op, SlapReply *rs )
{
BackendDB *bd;
- bd = relay_back_select_backend( op, rs,
- ( LDAP_SUCCESS | RB_ERR ) );
+ bd = relay_back_select_backend( op, rs, LDAP_SUCCESS );
/* FIXME: this test only works if there are no overlays, so
* it is nearly useless; if made stricter, no nested back-relays
* can be instantiated... too bad. */
if ( bd == NULL || bd == op->o_bd ) {
- return 0;
+ return LDAP_SUCCESS;
}
- return relay_back_op( op, rs, bd, bd->be_operational, 0 );
+ return relay_back_op( op, rs, bd, bd->be_operational, LDAP_SUCCESS );
}
int
return rc;
}
+#if 0 /* Should not exist - see ITS#6133 */
int
relay_back_connection_init( BackendDB *bd, Connection *c )
{
return 0;
}
+#endif /*0*/
/*
* FIXME: must implement tools as well