]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/init.c
use result of validation (ITS#4028)
[openldap] / servers / slapd / back-meta / init.c
index 6628be9fd937cc846d8f40e835ed3ce3b684eaeb..fb2b0d50ceb888241511c95a434b30397b052c47 100644 (file)
@@ -30,7 +30,9 @@ int
 meta_back_open(
        BackendInfo     *bi )
 {
+       /* FIXME: need to remove the pagedResults, and likely more... */
        bi->bi_controls = slap_known_controls;
+
        return 0;
 }
 
@@ -108,10 +110,13 @@ meta_back_db_open(
        int             i, rc;
 
        for ( i = 0; i < mi->mi_ntargets; i++ ) {
-               if ( mi->mi_targets[ i ].mt_flags & LDAP_BACK_F_SUPPORT_T_F_DISCOVER ) {
+               if ( mi->mi_targets[ i ].mt_flags & LDAP_BACK_F_SUPPORT_T_F_DISCOVER )
+               {
                        mi->mi_targets[ i ].mt_flags &= ~LDAP_BACK_F_SUPPORT_T_F_DISCOVER;
-                       rc = ldap_back_discover_t_f_support( mi->mi_targets[ i ].mt_uri,
-                                       mi->mi_targets[ i ].mt_version );
+                       rc = slap_discover_feature( mi->mi_targets[ i ].mt_uri,
+                                       mi->mi_targets[ i ].mt_version,
+                                       slap_schema.si_ad_supportedFeatures->ad_cname.bv_val,
+                                       LDAP_FEATURE_ABSOLUTE_FILTERS );
                        if ( rc == LDAP_COMPARE_TRUE ) {
                                mi->mi_targets[ i ].mt_flags |= LDAP_BACK_F_SUPPORT_T_F;
                        }
@@ -126,17 +131,24 @@ conn_free(
        void            *v_mc )
 {
        metaconn_t              *mc = v_mc;
-       metasingleconn_t        *msc;
+       int                     i, ntargets;
 
        assert( mc->mc_conns != NULL );
 
-       for ( msc = &mc->mc_conns[ 0 ]; !META_LAST( msc ); msc++ ) {
+       /* at least one must be present... */
+       ntargets = mc->mc_conns[ 0 ].msc_info->mi_ntargets;
+
+       for ( i = 0; i < ntargets; i++ ) {
+               metasingleconn_t        *msc = &mc->mc_conns[ i ];
+
                if ( msc->msc_ld != NULL ) {
                        ldap_unbind_ext_s( msc->msc_ld, NULL, NULL );
                }
+
                if ( !BER_BVISNULL( &msc->msc_bound_ndn ) ) {
                        ber_memfree( msc->msc_bound_ndn.bv_val );
                }
+
                if ( !BER_BVISNULL( &msc->msc_cred ) ) {
                        /* destroy sensitive data */
                        memset( msc->msc_cred.bv_val, 0, msc->msc_cred.bv_len );