From aec54643c26010c22435d9106fac3965476d0f7c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 11 Sep 2007 14:10:50 +0000 Subject: [PATCH] Don't populate member list unless it was requested --- servers/slapd/overlays/dynlist.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index 50119eb7a1..7082fb253a 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -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;