]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldap/bind.c
Partially revert prev commit, leave rs->sr_err == SLAPD_ABANDON
[openldap] / servers / slapd / back-ldap / bind.c
index c7771b006252c2a0545be0feeeb10d902074fae6..9691f11f6df9a1c60e2c1f802f4e47c693e4ff03 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2008 The OpenLDAP Foundation.
+ * Copyright 1999-2009 The OpenLDAP Foundation.
  * Portions Copyright 2000-2003 Pierangelo Masarati.
  * Portions Copyright 1999-2003 Howard Chu.
  * All rights reserved.
@@ -2206,7 +2206,9 @@ ldap_back_proxy_authz_bind(
                 * so that referral chasing is attempted using the right
                 * identity */
                LDAP_BACK_CONN_ISBOUND_SET( lc );
-               ber_bvreplace( &lc->lc_bound_ndn, binddn );
+               if ( !BER_BVISNULL( binddn ) ) {
+                       ber_bvreplace( &lc->lc_bound_ndn, binddn );
+               }
 
                if ( !BER_BVISNULL( &lc->lc_cred ) ) {
                        memset( lc->lc_cred.bv_val, 0,
@@ -2214,8 +2216,10 @@ ldap_back_proxy_authz_bind(
                }
 
                if ( LDAP_BACK_SAVECRED( li ) ) {
-                       ber_bvreplace( &lc->lc_cred, bindcred );
-                       ldap_set_rebind_proc( lc->lc_ld, li->li_rebind_f, lc );
+                       if ( !BER_BVISNULL( bindcred ) ) {
+                               ber_bvreplace( &lc->lc_cred, bindcred );
+                               ldap_set_rebind_proc( lc->lc_ld, li->li_rebind_f, lc );
+                       }
 
                } else {
                        lc->lc_cred.bv_len = 0;