keyboxd: Fix user id based queries

* kbx/backend-sqlite.c (run_select_statement): Add the missing join
for user id bases queries.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2020-09-02 14:50:59 +02:00
parent 2042f5a464
commit 4d839f5a80
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
1 changed files with 4 additions and 4 deletions

View File

@ -696,7 +696,7 @@ run_select_statement (be_sqlite_local_t ctx,
if (!ctx->select_stmt)
err = run_sql_prepare ("SELECT p.ubid, p.type, p.keyblob"
" FROM pubkey as p, userid as u"
" WHERE u.uid = ?1",
" WHERE p.ubid = u.ubid AND u.uid = ?1",
&ctx->select_stmt);
if (!err)
err = run_sql_bind_text (ctx->select_stmt, 1, desc[descidx].u.name);
@ -706,7 +706,7 @@ run_select_statement (be_sqlite_local_t ctx,
if (!ctx->select_stmt)
err = run_sql_prepare ("SELECT p.ubid, p.type, p.keyblob"
" FROM pubkey as p, userid as u"
" WHERE u.addrspec = ?1",
" WHERE p.ubid = u.ubid AND u.addrspec = ?1",
&ctx->select_stmt);
if (!err)
err = run_sql_bind_text (ctx->select_stmt, 1, desc[descidx].u.name);
@ -716,7 +716,7 @@ run_select_statement (be_sqlite_local_t ctx,
if (!ctx->select_stmt)
err = run_sql_prepare ("SELECT p.ubid, p.type, p.keyblob"
" FROM pubkey as p, userid as u"
" WHERE u.addrspec LIKE ?1",
" WHERE p.ubid = u.ubid AND u.addrspec LIKE ?1",
&ctx->select_stmt);
if (!err)
err = run_sql_bind_text_like (ctx->select_stmt, 1,
@ -727,7 +727,7 @@ run_select_statement (be_sqlite_local_t ctx,
if (!ctx->select_stmt)
err = run_sql_prepare ("SELECT p.ubid, p.type, p.keyblob"
" FROM pubkey as p, userid as u"
" WHERE u.uid LIKE ?1",
" WHERE p.ubid = u.ubid AND u.uid LIKE ?1",
&ctx->select_stmt);
if (!err)
err = run_sql_bind_text_like (ctx->select_stmt, 1,