X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fbackover.c;h=e1b31a50c1d6f6817afd4502e376361d11c2d112;hb=5c3a4e176e9539f58a1ac666ad370b4c204cd44c;hp=f7e572071ce4f7e143b8cdf2d4f03fbcd39b9810;hpb=7cd731ec56177c9db3d9b538d44efb8432544b33;p=openldap diff --git a/servers/slapd/backover.c b/servers/slapd/backover.c index f7e572071c..e1b31a50c1 100644 --- a/servers/slapd/backover.c +++ b/servers/slapd/backover.c @@ -296,6 +296,20 @@ over_op_func( if ( rc == SLAP_CB_CONTINUE ) { rc = op_rc[ which ]; } + + /* The underlying backend didn't handle the request, make sure + * overlay cleanup is processed. + */ + if ( rc == LDAP_UNWILLING_TO_PERFORM ) { + slap_callback *sc_next; + for ( ; op->o_callback && op->o_callback != cb.sc_next; + op->o_callback = sc_next ) { + sc_next = op->o_callback->sc_next; + if ( op->o_callback->sc_cleanup ) { + op->o_callback->sc_cleanup( op, rs ); + } + } + } op->o_bd = be; op->o_callback = cb.sc_next; return rc; @@ -645,9 +659,11 @@ overlay_config( BackendDB *be, const char *ov ) /* Any initialization needed? */ if ( on->on_bi.bi_db_init ) { + int rc; be->bd_info = (BackendInfo *)on2; - on2->on_bi.bi_db_init( be ); + rc = on2->on_bi.bi_db_init( be ); be->bd_info = (BackendInfo *)oi; + if ( rc ) return rc; } return 0;