From 3b7084c170b84173f92f92d3a569f1ad253499a1 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 15 May 2006 01:42:05 +0000 Subject: [PATCH] reset the conn field in the cached connection if the bound DN is privileged (ITS#4547) --- servers/slapd/back-ldap/bind.c | 3 +++ servers/slapd/back-meta/bind.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 0a482f6d7f..d43d13df33 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -197,6 +197,9 @@ retry_lock:; if ( LDAP_BACK_CONN_ISBOUND( lc ) ) { ber_bvreplace( &lc->lc_local_ndn, &op->o_req_ndn ); + if ( be_isroot_dn( op->o_bd, &op->o_req_ndn ) ) { + lc->lc_conn = LDAP_BACK_PCONN_SET( op ); + } lerr = avl_insert( &li->li_conninfo.lai_tree, (caddr_t)lc, ldap_back_conndn_cmp, ldap_back_conndn_dup ); } diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index fcbe0fd21e..9b654c7584 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -231,6 +231,9 @@ retry_lock:; } ber_bvreplace( &mc->mc_local_ndn, &op->o_req_ndn ); + if ( be_isroot_dn( op->o_bd, &op->o_req_ndn ) ) { + mc->mc_conn = LDAP_BACK_PCONN_SET( op ); + } lerr = avl_insert( &mi->mi_conninfo.lai_tree, (caddr_t)mc, meta_back_conndn_cmp, meta_back_conndn_dup ); ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); -- 2.39.5