char buf[ BACKMONITOR_BUFSIZE ];
int j;
slap_overinfo *oi = NULL;
+ BackendInfo *bi;
be = &backendDB[i];
+ bi = be->bd_info;
+
if ( strcmp( be->bd_info->bi_type, "over" ) == 0 ) {
oi = (slap_overinfo *)be->bd_info;
-
- be = &oi->oi_bd;
+ bi = oi->oi_orig;
}
/* Subordinates are not exposed as their own naming context */
mi->mi_oc_monitoredObject->soc_cname.bv_val,
i,
mi->mi_ad_monitoredInfo->ad_cname.bv_val,
- be->bd_info->bi_type,
+ bi->bi_type,
mi->mi_startTime.bv_val,
mi->mi_startTime.bv_val );
}
#if defined(SLAPD_LDAP)
- if ( strcmp( be->bd_info->bi_type, "ldap" ) == 0 ) {
+ if ( strcmp( bi->bi_type, "ldap" ) == 0 ) {
struct ldapinfo *li = (struct ldapinfo *)be->be_private;
struct berval bv;
#endif /* defined(SLAPD_LDAP) */
for ( j = nBackendInfo; j--; ) {
- if ( backendInfo[ j ].bi_type == be->bd_info->bi_type ) {
+ if ( backendInfo[ j ].bi_type == bi->bi_type ) {
struct berval bv;
snprintf( buf, sizeof( buf ),
{
slap_overinfo *oi = (slap_overinfo *) be->bd_info;
slap_overinst *on = oi->oi_list;
- BackendDB bd;
BI_db_open **func;
int rc = 0;
- func = &oi->oi_bd.bd_info->bi_db_open;
+ func = &oi->oi_orig->bi_db_open;
if ( func[which] ) {
- rc = func[which]( &oi->oi_bd );
- if ( rc ) return rc;
+ be->bd_info = oi->oi_orig;
+ rc = func[which]( be );
}
- bd = *be;
- for (; on; on=on->on_next) {
- bd.bd_info = &on->on_bi;
+ for (; on && rc == 0; on=on->on_next) {
+ be->bd_info = &on->on_bi;
func = &on->on_bi.bi_db_open;
if (func[which]) {
- rc = func[which]( &bd );
- if ( rc ) break;
+ rc = func[which]( be );
}
}
+ be->bd_info = (BackendInfo *)oi;
return rc;
}
{
slap_overinfo *oi = (slap_overinfo *) be->bd_info;
slap_overinst *on = oi->oi_list;
- BackendDB bd;
int rc = 0;
- if ( oi->oi_bd.bd_info->bi_db_config ) {
- rc = oi->oi_bd.bd_info->bi_db_config( &oi->oi_bd, fname, lineno,
+ if ( oi->oi_orig->bi_db_config ) {
+ be->bd_info = oi->oi_orig;
+ rc = oi->oi_orig->bi_db_config( be, fname, lineno,
argc, argv );
+ be->bd_info = (BackendInfo *)oi;
if ( rc != SLAP_CONF_UNKNOWN ) return rc;
}
- bd = *be;
for (; on; on=on->on_next) {
- bd.bd_info = &on->on_bi;
if (on->on_bi.bi_db_config) {
- rc = on->on_bi.bi_db_config( &bd, fname, lineno,
+ be->bd_info = &on->on_bi;
+ rc = on->on_bi.bi_db_config( be, fname, lineno,
argc, argv );
if ( rc != SLAP_CONF_UNKNOWN ) break;
}
}
+ be->bd_info = (BackendInfo *)oi;
return rc;
}
}
op->o_bd = be;
- func = &oi->oi_bd.bd_info->bi_op_bind;
+ func = &oi->oi_orig->bi_op_bind;
if ( func[which] && rc == SLAP_CB_CONTINUE ) {
rc = func[which]( op, rs );
}
*/
if ( be->bd_info->bi_type != overtype ) {
oi = ch_malloc( sizeof(slap_overinfo) );
- oi->oi_bd = *be;
+ oi->oi_orig = be->bd_info;
oi->oi_bi = *be->bd_info;
oi->oi_list = NULL;
bi = (BackendInfo *)oi;