diff options
author | Werner Koch <[email protected]> | 2021-07-08 11:55:18 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2021-07-08 11:57:13 +0000 |
commit | 101ba4f18aceb39c4d5f0e0a7e16e66827f8e612 (patch) | |
tree | 7cdc6b3f168b8f62e6e7dcf3fbab3ec165b33f7c /kbx/keybox-search-desc.h | |
parent | scd: Detect external interference when PCSC_SHARED. (diff) | |
download | gnupg-101ba4f18aceb39c4d5f0e0a7e16e66827f8e612.tar.gz gnupg-101ba4f18aceb39c4d5f0e0a7e16e66827f8e612.zip |
kbx: Fix keyboxd searching with multiple patterns.
* kbx/keybox-search-desc.h (struct keydb_search_desc): New flag
name_used.
* common/userids.c (classify_user_id): Set flag.
* kbx/kbxserver.c (struct search_backing_store_s): New.
(cmd_search): use a backing store for the const pointers.
(kbxd_start_command_handler): Release the backing store.
--
Well, the search object partly uses buffers but also const
pointers (for strings and the serial number). This when assigning
such objects to an another one we should really take a deep copy and
not just copy the pointer. The more clean solution would have been to
provide a storage option the search object but that needs checking the
code at too many places so that I decided to use a separate backing
store array here.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'kbx/keybox-search-desc.h')
-rw-r--r-- | kbx/keybox-search-desc.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kbx/keybox-search-desc.h b/kbx/keybox-search-desc.h index 9a0df2846..f312da99b 100644 --- a/kbx/keybox-search-desc.h +++ b/kbx/keybox-search-desc.h @@ -83,6 +83,7 @@ struct keydb_search_desc unsigned char grip[KEYGRIP_LEN]; unsigned char ubid[UBID_LEN]; } u; + byte name_used;/* The union uses NAME. */ byte snhex; /* SN above is a hexstring and not binary. */ byte fprlen; /* Only used with KEYDB_SEARCH_MODE_FPR. */ int exact; /* Use exactly this key ('!' suffix in gpg). */ |