]> git.sur5r.net Git - openldap/commitdiff
ITS#5157 from HEAD
authorHoward Chu <hyc@openldap.org>
Sat, 29 Sep 2007 10:23:39 +0000 (10:23 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 29 Sep 2007 10:23:39 +0000 (10:23 +0000)
servers/slapd/overlays/dynlist.c

index 87b1f15ac701a07cfc1042cb2ca168992c7de812..1446df1fbe9ff363cefc445ec18357249be25cf4 100644 (file)
@@ -334,6 +334,19 @@ dynlist_prepare_entry( Operation *op, SlapReply *rs, dynlist_info_t *dli )
                return SLAP_CB_CONTINUE;
        }
 
+#ifndef SLAP_OPATTRS
+       opattrs = ( rs->sr_attrs == NULL ) ? 0 : an_find( rs->sr_attrs, &AllOper );
+       userattrs = ( rs->sr_attrs == NULL ) ? 1 : an_find( rs->sr_attrs, &AllUser );
+#else /* SLAP_OPATTRS */
+       opattrs = SLAP_OPATTRS( rs->sr_attr_flags );
+       userattrs = SLAP_USERATTRS( rs->sr_attr_flags );
+#endif /* SLAP_OPATTRS */
+
+       /* Don't generate member list if it wasn't requested */
+       if ( dli->dli_member_ad && !userattrs && !ad_inlist( dli->dli_member_ad, rs->sr_attrs ) ) {
+               return SLAP_CB_CONTINUE;
+       }
+
        if ( !( rs->sr_flags & REP_ENTRY_MODIFIABLE ) ) {
                e = entry_dup( rs->sr_entry );
        } else {
@@ -360,14 +373,6 @@ dynlist_prepare_entry( Operation *op, SlapReply *rs, dynlist_info_t *dli )
        o.ors_tlimit = SLAP_NO_LIMIT;
        o.ors_slimit = SLAP_NO_LIMIT;
 
-#ifndef SLAP_OPATTRS
-       opattrs = ( rs->sr_attrs == NULL ) ? 0 : an_find( rs->sr_attrs, &AllOper );
-       userattrs = ( rs->sr_attrs == NULL ) ? 1 : an_find( rs->sr_attrs, &AllUser );
-#else /* SLAP_OPATTRS */
-       opattrs = SLAP_OPATTRS( rs->sr_attr_flags );
-       userattrs = SLAP_USERATTRS( rs->sr_attr_flags );
-#endif /* SLAP_OPATTRS */
-
        for ( url = a->a_nvals; !BER_BVISNULL( url ); url++ ) {
                LDAPURLDesc     *lud = NULL;
                int             i, j;