Commit 267486bf authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

fix ITS#4479

parent 8fb8b17c
......@@ -1287,6 +1287,9 @@ limits_check( Operation *op, SlapReply *rs )
return -1;
}
op->ors_slimit = slimit;
} else if ( slimit == 0 ) {
op->ors_slimit = 0;
}
} else {
......
......@@ -1359,6 +1359,52 @@ case $RC in
;;
esac
# ITS#4479
PAGESIZE=1
SIZELIMIT=2
echo "Testing size limit request ($SIZELIMIT) for unlimited ID and pagesize=$PAGESIZE..."
$LDAPRSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT1 -w secret -z $SIZELIMIT \
-D 'cn=Unlimited User,ou=People,dc=example,dc=com' \
-E '!pr='$PAGESIZE'/noprompt' '(objectClass=*)' > $SEARCHOUT 2>&1
RC=$?
COUNT=`awk '/^# numEntries:/ {print $3}' $SEARCHOUT`
case $RC in
0)
if test x"$COUNT" != x ; then
if test "$COUNT" -gt "$SIZELIMIT" ; then
echo "...error: got $COUNT entries instead of the requested $SIZELIMIT"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
echo "...didn't bump into the requested size limit ($SIZELIMIT; got $COUNT entries)"
else
echo "...error: did not expect ldapsearch success ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit 1
fi
;;
4)
if test x"$COUNT" != x ; then
if test $COUNT = $SIZELIMIT ; then
echo "...bumped into requested size limit ($SIZELIMIT)"
else
echo "...error: got $COUNT entries while requesting $SIZELIMIT..."
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
else
echo "...error: bumped into server-side size limit, but got no entries!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
fi
;;
*)
echo "ldapsearch failed ($RC)!"
test $KILLSERVERS != no && kill -HUP $KILLPIDS
exit $RC
;;
esac
test $KILLSERVERS != no && kill -HUP $KILLPIDS
echo ">>>>> Test succeeded"
......
Supports Markdown
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