1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-05-14 08:13:25 +02:00

keyboxd: Searching UpperCaseAddress.

* kbx/backend-sqlite.c (run_select_statement): Convert with
ascii_strlwr when the mode is KEYDB_SEARCH_MODE_MAIL.

--

GnuPG-bug-id: 7576
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2025-03-26 14:26:54 +09:00 committed by Werner Koch
parent 052055fea5
commit 0812ab2996
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -956,8 +956,17 @@ run_select_statement (ctrl_t ctrl, be_sqlite_local_t ctx,
extra, " ORDER BY p.ubid", &ctx->select_stmt); extra, " ORDER BY p.ubid", &ctx->select_stmt);
if (!err) if (!err)
{ {
s = desc[descidx].u.name; if (desc[descidx].mode == KEYDB_SEARCH_MODE_MAIL)
if (s && *s == '<' && s[1]) {
char *mail = xtrystrdup (desc[descidx].u.name);
if (!mail)
err = gpg_error_from_syserror ();
else
{
ascii_strlwr (mail);
s = mail;
if (*s == '<' && s[1])
{ /* It is common that the indicator for exact addrspec { /* It is common that the indicator for exact addrspec
* search has not been removed. We do this here. */ * search has not been removed. We do this here. */
s++; s++;
@ -966,9 +975,18 @@ run_select_statement (ctrl_t ctrl, be_sqlite_local_t ctx,
n--; n--;
} }
else else
n = strlen (s);
err = run_sql_bind_ntext (ctx->select_stmt, 1, s, n);
xfree (mail);
}
}
else
{
s = desc[descidx].u.name;
n = s? strlen (s):0; n = s? strlen (s):0;
err = run_sql_bind_ntext (ctx->select_stmt, 1, s, n); err = run_sql_bind_ntext (ctx->select_stmt, 1, s, n);
} }
}
break; break;
case KEYDB_SEARCH_MODE_MAILSUB: case KEYDB_SEARCH_MODE_MAILSUB: