diff options
| author | Werner Koch <[email protected]> | 2019-08-23 11:22:15 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2019-08-23 11:22:15 +0000 |
| commit | d058d80ed0d5edeff6d85108054b1dfd45ddad7d (patch) | |
| tree | d230ad54433d3f0cb8cbe31cd67069e347591401 /g10/getkey.c | |
| parent | gpg: Silence some warning messages during -Kv. (diff) | |
| download | gnupg-d058d80ed0d5edeff6d85108054b1dfd45ddad7d.tar.gz gnupg-d058d80ed0d5edeff6d85108054b1dfd45ddad7d.zip | |
gpg: Allow --locate-external-key even with --no-auto-key-locate.
* g10/getkey.c (akl_empty_or_only_local): New.
* g10/gpg.c (DEFAULT_AKL_LIST): New.
(main): Use it here.
(main) <aLocateExtKeys>: Set default AKL if none is set.
--
This better matches the expectations of the user. The used list in
this case is the default list ("local,wkd") with local ignored by the
command anyway.
GnuPG-bug-id: 4662
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/getkey.c')
| -rw-r--r-- | g10/getkey.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/g10/getkey.c b/g10/getkey.c index 57617a0a9..dc3dc4844 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -3922,6 +3922,26 @@ release_akl (void) } } + +/* Returns true if the AKL is empty or has only the local method + * active. */ +int +akl_empty_or_only_local (void) +{ + struct akl *akl; + int any = 0; + + for (akl = opt.auto_key_locate; akl; akl = akl->next) + if (akl->type != AKL_NODEFAULT && akl->type != AKL_LOCAL) + { + any = 1; + break; + } + + return !any; +} + + /* Returns false on error. */ int parse_auto_key_locate (const char *options_arg) |
