]> git.sur5r.net Git - openldap/commitdiff
make sure rwm_op_cleanup() is called also in case of bind (in partial fulfillment...
authorPierangelo Masarati <ando@openldap.org>
Sat, 12 Jul 2008 11:53:49 +0000 (11:53 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 12 Jul 2008 11:53:49 +0000 (11:53 +0000)
servers/slapd/backover.c
servers/slapd/overlays/rwm.c
servers/slapd/proto-slap.h

index 6855246ececbfb469804187978d43b2d6096d035..2f23fb0d19dbe0de3181fb024a720ed55f68c1a9 100644 (file)
@@ -597,6 +597,27 @@ over_acl_attribute(
        return rc;
 }
 
+int
+overlay_callback_after_backover( Operation *op, slap_callback *sc, int append )
+{
+       slap_callback **scp;
+
+       for ( scp = &op->o_callback; *scp != NULL; scp = &(*scp)->sc_next ) {
+               if ( (*scp)->sc_response == over_back_response ) {
+                       sc->sc_next = (*scp)->sc_next;
+                       (*scp)->sc_next = sc;
+                       return 0;
+               }
+       }
+
+       if ( append ) {
+               *scp = sc;
+               return 0;
+       }
+
+       return 1;
+}
+
 /*
  * default return code in case of missing backend function
  * and overlay stack returning SLAP_CB_CONTINUE
index 5275aa57a53961a4e14d151a88ba489a5f153e51..49ad6fd63690db64600fd290f3469201cf85adba 100644 (file)
@@ -104,6 +104,15 @@ rwm_op_cleanup( Operation *op, SlapReply *rs )
                                op->ore_reqdata = ros->ore_reqdata;
                        }
                        break;
+               case LDAP_REQ_BIND:
+                       if ( rs->sr_err == LDAP_SUCCESS ) {
+#if 0
+                               /* too late, conn_mutex released */
+                               ber_bvreplace( &op->o_conn->c_ndn,
+                                       &op->o_req_ndn );
+#endif
+                       }
+                       break;
                default:        break;
                }
                op->o_callback = op->o_callback->sc_next;
@@ -354,7 +363,7 @@ rwm_op_bind( Operation *op, SlapReply *rs )
                return -1;
        }
 
-       op->o_callback = &roc->cb;
+       overlay_callback_after_backover( op, &roc->cb, 1 );
 
        return SLAP_CB_CONTINUE;
 }
index db339ac0c03b1444b366ef800d06380f94732cf4..ea2292199939f7973cc08053c8e5a21b35e00650 100644 (file)
@@ -473,6 +473,9 @@ LDAP_SLAPD_F (void) overlay_move LDAP_P((
 LDAP_SLAPD_F (void) overlay_remove LDAP_P((
        BackendDB *be, slap_overinst *on ));
 #endif /* SLAP_CONFIG_DELETE */
+LDAP_SLAPD_F (int) overlay_callback_after_backover LDAP_P((
+       Operation *op, slap_callback *sc, int append ));
+
 /*
  * bconfig.c
  */