Commit bc659074 authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

ITS#9747 dynlist: fix Compare for static groups

Fallback to static check if static groups are configured and
dynamic group check returns false.
parent 30baa30b
......@@ -887,6 +887,13 @@ dynlist_compare( Operation *op, SlapReply *rs )
* the assertion is FALSE rather than
* UNDEFINED */
rs->sr_err = LDAP_COMPARE_FALSE;
/* If also using static groups, fallback to
* vanilla compare
*/
if ( dlm->dlm_static_oc )
return SLAP_CB_CONTINUE;
break;
}
......
......@@ -386,6 +386,10 @@ memberOf: cn=all staff,ou=groups,dc=example,dc=com
memberOf: cn=alumni assoc staff,ou=groups,dc=example,dc=com
memberOf: cn=dynamic list of members,ou=dynamic lists,dc=example,dc=com
TRUE
FALSE
# Testing nested dynamic group functionality...
dn: cn=Dynamic List,ou=Dynamic Lists,dc=example,dc=com
objectClass: groupOfURLs
......
......@@ -808,6 +808,60 @@ if test $RC != 0 ; then
exit $RC
fi
echo "Testing static group member compare..."
echo "# Testing static group member compare..." >> $SEARCHOUT
$LDAPCOMPARE -H $URI1 \
"cn=all staff,ou=groups,$BASEDN" "member:cn=Mark Elliot,ou=Alumni Association,ou=People,$BASEDN" >> $SEARCHOUT
RC=$?
case $RC in
5)
echo "ldapcompare returned FALSE ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
6)
echo "ldapcompare returned TRUE ($RC)"
;;
0)
echo "ldapcompare returned success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
;;
*)
echo "ldapcompare failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
esac
echo "" >> $SEARCHOUT
echo "Testing static group non-member compare (should return FALSE)..."
echo "# Testing static group non-member compare (should return FALSE)..." >> $SEARCHOUT
$LDAPCOMPARE -H $URI1 \
"cn=all staff,ou=groups,$BASEDN" "member:cn=Not A User,ou=Alumni Association,ou=People,$BASEDN" >> $SEARCHOUT
RC=$?
case $RC in
5)
echo "ldapcompare returned FALSE ($RC)"
;;
6)
echo "ldapcompare returned TRUE ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
0)
echo "ldapcompare returned success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
;;
*)
echo "ldapcompare failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
esac
echo "" >> $SEARCHOUT
echo "Reconfiguring slapd..."
$LDAPMODIFY -x -D cn=config -H $URI1 -y $CONFIGPWF > \
$TESTOUT 2>&1 << EOMODS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment