mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-02-23 14:09:39 +08:00
fix ITS#4479
This commit is contained in:
parent
8fb8b17c04
commit
267486bfad
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user