]> git.sur5r.net Git - openldap/commitdiff
add dyngroup compare functionality to dynlist
authorPierangelo Masarati <ando@openldap.org>
Mon, 28 Nov 2005 11:34:46 +0000 (11:34 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 28 Nov 2005 11:34:46 +0000 (11:34 +0000)
doc/man/man5/slapo-dynlist.5
servers/slapd/overlays/dynlist.c
tests/scripts/test044-dynlist

index fc0cb20d2e84010f8a947be5822147ca1b6535b0..166db769d3bec31bcc8742cfe0f43d5cad36affe 100644 (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.
index 5ccccaf3b965ab97227c47b042ecfe9296568c95..3ad2a6bee80f9d571cc81335180c9fe3db429ffa 100644 (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;
index 145432aeca4572568b461b4ba1e55e89da334868..faf24eeee803ac8e382ffaf497ea9de764c3121f 100755 (executable)
@@ -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