ITS#9929 dynlist: avoid unnecessary search for dynamic lists

This commit is contained in:
Howard Chu 2022-10-09 11:51:54 +01:00
parent 0b14cb97a6
commit a64320d8ab

View file

@ -1708,13 +1708,24 @@ dynlist_search( Operation *op, SlapReply *rs )
/* Find all groups in scope. For group expansion
* we only need the groups within the search scope, but
* for memberOf populating, we need all dyngroups.
*
* We ignore dynamic lists here; they're handled later.
*/
for ( dli = dlg->dlg_dli; dli; dli = dli->dli_next ) {
int got_dn = 1;
static_oc = NULL;
nested = 0;
tmpwant = 0;
if ( dlg->dlg_memberOf ) {
if ( !dli->dli_dlm )
continue;
for ( dlm = dli->dli_dlm; dlm; dlm = dlm->dlm_next ) {
if ( dlm->dlm_mapped_ad ) {
got_dn = 0;
break;
}
if ( dlm->dlm_memberOf_ad ) {
int want = 0;
@ -1774,6 +1785,9 @@ dynlist_search( Operation *op, SlapReply *rs )
}
}
if ( !got_dn )
continue;
if ( static_oc ) {
f[0].f_choice = LDAP_FILTER_OR;
f[0].f_list = &f[1];