X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fbackover.c;h=1be6cfa3e9000e8034454bd54e9ac0a83a65832b;hb=23783a9164b525b4c134ec6ede8c6159d9b7eb50;hp=2f23fb0d19dbe0de3181fb024a720ed55f68c1a9;hpb=e6446d31139e871ac95a288c7654a8d8526a54de;p=openldap diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index 2f23fb0d19..1be6cfa3e9 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2003-2008 The OpenLDAP Foundation. + * Copyright 2003-2009 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -103,6 +103,8 @@ over_db_config( ca.be = be; snprintf( ca.log, sizeof( ca.log ), "%s: line %d", ca.fname, ca.lineno ); + ca.op = SLAP_CONFIG_ADD; + ca.valx = -1; for (; on; on=on->on_next) { rc = SLAP_CONF_UNKNOWN; @@ -193,7 +195,7 @@ over_db_destroy( slap_overinfo *oi = be->bd_info->bi_private; slap_overinst *on = oi->oi_list, *next; BackendInfo *bi_orig = be->bd_info; - int rc; + int rc = 0; be->bd_info = oi->oi_orig; if ( be->bd_info->bi_db_destroy ) { @@ -1063,7 +1065,7 @@ overlay_register_control( BackendDB *be, const char *oid ) /* add to all backends... */ LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) { - if ( be == bd ) { + if ( bd == be->bd_self ) { gotit = 1; } @@ -1074,8 +1076,8 @@ overlay_register_control( BackendDB *be, const char *oid ) } if ( !gotit ) { - be->be_ctrls[ cid ] = 1; - be->be_ctrls[ SLAP_MAX_CIDS ] = 1; + be->bd_self->be_ctrls[ cid ] = 1; + be->bd_self->be_ctrls[ SLAP_MAX_CIDS ] = 1; } return 0; @@ -1107,14 +1109,15 @@ void overlay_remove( BackendDB *be, slap_overinst *on ) { slap_overinfo *oi = on->on_info; - slap_overinst **oidx, *on2; + slap_overinst **oidx; + BackendInfo *bi_orig; /* remove overlay from oi_list an call db_close and db_destroy * handlers */ for ( oidx = &oi->oi_list; *oidx; oidx = &(*oidx)->on_next ) { if ( *oidx == on ) { *oidx = on->on_next; - BackendInfo *bi_orig = be->bd_info; + bi_orig = be->bd_info; be->bd_info = (BackendInfo *)on; if ( on->on_bi.bi_db_close ) { on->on_bi.bi_db_close( be, NULL );