]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldap/chain.c
make referrals chasing optional (default is to chase them)
[openldap] / servers / slapd / back-ldap / chain.c
index d481abb7a486707060f8b820c0896d517adeec95..7dcb95f29fc1d36a5c1c76e6fc8b8910d4f01bf1 100644 (file)
@@ -614,6 +614,23 @@ ldap_chain_db_destroy(
        return rc;
 }
 
+static int
+ldap_chain_connection_destroy(
+       BackendDB *be,
+       Connection *conn
+)
+{
+       slap_overinst *on = (slap_overinst *) be->bd_info;
+       void *private = be->be_private;
+       int rc;
+
+       be->be_private = on->on_bi.bi_private;
+       rc = lback->bi_connection_destroy( be, conn );
+       on->on_bi.bi_private = be->be_private;
+       be->be_private = private;
+       return rc;
+}
+
 #ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
 static int
 ldap_chain_parse_ctrl(
@@ -766,18 +783,20 @@ chain_init( void )
 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
        ldapchain.on_bi.bi_db_config = ldap_chain_db_config;
        ldapchain.on_bi.bi_db_destroy = ldap_chain_db_destroy;
-       
+
        /* ... otherwise the underlying backend's function would be called,
         * likely passing an invalid entry; on the contrary, the requested
         * operational attributes should have been returned while chasing
         * the referrals.  This all in all is a bit messy, because part
-        * of the operational attributes are generated by they backend;
+        * of the operational attributes are generated by the backend;
         * part by the frontend; back-ldap should receive all the available
-        * ones from the remote server, but then, on it own, it strips those
+        * ones from the remote server, but then, on its own, it strips those
         * it assumes will be (re)generated by the frontend (e.g.
         * subschemaSubentry.) */
        ldapchain.on_bi.bi_operational = ldap_chain_operational;
        
+       ldapchain.on_bi.bi_connection_destroy = ldap_chain_connection_destroy;
+
        ldapchain.on_response = ldap_chain_response;
 
        return overlay_register( &ldapchain );