aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2025-03-26 05:26:54 +0000
committerNIIBE Yutaka <[email protected]>2025-03-26 05:26:54 +0000
commit7fc5b0328fdd94a5746cfc4cfc71ae60d4fb4171 (patch)
tree2f8fe0bb7e8b83758cc18d1dedabd5fc0fb9d054
parentdoc: Update NEWS (diff)
downloadgnupg-7fc5b0328fdd94a5746cfc4cfc71ae60d4fb4171.tar.gz
gnupg-7fc5b0328fdd94a5746cfc4cfc71ae60d4fb4171.zip
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 <[email protected]>
-rw-r--r--kbx/backend-sqlite.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/kbx/backend-sqlite.c b/kbx/backend-sqlite.c
index 4c67c3ef7..97906235c 100644
--- a/kbx/backend-sqlite.c
+++ b/kbx/backend-sqlite.c
@@ -956,18 +956,36 @@ run_select_statement (ctrl_t ctrl, be_sqlite_local_t ctx,
extra, " ORDER BY p.ubid", &ctx->select_stmt);
if (!err)
{
- s = desc[descidx].u.name;
- if (s && *s == '<' && s[1])
- { /* It is common that the indicator for exact addrspec
- * search has not been removed. We do this here. */
- s++;
- n = strlen (s);
- if (n > 1 && s[n-1] == '>')
- n--;
+ if (desc[descidx].mode == KEYDB_SEARCH_MODE_MAIL)
+ {
+ 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
+ * search has not been removed. We do this here. */
+ s++;
+ n = strlen (s);
+ if (n > 1 && s[n-1] == '>')
+ n--;
+ }
+ else
+ n = strlen (s);
+ err = run_sql_bind_ntext (ctx->select_stmt, 1, s, n);
+ xfree (mail);
+ }
}
else
- n = s? strlen (s):0;
- err = run_sql_bind_ntext (ctx->select_stmt, 1, s, n);
+ {
+ s = desc[descidx].u.name;
+ n = s? strlen (s):0;
+ err = run_sql_bind_ntext (ctx->select_stmt, 1, s, n);
+ }
}
break;