]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/bind.c
refine fix to ITS#4315; apply it to back-meta as well
[openldap] / servers / slapd / back-meta / bind.c
index f2c2035fb037772c80f989f05489c2baf54f1c11..cc2b5bcb99788edcecebe6b410356a462388c06e 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2005 The OpenLDAP Foundation.
+ * Copyright 1999-2006 The OpenLDAP Foundation.
  * Portions Copyright 2001-2003 Pierangelo Masarati.
  * Portions Copyright 1999-2003 Howard Chu.
  * All rights reserved.
@@ -91,7 +91,7 @@ meta_back_bind( Operation *op, SlapReply *rs )
        /* we need meta_back_getconn() not send result even on error,
         * because we want to intercept the error and make it
         * invalidCredentials */
-       mc = meta_back_getconn( op, rs, NULL, LDAP_BACK_DONTSEND );
+       mc = meta_back_getconn( op, rs, NULL, LDAP_BACK_BIND_SERR );
        if ( !mc ) {
                char    buf[ SLAP_TEXT_BUFLEN ];
 
@@ -342,7 +342,6 @@ rebind:;
                 * handle response!!!
                 */
 retry:;
-               tv = mt->mt_bind_timeout;
                switch ( ldap_result( msc->msc_ld, msgid, LDAP_MSG_ALL, &tv, &res ) ) {
                case 0:
                        snprintf( buf, sizeof( buf ),
@@ -357,7 +356,7 @@ retry:;
                                if ( nretries > 0 ) {
                                        nretries--;
                                }
-                               LDAP_BACK_TV_SET( &tv );
+                               tv = mt->mt_bind_timeout;
                                goto retry;
                        }
                        rs->sr_err = LDAP_BUSY;
@@ -498,7 +497,6 @@ rebind:;
                 * handle response!!!
                 */
 retry:;
-               tv = mt->mt_bind_timeout;
                switch ( ldap_result( msc->msc_ld, msgid, LDAP_MSG_ALL, &tv, &res ) ) {
                case 0:
                        snprintf( buf, sizeof( buf ),
@@ -513,7 +511,7 @@ retry:;
                                if ( nretries > 0 ) {
                                        nretries--;
                                }
-                               LDAP_BACK_TV_SET( &tv );
+                               tv = mt->mt_bind_timeout;
                                goto retry;
                        }