/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2003-2012 The OpenLDAP Foundation.
+ * Copyright 2003-2014 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
}
for (; on && rc == 0; on=on->on_next) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
db.bd_info = &on->on_bi;
if ( db.bd_info->bi_db_open ) {
rc = db.bd_info->bi_db_open( &db, cr );
int rc = 0;
for (; on && rc == 0; on=on->on_next) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
be->bd_info = &on->on_bi;
if ( be->bd_info->bi_db_close ) {
rc = be->bd_info->bi_db_close( be, cr );
}
for (; on && rc == 0; on=on->on_next) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
be->bd_info = &on->on_bi;
if ( be->bd_info->bi_db_destroy ) {
rc = be->bd_info->bi_db_destroy( be, cr );
db.be_flags |= SLAP_DBFLAG_OVERLAY;
op->o_bd = &db;
for (; on; on=on->on_next ) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
if ( on->on_response ) {
db.bd_info = (BackendInfo *)on;
rc = on->on_response( op, rs );
on = oi->oi_list;
for ( ; on; on = on->on_next ) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
if ( on->on_bi.bi_access_allowed ) {
/* NOTE: do not copy the structure until required */
if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
int rc = SLAP_CB_CONTINUE;
for ( ; on; on = on->on_next ) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
if ( on->on_bi.bi_entry_get_rw ) {
/* NOTE: do not copy the structure until required */
if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
int rc = SLAP_CB_CONTINUE;
for ( ; on; on = on->on_next ) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
if ( on->on_bi.bi_entry_release_rw ) {
/* NOTE: do not copy the structure until required */
if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
on = oi->oi_list;
for ( ; on; on = on->on_next ) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
if ( on->on_bi.bi_acl_group ) {
/* NOTE: do not copy the structure until required */
if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
on = oi->oi_list;
for ( ; on; on = on->on_next ) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
if ( on->on_bi.bi_acl_attribute ) {
/* NOTE: do not copy the structure until required */
if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
slap_overinst *on
)
{
- BI_op_bind **func;
+ BackendInfo *bi;
int rc = SLAP_CB_CONTINUE;
for (; on; on=on->on_next ) {
- func = &on->on_bi.bi_op_bind;
- if ( func[which] ) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
+ bi = &on->on_bi;
+ if ( (&bi->bi_op_bind)[ which ] ) {
op->o_bd->bd_info = (BackendInfo *)on;
- rc = func[which]( op, rs );
+ rc = (&bi->bi_op_bind)[ which ]( op, rs );
if ( rc != SLAP_CB_CONTINUE ) break;
}
}
if ( rc == SLAP_CB_BYPASS )
rc = SLAP_CB_CONTINUE;
- func = &oi->oi_orig->bi_op_bind;
- if ( func[which] && rc == SLAP_CB_CONTINUE ) {
- op->o_bd->bd_info = oi->oi_orig;
- rc = func[which]( op, rs );
+ bi = oi->oi_orig;
+ if ( (&bi->bi_op_bind)[ which ] && rc == SLAP_CB_CONTINUE ) {
+ op->o_bd->bd_info = bi;
+ rc = (&bi->bi_op_bind)[ which ]( op, rs );
}
/* should not fall thru this far without anything happening... */
if ( rc == SLAP_CB_CONTINUE ) {
}
for ( ; on; on = on->on_next ) {
+ if ( on->on_bi.bi_flags & SLAPO_BFLAG_DISABLED )
+ continue;
func = &on->on_bi.bi_connection_init;
if ( func[ which ] ) {
bd->bd_info = (BackendInfo *)on;
rm_cb->sc_private = (void*) rm_ctx;
/* Append callback to the end of the list */
- for ( cb = op->o_callback; cb->sc_next; cb = cb->sc_next );
- cb->sc_next = rm_cb;
+ if ( !op->o_callback ) {
+ op->o_callback = rm_cb;
+ } else {
+ for ( cb = op->o_callback; cb->sc_next; cb = cb->sc_next );
+ cb->sc_next = rm_cb;
+ }
}
#endif /* SLAP_CONFIG_DELETE */
return 0;
}
-