]> git.sur5r.net Git - openldap/commitdiff
do not let entryDN,subschemaSubentry slip into results when mapped out (ITS#5760)
authorPierangelo Masarati <ando@openldap.org>
Sat, 14 Feb 2009 14:13:46 +0000 (14:13 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 14 Feb 2009 14:13:46 +0000 (14:13 +0000)
servers/slapd/back-meta/back-meta.h
servers/slapd/back-meta/init.c
servers/slapd/back-meta/search.c

index 2eb1e05e51531f24e9c93711276c8a3ad8455e6b..3c0395200e3e62778174fb4f0f5945cf6f27a2ed 100644 (file)
@@ -318,6 +318,8 @@ typedef struct metatarget_t {
 #define        META_BACK_TGT_NOREFS(mt)                META_BACK_TGT_ISSET( (mt), LDAP_BACK_F_NOREFS )
 #define        META_BACK_TGT_NOUNDEFFILTER(mt)         META_BACK_TGT_ISSET( (mt), LDAP_BACK_F_NOUNDEFFILTER )
 
+       slap_mask_t             mt_rep_flags;
+
        int                     mt_version;
        time_t                  mt_network_timeout;
        struct timeval          mt_bind_timeout;
index ab9df5687be2730d564b0ce2830640fc8c7241b9..f5cb37935c25e4bfd6a14b719755dcb528ccc800 100644 (file)
@@ -170,6 +170,8 @@ meta_back_db_open(
                slap_bindconf   sb = { BER_BVNULL };
                metatarget_t    *mt = mi->mi_targets[ i ];
 
+               struct berval mapped;
+
                ber_str2bv( mt->mt_uri, 0, 0, &sb.sb_uri );
                sb.sb_version = mt->mt_version;
                sb.sb_method = LDAP_AUTH_SIMPLE;
@@ -224,6 +226,22 @@ meta_back_db_open(
                                not_always_anon_non_prescriptive = 1;
                        }
                }
+
+               BER_BVZERO( &mapped );
+               ldap_back_map( &mt->mt_rwmap.rwm_at, 
+                       &slap_schema.si_ad_entryDN->ad_cname, &mapped,
+                       BACKLDAP_REMAP );
+               if ( BER_BVISNULL( &mapped ) || mapped.bv_val[0] == '\0' ) {
+                       mt->mt_rep_flags |= REP_NO_ENTRYDN;
+               }
+
+               BER_BVZERO( &mapped );
+               ldap_back_map( &mt->mt_rwmap.rwm_at, 
+                       &slap_schema.si_ad_subschemaSubentry->ad_cname, &mapped,
+                       BACKLDAP_REMAP );
+               if ( BER_BVISNULL( &mapped ) || mapped.bv_val[0] == '\0' ) {
+                       mt->mt_rep_flags |= REP_NO_SUBSCHEMA;
+               }
        }
 
        if ( not_always == 0 ) {
index ff723aecc0ddac4ef4ed78ad07483056f8b90d7d..27bac0e438b02466fbaa007577ffbebac740a4bd 100644 (file)
@@ -2147,7 +2147,7 @@ next_attr:;
        rs->sr_entry = &ent;
        rs->sr_attrs = op->ors_attrs;
        rs->sr_operational_attrs = NULL;
-       rs->sr_flags = 0;
+       rs->sr_flags = mi->mi_targets[ target ]->mt_rep_flags;
        rs->sr_err = LDAP_SUCCESS;
        rc = send_search_entry( op, rs );
        switch ( rc ) {