gpg: New mechanism "clear" for --auto-key-locate.

* g10/getkey.c (parse_auto_key_locate): Implement "clear".
This commit is contained in:
Werner Koch 2014-03-17 15:36:15 +01:00
parent 2223eaefaf
commit 1d642d3ca8
2 changed files with 13 additions and 2 deletions

View File

@ -1482,6 +1482,10 @@ mechanisms, in the order they are to be tried:
position of this mechanism in the list does not matter. It is not
required if @code{local} is also used.
@item clear
Clear all defined mechanisms. This is usefule to override
mechanisms fiven in a config file.
@end table
@item --keyid-format @code{short|0xshort|long|0xlong}

View File

@ -712,7 +712,7 @@ get_pubkey_byname (ctrl_t ctrl, GETKEY_CTX * retctx, PKT_public_key * pk,
is_mbox = is_valid_mailbox (name);
/* Check whether we the default local search has been disabled.
/* Check whether the default local search has been disabled.
This is the case if either the "nodefault" or the "local" keyword
are in the list of auto key locate mechanisms.
@ -2809,7 +2809,14 @@ parse_auto_key_locate (char *options)
akl = xmalloc_clear (sizeof (*akl));
if (ascii_strcasecmp (tok, "nodefault") == 0)
if (ascii_strcasecmp (tok, "clear") == 0)
{
xfree (akl);
free_akl (opt.auto_key_locate);
opt.auto_key_locate = NULL;
continue;
}
else if (ascii_strcasecmp (tok, "nodefault") == 0)
akl->type = AKL_NODEFAULT;
else if (ascii_strcasecmp (tok, "local") == 0)
akl->type = AKL_LOCAL;