]> git.sur5r.net Git - openldap/commitdiff
set rebind proc if needed and bind succeeds (ITS#6665)
authorPierangelo Masarati <ando@openldap.org>
Fri, 8 Oct 2010 22:42:55 +0000 (22:42 +0000)
committerPierangelo Masarati <ando@openldap.org>
Fri, 8 Oct 2010 22:42:55 +0000 (22:42 +0000)
servers/slapd/back-meta/search.c

index 03b623caad772701c259c36f5fc7c78839fce228..a89cbb521afe01e03264fb6c1252a2f32a6daa94 100644 (file)
@@ -378,6 +378,7 @@ meta_search_dobind_result(
        LDAPMessage             *res )
 {
        metainfo_t              *mi = ( metainfo_t * )op->o_bd->be_private;
+       metatarget_t            *mt = mi->mi_targets[ candidate ];
        metaconn_t              *mc = *mcp;
        metasingleconn_t        *msc = &mc->mc_conns[ candidate ];
 
@@ -416,6 +417,12 @@ meta_search_dobind_result(
                        LDAP_BACK_CONN_ISANON_SET( msc );
 
                } else {
+                       if ( META_BACK_TGT_SAVECRED( mt ) &&
+                               !BER_BVISNULL( &msc->msc_cred ) &&
+                               !BER_BVISEMPTY( &msc->msc_cred ) )
+                       {
+                               ldap_set_rebind_proc( msc->msc_ld, mt->mt_rebind_f, msc );
+                       }
                        LDAP_BACK_CONN_ISBOUND_SET( msc );
                }
                retcode = META_SEARCH_CANDIDATE;