1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

mdssvc: fix enforcement of "elasticsearch:max results"

This wasn't enforced at all thus a query would return all available matches
without limit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15342

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit d8fa5c8e2a1794ea8dc663485315ebd9401b2628)
This commit is contained in:
Ralph Boehme 2023-04-20 17:58:38 +02:00 committed by Jule Anger
parent 506e9a2d72
commit 57d8d00799

View File

@ -800,7 +800,7 @@ static void mds_es_search_http_read_done(struct tevent_req *subreq)
}
DBG_DEBUG("Hits: %zu\n", hits);
for (i = 0; i < hits; i++) {
for (i = 0; i < hits && s->from + i < s->max; i++) {
const char *path = NULL;
match = json_array_get(matches, i);