rc = ( bd->be_bind )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
rc = ( bd->be_unbind )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
}
return 0;
rc = ( bd->be_search )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
rc = ( bd->be_compare )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
rc = ( bd->be_modify )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
rc = ( bd->be_modrdn )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
rc = ( bd->be_add )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
rc = ( bd->be_delete )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
}
return rc;
rc = ( bd->be_abandon )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
rc = ( bd->be_cancel )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
rc = ( bd->be_extended )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
} else {
send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
rc = ( bd->be_chk_referrals )( op, rs );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
}
return rc;
rc = ( bd->be_operational )( op, rs, opattrs, ap );
op->o_bd = be;
- op->o_callback = op->o_callback->sc_next;
+ if ( op->o_callback == &cb ) {
+ op->o_callback = op->o_callback->sc_next;
+ }
}
return rc;