mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* ksutil.h, ksutil.c (parse_ks_options): Remove exact-name and
exact-email. (classify_ks_search): Mimic the gpg search modes instead with *, =, <, and @. * gpgkeys_ldap.c (search_key), gpgkeys_hkp.c (search_key): Call them here. Suggested by Jason Harris.
This commit is contained in:
parent
a21fedf555
commit
aec65a94d8
5 changed files with 60 additions and 72 deletions
|
@ -298,27 +298,6 @@ parse_ks_options(char *line,struct ks_options *opt)
|
|||
return KEYSERVER_NO_MEMORY;
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(start,"exact-email")==0
|
||||
|| strcasecmp(start,"exact-mail")==0)
|
||||
{
|
||||
if(no)
|
||||
opt->flags.exact_email=0;
|
||||
else
|
||||
{
|
||||
opt->flags.exact_email=1;
|
||||
opt->flags.exact_name=0;
|
||||
}
|
||||
}
|
||||
else if(strcasecmp(start,"exact-name")==0)
|
||||
{
|
||||
if(no)
|
||||
opt->flags.exact_name=0;
|
||||
else
|
||||
{
|
||||
opt->flags.exact_name=1;
|
||||
opt->flags.exact_email=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
@ -356,6 +335,27 @@ print_nocr(FILE *stream,const char *str)
|
|||
}
|
||||
}
|
||||
|
||||
enum ks_search_type
|
||||
classify_ks_search(const char **search)
|
||||
{
|
||||
switch(**search)
|
||||
{
|
||||
default:
|
||||
return KS_SEARCH_SUBSTR;
|
||||
case '*':
|
||||
(*search)++;
|
||||
return KS_SEARCH_SUBSTR;
|
||||
case '=':
|
||||
(*search)++;
|
||||
return KS_SEARCH_EXACT;
|
||||
case '<':
|
||||
return KS_SEARCH_MAIL;
|
||||
case '@':
|
||||
(*search)++;
|
||||
return KS_SEARCH_MAILSUB;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined (HAVE_LIBCURL) || defined (FAKE_CURL)
|
||||
int
|
||||
curl_err_to_gpg_err(CURLcode error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue