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:
parent
052055fea5
commit
0812ab2996
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user