1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

kbx: Fix keyboxd search first.

* kbx/kbxserver.c (cmd_next): Switch to mode next if needed.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-09-09 14:25:02 +02:00
parent 1545b948e1
commit 5e00c1773d
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -352,10 +352,24 @@ cmd_next (assuan_context_t ctx, char *line)
ctrl->no_data_return = opt_no_data; ctrl->no_data_return = opt_no_data;
if (ctrl->server_local->multi_search_desc_len) if (ctrl->server_local->multi_search_desc_len)
{
/* The next condition should never be tru but we better handle
* the first/next transition anyway. */
if (ctrl->server_local->multi_search_desc[0].mode
== KEYDB_SEARCH_MODE_FIRST)
ctrl->server_local->multi_search_desc[0].mode = KEYDB_SEARCH_MODE_NEXT;
err = kbxd_search (ctrl, ctrl->server_local->multi_search_desc, err = kbxd_search (ctrl, ctrl->server_local->multi_search_desc,
ctrl->server_local->multi_search_desc_len, 0); ctrl->server_local->multi_search_desc_len, 0);
}
else else
{
/* We need to do the transition from first to next here. */
if (ctrl->server_local->search_desc.mode == KEYDB_SEARCH_MODE_FIRST)
ctrl->server_local->search_desc.mode = KEYDB_SEARCH_MODE_NEXT;
err = kbxd_search (ctrl, &ctrl->server_local->search_desc, 1, 0); err = kbxd_search (ctrl, &ctrl->server_local->search_desc, 1, 0);
}
if (err) if (err)
goto leave; goto leave;