[Date Prev][Date Next] [Chronological] [Thread] [Top]

fix (ITS#5717)



--E13BgyNx05feLLmH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Attached is a fix for the problem:
1) if the member attribute is not part of the requested attribute set,
but the mapped attributeis, then we still need to generate the dynlist
2) in this cas, we must add the member attribute to the searched
attributes.


-- 
Emmanuel Dreyfus
manu@netbsd.org

--E13BgyNx05feLLmH
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="dynlist.patch"

--- servers/slapd/overlays/dynlist.c.orig	2008-07-10 02:43:03.000000000 +0200
+++ servers/slapd/overlays/dynlist.c	2008-09-29 17:43:07.000000000 +0200
@@ -369,9 +369,12 @@
 
 	/* Don't generate member list if it wasn't requested */
 	for ( dlm = dli->dli_dlm; dlm; dlm = dlm->dlm_next ) {
 		if ( userattrs ||
-		     ad_inlist( dlm->dlm_member_ad, rs->sr_attrs ) ) 
+		     ad_inlist( dlm->dlm_member_ad, rs->sr_attrs ) )
+			break;
+		if ( dlm->dlm_mapped_ad &&
+		     ad_inlist( dlm->dlm_mapped_ad, rs->sr_attrs ) )
 			break;
 	}
 	if ( dli->dli_dlm && !dlm )
 		return SLAP_CB_CONTINUE;
@@ -477,8 +480,11 @@
 		} else {
 			for ( i = 0; lud->lud_attrs[i]; i++)
 				/* just count */ ;
 
+			if ( dlm && dlm->dlm_member_ad && !ad_inlist( dlm->dlm_member_ad, rs->sr_attrs ) )
+				i++;
+
 			o.ors_attrs = op->o_tmpcalloc( i + 1, sizeof( AttributeName ), op->o_tmpmemctx );
 			for ( i = 0, j = 0; lud->lud_attrs[i]; i++) {
 				const char	*text = NULL;
 	
@@ -515,8 +521,14 @@
 
 				j++;
 			}
 
+			if ( dlm && dlm->dlm_member_ad && !ad_inlist( dlm->dlm_member_ad, rs->sr_attrs ) ) {
+				o.ors_attrs[j].an_name = dlm->dlm_member_ad->ad_cname;
+				o.ors_attrs[j].an_desc = dlm->dlm_member_ad;
+				j++;
+			}
+
 			if ( j == 0 ) {
 				goto cleanup;
 			}
 		

--E13BgyNx05feLLmH--