aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--g10/call-keyboxd.c3
-rw-r--r--kbx/backend-sqlite.c17
-rw-r--r--kbx/kbxserver.c2
-rw-r--r--sm/keydb.c3
4 files changed, 21 insertions, 4 deletions
diff --git a/g10/call-keyboxd.c b/g10/call-keyboxd.c
index 9042c833c..e2fede235 100644
--- a/g10/call-keyboxd.c
+++ b/g10/call-keyboxd.c
@@ -759,7 +759,8 @@ keydb_search (KEYDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
break;
case KEYDB_SEARCH_MODE_MAIL:
- snprintf (line, sizeof line, "SEARCH %s -- <%s", more, desc->u.name);
+ snprintf (line, sizeof line, "SEARCH %s -- <%s",
+ more, desc->u.name+(desc->u.name[0] == '<') );
break;
case KEYDB_SEARCH_MODE_MAILSUB:
diff --git a/kbx/backend-sqlite.c b/kbx/backend-sqlite.c
index ae2530d1a..202897e91 100644
--- a/kbx/backend-sqlite.c
+++ b/kbx/backend-sqlite.c
@@ -839,6 +839,8 @@ run_select_statement (ctrl_t ctrl, be_sqlite_local_t ctx,
unsigned int descidx;
const char *extra = NULL;
unsigned char kidbuf[8];
+ const char *s;
+ size_t n;
descidx = ctx->descidx;
@@ -916,7 +918,20 @@ run_select_statement (ctrl_t ctrl, be_sqlite_local_t ctx,
" WHERE p.ubid = u.ubid AND u.addrspec = ?1",
extra, " ORDER BY p.ubid", &ctx->select_stmt);
if (!err)
- err = run_sql_bind_text (ctx->select_stmt, 1, desc[descidx].u.name);
+ {
+ 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--;
+ }
+ else
+ n = s? strlen (s):0;
+ err = run_sql_bind_ntext (ctx->select_stmt, 1, s, n);
+ }
break;
case KEYDB_SEARCH_MODE_MAILSUB:
diff --git a/kbx/kbxserver.c b/kbx/kbxserver.c
index 8a75035a5..55b478586 100644
--- a/kbx/kbxserver.c
+++ b/kbx/kbxserver.c
@@ -336,7 +336,7 @@ cmd_search (assuan_context_t ctx, char *line)
}
else
{
- err = classify_user_id (line, &ctrl->server_local->search_desc, 0);
+ err = classify_user_id (line, &ctrl->server_local->search_desc, 1);
if (err)
goto leave;
}
diff --git a/sm/keydb.c b/sm/keydb.c
index e092e4a01..990f63a61 100644
--- a/sm/keydb.c
+++ b/sm/keydb.c
@@ -1617,7 +1617,8 @@ keydb_search (ctrl_t ctrl, KEYDB_HANDLE hd,
break;
case KEYDB_SEARCH_MODE_MAIL:
- snprintf (line, sizeof line, "SEARCH --x509 <%s", desc[0].u.name);
+ snprintf (line, sizeof line, "SEARCH --x509 <%s",
+ desc[0].u.name + (desc[0].u.name[0] == '<'));
break;
case KEYDB_SEARCH_MODE_MAILSUB: