add dyngroup compare functionality to dynlist

This commit is contained in:
Pierangelo Masarati 2005-11-28 11:34:46 +00:00
parent 6459cbb7ce
commit 26d802ee53
3 changed files with 30 additions and 3 deletions

View File

@ -57,10 +57,19 @@ occurs for that specific URI. This statement is required.
The name of the attributeDescription that will list the DN of the entries
resulting from the internal search. This statement is optional and, if
present, changes the behavior of the overlay into that of a dynamic group.
The <attrs> portion of the URI is ignored, and the DNs of all the entries
The <attrs> portion of the URI must be absent, and the DNs of all the entries
resulting from the expansion of the URI are listed as values of this
attribute.
Compares to
.B dynlist-member-ad
attributes of entries with
.B dynlist-oc
objectClass apply as if the DN of the entries resulting from the expansion
of the URI were present in the
.B dynlist-oc
entry as values of the
.B dynlist-member-ad
attributeType.
.LP
The dynlist overlay may be used with any backend, but it is mainly
intended for use with local storage backends.

View File

@ -503,6 +503,24 @@ dynlist_compare( Operation *op, SlapReply *rs )
int rc;
dynlist_sc_t dlc = { 0 };
if ( op->oq_compare.rs_ava->aa_desc == dli->dli_member_ad ) {
/* This compare is for one of the attributes we're
* interested in. We'll use slapd's existing dyngroup
* evaluator to get the answer we want.
*/
int cache = op->o_do_not_cache;
op->o_do_not_cache = 1;
rs->sr_err = backend_group( op, NULL, &op->o_req_ndn,
&op->oq_compare.rs_ava->aa_value, dli->dli_oc, dli->dli_ad );
op->o_do_not_cache = cache;
if ( rs->sr_err == LDAP_SUCCESS ) {
rs->sr_err = LDAP_COMPARE_TRUE;
}
return SLAP_CB_CONTINUE;
}
dlc.dlc_dli = dli;
cb.sc_private = &dlc;
cb.sc_response = dynlist_sc_save_entry;

View File

@ -288,7 +288,7 @@ CMPDN="cn=Bjorn Jensen,ou=Information Technology Division,ou=People,$BASEDN"
echo "Testing list compare..."
echo "# Testing list compare..." >> $SEARCHOUT
$LDAPCOMPARE -h $LOCALHOST -p $PORT1 \
"cn=Dynamic List,$LISTDN" "member:$CMPDN" \
"cn=Dynamic List of Members,$LISTDN" "member:$CMPDN" \
>> $SEARCHOUT 2>&1
RC=$?
case $RC in