mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
wkd: Fix client issue with leading or trailing spaces in user-ids.
* common/recsel.c (recsel_parse_expr): Add flag -t. * common/stringhelp.c: Remove assert.h. (strtokenize): Factor code out to do_strtokenize. (strtokenize_nt): New. (do_strtokenize): Add arg trim to support the strtokenize_nt. * common/t-stringhelp.c (test_strtokenize_nt): New test cases. * tools/wks-util.c (wks_list_key): Use strtokenize_nt and the recsel flag -t. -- This fixes a bug with user ids with leading spaces because: wks-client lists all mail addresses from the key and matches them to the requested mail address. If there are several user-ids all with the same mail address wks-client picks one of them and then extracts exactly that user id. However, here it does not match by the mail address but by the full user-id so that we can be sure that there will be only one user-id in the final key. The filter built expression unfortunately strips leading blanks but requires a verbatim match. Thus it won't find the user id again and errors out. The new -t flag and a non-trimming strtokenize solves the problem. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
1565baa93a
commit
b4345f7521
6 changed files with 202 additions and 22 deletions
|
@ -4072,6 +4072,9 @@ are:
|
|||
@var{VALUE} spans to the end of the expression.
|
||||
@item -c
|
||||
The string match in this part is done case-sensitive.
|
||||
@item -t
|
||||
Leading and trailing spaces are not removed from @var{VALUE}.
|
||||
The optional single space after @var{op} is here required.
|
||||
@end table
|
||||
|
||||
The filter options concatenate several specifications for a filter of
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue