]> git.sur5r.net Git - openldap/commitdiff
fix cached connection taint in case of timeout
authorPierangelo Masarati <ando@openldap.org>
Fri, 26 Jan 2007 00:40:05 +0000 (00:40 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 26 Jan 2007 00:40:05 +0000 (00:40 +0000)
servers/slapd/back-ldap/bind.c

index 9f146158da086ab9388b4bc63ca0afb355c16a09..e5003530762617b668d57adaf46bd80193da9e79 100644 (file)
@@ -1619,8 +1619,23 @@ retry:;
                                if ( sendok & LDAP_BACK_BINDING ) {
                                        ldap_unbind_ext( lc->lc_ld, NULL, NULL );
                                        lc->lc_ld = NULL;
+
+                                       /* let it be used, but taint/delete it so that 
+                                        * no-one else can look it up any further */
+                                       ldap_pvt_thread_mutex_lock( &li->li_conninfo.lai_mutex );
+
+#if LDAP_BACK_PRINT_CONNTREE > 0
+                                       ldap_back_print_conntree( li, ">>> ldap_back_getconn(timeout)" );
+#endif /* LDAP_BACK_PRINT_CONNTREE */
+
+                                       (void)ldap_back_conn_delete( li, lc );
                                        LDAP_BACK_CONN_TAINTED_SET( lc );
 
+#if LDAP_BACK_PRINT_CONNTREE > 0
+                                       ldap_back_print_conntree( li, "<<< ldap_back_getconn(timeout)" );
+#endif /* LDAP_BACK_PRINT_CONNTREE */
+                                       ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
+
                                } else {
                                        (void)ldap_back_cancel( lc, op, rs, msgid, sendok );
                                }